[资料分享] MSP430 LCD控制器解释

fish001   2017-11-11 21:10 楼主
CC430F613x的LCD控制器最多能控制160段。
The LCD_B controller features are:
• Display memory
• Automatic signal generation
• Configurable frame frequency
• Blinking of individual segments with separate blinking memory
• Regulated charge pump
• Contrast control by software
• Support for four types of LCDs
– Static
– 2-mux, 1/2 bias or 1/3 bias
– 3-mux, 1/2 bias or 1/3 bias
– 4-mux, 1/2 bias or 1/3 bias
把每一段映射到一个位(bit),比如LCDM1的每一个位(bit)都对应一个段。这样有20个寄存器每个有8个位,所以能映射20*8=160段。

上图是个静态驱动示意图,所谓静态就是只有一个公共端(COM0),这样公共端就不需要切换了。


[cpp] view plain copy


  • //******************************************************************************  
  • //  eZ430 chronos hello world  
  • //  Description: initializes lcd module and shows the string 'hi earth' on the  
  • //               lcd display becuase 'hello world' is too long  
  • //  Author: Felix Genicio  
  • //******************************************************************************  
  •   
  • #include  "cc430x613x.h"  
  • #include   
  •   
  • void main(void)  
  • {  
  •     unsigned char * lcdmem;  
  •   
  •     // Clear entire display memory  
  •     LCDBMEMCTL |= LCDCLRBM + LCDCLRM;//清除LCD闪烁内存、清除LCD内存  
  •   
  •     // LCD_FREQ = ACLK/16/8 = 256Hz,其中ACLK=32768Hz  
  •     // Frame frequency = 256Hz/4 = 64Hz, LCD mux 4, LCD on  
  •     LCDBCTL0 = (LCDDIV0 + LCDDIV1 + LCDDIV2 + LCDDIV3) | (LCDPRE0 + LCDPRE1) | LCD4MUX | LCDON;  
  •   
  •     // LCB_BLK_FREQ = ACLK/8/4096 = 1Hz ,闪烁失能  
  •     LCDBBLKCTL = (LCDBLKDIV0 + LCDBLKDIV1 + LCDBLKDIV2)|(LCDBLKPRE0 + LCDBLKPRE1) |  LCDBLKMOD0;  
  •   
  •     // I/O to COM outputs  
  •     P5SEL |= (BIT5 | BIT6 | BIT7);  
  •     P5DIR |= (BIT5 | BIT6 | BIT7);  
  •   
  •     // Activate LCD output  
  •     LCDBPCTL0 = 0xFFFF;  // Select LCD segments S0-S15  
  •     LCDBPCTL1 = 0x00FF;  // Select LCD segments S16-S22  
  •   
  •     // LCD_B Base Address is 0A00H page 30 y in SALS554 document  
  •     // show 'h'  
  •     lcdmem  = (unsigned char *)0x0A21;  
  •     *lcdmem = (unsigned char)(*lcdmem | (BIT2+BIT1+BIT6+BIT0));  
  •     // show 'i'  
  •     lcdmem  = (unsigned char *)0x0A22;  
  •     *lcdmem = (unsigned char)(*lcdmem | (BIT2));  
  •     // show 'E'  
  •     lcdmem  = (unsigned char *)0x0A2B;  
  •     *lcdmem = (unsigned char)(*lcdmem | (BIT4+BIT5+BIT6+BIT0+BIT3));  
  •     // show 'A'  
  •     lcdmem  = (unsigned char *)0x0A2A;  
  •     *lcdmem = (unsigned char)(*lcdmem | (BIT0+BIT1+BIT2+BIT4+BIT5+BIT6));  
  •     // show 'r'  
  •     lcdmem  = (unsigned char *)0x0A29;  
  •     *lcdmem = (unsigned char)(*lcdmem | (BIT6+BIT5));  
  •     // show 't'  
  •     lcdmem  = (unsigned char *)0x0A28;  
  •     *lcdmem = (unsigned char)(*lcdmem | (BIT4+BIT5+BIT6+BIT3));  
  •     // show 'h'  
  •     lcdmem  = (unsigned char *)0x0A27;  
  •     *lcdmem = (unsigned char)(*lcdmem | (BIT4+BIT5+BIT6+BIT2));  
  •   
  •   __no_operation();  // For debugger  
  • }  



回复评论

暂无评论,赶紧抢沙发吧
电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 京公网安备 11010802033920号
    写回复