研究段式液晶驱动有一段时间了,今天刚把它搞定,之前一直很纠结,用PSoC Creator创建了原件,然后调用LCD_Seg_Start();总是把全部
段点亮,然后就不受控制了,试了很多方法都不行。今天又仔细看了下,然后修改了修改了通用配置下的LCD MODE,居然可以控制了,之前
一直用的是低速模式,时钟也改到很低,就是不行。看手册上讲
Low Speed(低速):适用于活动和深度睡眠功耗模式
High Speed(高速):适用于活动功耗模式
这样应该只是运行频率的区别,暂且不管它了,先发上来,后面再慢慢研究。
放置的元件如下
段式液晶配置如下
显示助手配置
硬件IO配置如下
程序如下 /*======================================== * * Copyright YOUR COMPANY, THE YEAR * All Rights Reserved * UNPUBLISHED, LICENSED SOFTWARE. * * CONFIDENTIAL AND PROPRIETARY INFORMATION * WHICH IS THE PROPERTY OF your company. * * ======================================== */ volatile uint32_t ultick=0; void isr_timer(void) { ultick++; } uint32_t get_tick(void) { return ultick; } void delayms(uint32_t ms) { uint32_t oldtick = get_tick(); while(get_tick()-oldtick } int main() { /* Placeyour initialization/startup code here (e.g. MyInst_Start()) */ isr_timer_StartEx(isr_timer); Timer_Start(); CyGlobalIntEnable; /* Uncommentthis line to enable global interrupts. */ LCD_Seg_Start(); LCD_Seg_ClearDisplay(); LCD_Seg_Write7SegDigit_0(0x1,3); LCD_Seg_Write7SegDigit_0(0x2,2); LCD_Seg_Write7SegDigit_0(0x3,1); LCD_Seg_Write7SegDigit_0(0x4,0); for(;;) { led_Write(0); delayms(250); led_Write(1); delayms(250); } }
显示效果如下
YP20131125144802818.jpeg
(506.53 KB, 下载次数: 53)
|