1389 views|0 replies
- Last login
- 2023-10-7
- Online Time
- 253 hours
- Prestige
- 1125 points
- Points
- 830 points
|
MSP430F149 LCD12864 parallel port display source program
[Copy link]
The microcontroller source program is as follows: #include "Config.h" #include "LCD12864.C" unsigned char sec = 0,min = 0,hour = 0; unsigned char Time_Data[] = "00:00:00"; /****************************************Function declaration************************/ void Port_init(); /****************************************Main function*************************/ int main( void ) { WDT_Init(); //Watchdog initializationClock_Init(); //Clock initializationPort_init(); //Port initializationLCD12864_init(); //LCD12864 initializationTimerA_Init(); //Timer A initializationwhile(1) { LCD12864_Write_Array(LINE1 + 0 ,"Time:"); LCD12864_Write_Array(LINE1 + 3 ,Time_Data); LCD12864_Write_Array(LINE2 + 0 ,"Hello World!"); LCD12864_Write_Array(LINE3 + 1 ,"Hello World!"); LCD12864_Write_Array(LINE4 + 2 ,"Hello World!"); Time_Data[0] = hour / 10 + '0'; Time_Data[1] = hour % 10 + '0'; Time_Data[3] = min / 10 + '0'; Time_Data[4] = min % 10 + '0'; Time_Data[6] = sec / 10 + '0'; Time_Data[7] = sec % 10 + '0'; if(sec >= 59){sec = 0;min++;} if(min >= 59){min = 0;hour++;} if(hour >= 23){hour = 0;} } } /********************************************Port initialization******************/ void Port_init() { P4SEL = 0X00; //Set P4 port to normal I/O mode P4DIR = 0XFF; //Set P4 port direction to output P5SEL = 0X00; //Set P5 port to normal I/O mode……………………
|
|