This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430LCD

Other Parts Discussed in Thread: MSP430F4270
//******************************************************************************
//   MSP430x42x0 Demo - LCD_A Put "0123456" on SBLCDA4 LCD
//
//  Description; Put "0123456" on SBLCDA4 LCD.  Charge pump is enabled
//  and supplies 2.89V to LCD
//  ACLK = LFXT1 = 32768, MCLK = SMCLK = DCO = 32xACLK = 1.048576MHz
//  //*An external watch crystal is required on XIN/XOUT for ACLK*//
//  //*A 4.7 uF or larger capacitor must be connected from pin LCDCAP to ground*//
//  //*when the internal charge pump is enabled. Otherwise, damage can occur.*//
//               MSP430F4270
//            -----------------
//        /|\|              XIN|-
//         | |                 | 32kHz
//         --|RST          XOUT|-
//           |                 |
//           |                 |    SBLCDA4
//           |             S0  |     ----------
//           |              -  |--> |  4 3 2 1 |
//       +---|LCDCAP         S8 |     ----------
//       |   |             COM0|-----||||
//  10  uF-+-  |            COM1|------|||
//      -+-   |             COM2|-------||
//       |   |             COM3|--------|
//      \|/  |                 |                |
//
//  L. Westlund / S. Karthikeyan
//  Texas Instruments Inc.
//  June 2005
//  Built with CCE Version: 3.2.0 and IAR Embedded Workbench Version: 3.30A
//*****************************************************************************
#include  <msp430x42x0.h>
 
// LCD segment definitions.
#define d 0x80
#define c 0x40
#define b 0x20
#define a 0x10
#define h 0x08
#define e 0x04
#define g 0x02
#define f 0x01
 
const char char_gen[] = {                   // definitions for digits
  a+b+c+d+e+f,                              // Displays "0"
  b+c,                                      // Displays "1"
  a+b+d+e+g,                                // Displays "2"
  a+b+c+d+g,                                // Displays "3"
  b+c+f+g,                                  // Displays "4"
  a+c+d+f+g,                                // Displays "5"
  a+c+d+e+f+g,                              // Displays "6"
  a+b+c,                                    // Displays "7"
  a+b+c+d+e+f+g,                            // Displays "8"
  a+b+c+d+f+g                               // Displays "9"
};
 
void main(void)
{
  int i;
  WDTCTL = WDTPW + WDTHOLD;                 // Stop watchdog timer
  FLL_CTL0 |= XCAP14PF;                     // Set load cap for 32k xtal
  LCDACTL = LCDON + LCD4MUX + LCDFREQ_256;  // 4mux LCD, ACLK/128
  LCDAPCTL0 = 0x0F;                         // Segments 0-13
  LCDAVCTL0 = LCDCPEN;                      // enable charge pump
  //LCDAVCTL1 = 0x10;                         // to 2.89V(这一句的作用是什么,为什么去我加了进去,我的LCD就显示不出来。)
 
  P5SEL  = 0x1C;                            // Set COM pins for LCD
 
  for( i = 0; i < 20; i ++)
  {
    LCDMEM[i] = 0;                          // Clear LCD
  }
 
  for (i=0; i<4; ++i)                      // Display "0123456"
  {
    LCDMEM[i] = char_gen[0];
  }
 // _BIS_SR(LPM3_bits);                      // Enter LPM3
}
IC我是采用的MSP430F4270Code我是按照官方给的LCD的驱动代码修改的,红色的都是我修改的部分,当我把abcdefg都显示的时候,LCD是全亮,但是我减掉一个a的时候,其它三段还是全亮;但是减掉g时,第四段的话就只有acdf是亮的,其它的都不亮。请问下专家是怎么回事,430LCD驱动有问题吗?
  • 我看你的代码和例程几乎完全一样.不太像软件问题.

    请确认下

    1) 你的硬件是否和例程对应的硬件完全一样

    2) LCDAVCTL1是设置内部charge pump的输出电压值,Charge Pump的有最低工作电压2.2V,确认下是否VCC是否能达到.