#include
# define uint unsigned int
# define uchar unsigned char
uchar time_buffer[3]={17,35,0};
uchar key_do=0;
uchar key_buffer=0;
uchar input_buffer[6]={0};
uchar input_con=0;
uchar time_sec01=0;
uchar lcdflash_temp=0;
uchar disp_buffer[6]={0};
uchar alr1[3]={06,30,00};
uchar alr2[3]={12,30,00};
uchar alr_flg=0;
uchar fun_con=2;
uchar adc_f = 0 ;
# define a 0x10
# define b 0x20
# define c 0x40
# define d 0x80
# define e 0x1
# define f 0x2
# define g 0x4
# define h 0x8
const char distab_asc[]=
{
a+e+f+d+c, f, e+c+f+h+d, 0, c+f+h, 0, c+f+h+d, f, //abcd
a+e+c+f+h,0, a+e+c+f, 0, a+e+h+c+d, f, e+c+f+d, f, //efgh
d, f, d+h, f, d, f+e+h, e+f+h,0, //ijkl
e+f+a+d, f+a+b+c, e+f+b, b+c+h, c+f+h+d, 0, a+e+f+c, f, //mnop
a+e+d+c, f+d, d, a+f+b+g+h,a+e+c+d+h, 0, a+d, a+f, //qrst
e+f+h+d, f, e+f+g, e, e+f+h+d, f+d+b+c, b+g, e+h, //uvwx
b+d, e, c+g+h, 0 //yz
};
const char distab_mi[]=
{
0x1b,0xf0,
0x80,0x2,
0x5a,0xb4,
0x58,0xf4,
0xc1,0x06,
0x59,0xd4,
0x5b,0xd4,
0x10,0x70,
0x5b,0xf4,
0x59,0xf4
};
////////////////////////////
// 160 lcd
////////////////////////////
const char distab[]=
{
0xaf,0x06,0x6d,0x4f,
0xc6,0xcb,0xeb,0x0e,
0xef,0xcf, 0xee,0xe3,
0x61,0x67,0xe9,0xe8
};
void delay(int x) // 5*x+12 nop
{ //128- 23 256-49
while(x--);
} //192- 36 280- 54 448- 87
void time_dis(void)
{
LCDMEM[0]= 0xFF;//distab[0];
LCDMEM[1]= distab[1];
LCDMEM[2]= distab[2];
LCDMEM[3]= distab[3];
LCDMEM[4]= distab[4];
LCDMEM[7]=0xa;
LCDMEM[8]=0x90;
//LCDMEM[9]=0x12;
//LCDMEM[10]=0x80;
LCDMEM[8]=distab_asc[0];
LCDMEM[9]=distab_asc[1];
LCDMEM[11]=0x2;
LCDMEM[12]=0x93;
LCDMEM[13]=0x72;
LCDMEM[14]=0x5b;
LCDMEM[15]=0x94;
}
void clrlcd(void)
{
uchar i=0;
for(i=0;i<20;i++)
LCDMEM[i]=0;
}
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
LCDCTL = 0XFD;
BTCTL = BTFRFQ1; // STK LCD freq
P5SEL = 0xFC; // Common and Rxx all selected
FLL_CTL0 |= XCAP14PF; // Configure load caps
TACTL = TASSEL0 + TACLR; // ACLK, clear TAR
CCTL0 = CCIE; // CCR0 interrupt enabled
CCR0 = 66;
P5DIR |= 0x02; // P5.1 output
TACTL |= MC1; // Start Timer_A in continuous mode
P1DIR = 0XFF ;
P6DIR = 0XFF ;
P6SEL = 0X01 ;
P6OUT = 0XFF ;
P2DIR=0xf0;
P2OUT=0X00;
P2IE=0X0f;
P2IES=0x0f;
P2IFG=0;
clrlcd();
time_dis();
for(;;)
{
//_BIS_SR(LPM3_bits); // CPU off
_NOP(); // Required only for C-spy
}
}
上一篇:MSP430的一些问题
下一篇:低功耗MSP430单片机在3V、5V混合系统中的逻辑接口技术
推荐阅读最新更新时间:2024-03-16 15:06
设计资源 培训 开发板 精华推荐
- 英飞凌推出OptiMOS™ Linear FET 2 MOSFET, 赋能先进的热插拔技术和电池保护功能
- SGMII及其应用
- 贸泽开售用于机器人和机器视觉的 STMicroelectronics B-CAMS-IMX模块
- 三星 Exynos 2600 芯片前景堪忧:良率挑战严峻,有被取消量产风险
- 苹果搁置反垄断报告的请求遭印度监管机构拒绝,案件将继续推进
- 2024年Automechanika Shanghai海量同期活动刷新历届记录,汇聚行业智慧,共谋未来发展
- 企业文化分享 如何培养稀缺的硅IP专业人员?SmartDV开启的个人成长与团队协作之旅
- 恩智浦发布首个超宽带无线电池管理系统解决方案
- 北交大本科生探秘泰克先进半导体开放实验室,亲历前沿高科技魅力
- 新帅上任:杜德森博士(Dr. Torsten Derr)将于2025年1月1日出任肖特集团首席执行官