1389 views|0 replies

3836

Posts

19

Resources
The OP
 

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……………………


This post is from Microcontroller MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list