初用413,竟然遇到这样的问题,硬件软件全检查了,还是没找到原因,头疼啊!
跪求协助啊!!!!!!!!!!^-^
413配置的是4MUX模式,外接32.768K晶振,LCD驱动直接用ACLK,外部R03接地,1/3偏置电阻680K,因为PCB布板问题, 段口随意连接(4COM,10个段口,5位数字LCD)!
以下程序在LCD上显示:12345
#include <msp430x41x.h>
char digit[10] = {
0xE7, /* "0" */
0X06, /* "1" */
0X6D, /* "2" */
0X4F, /* "3" */
0X8E, /* "4" */
0XCB, /* "5" */
0XEB, /* "6" */
0X46, /* "7" */
0XEF, /* "8" */
0XCF /* "9" */
};
char LCD[10];
void LCD_W()
{
LCDM3 = LCD[4];
LCDM5 |= LCD[3]>>4;
LCDM4 |= LCD[3]<<4;
LCDM8 |= LCD[2]>>4;
LCDM6 |= LCD[2]<<4;
LCDM11 |= LCD[1]>>4;
LCDM9 |= LCD[1]<<4;
LCDM12 |= LCD[0]>>4;
LCDM11 |= LCD[0]<<4;
}
void main(void)
{
int tmpv;
WDTCTL = WDTHOLD + WDTPW; //关闭看门狗
BTCTL = BTSSEL; // set LCD 时钟
P2SEL |= 0x38;
P3SEL |= 0x49;
P4SEL |= 0x16;
P5SEL |= 0xFC; // 置为外围模块
LCDCTL = LCDON+LCD4MUX+LCDSG0_3; // 4Mux 模式
for (tmpv = 0;tmpv<13;tmpv++)
{
LCDMEM[tmpv] = 0x00; //clear LCD
}
while(1)
{
for (tmpv = 0;tmpv<5;tmpv++)
{
LCD[tmpv] = digit[tmpv+1]; //clear LCD
}
LCD_W();
}
}
请各位大虾帮帮忙啊!!!!!!!急啊^^^^^^^^^^^ |