/************************************************** * LCD1602 Display * Description: P2 High 4 Bits for LCD1602 and P1.6 and P1.7 for I2C integrated another programmer. * LCD1602 The first line showing "Hello!LCD1602D" * LCD1602 The Second line showing "123456789abcdefg" * * Date:2020年4月12日调试成功(出现问题主要是因为LCD初始化) * * 硬件电路:MSP430G2553 20pins * 硬件连接: * * MSP430与LCD连接信息 * LCD1602,4位接口,即使用D4-D7数据口,D0-D3不接入MCU * PIN1 --> 地 * PIN2 --> VCC(一定要接+5V) * PIN3 -->仿真时悬空,实际电路 2K电阻-->地 (一定要接好,否则没有任何显示) * PIN4 --> RS --> P1.2 * PIN5 --> R/W --> GND * PIN6 --> EN --> P1.1 * PIN7 --> D0不接 * PIN8 --> D1不接 * PIN9 --> D2不接 * PIN10 --> D3不接 * PIN11 --> D4 --> P2.4 * PIN12 --> D5 --> P2.5 * PIN13 --> D6 --> P2.6 * PIN14 --> D7 --> P2.7 * PIN15 --> VCC(一定要接+5V,如果不要背光可以不接) * PIN16 --> 地 * 调试器:MSP430FET全系列JTAG仿真器 * 调试软件: CCS9.3 编译 **************************************************/ #include "msp430g2553.h" #include #include"lcd.h" void main() { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog LCD_init(); delay_1ms(); while(1) { LCD_write_string(1,0,"Hello!LCD1602D"); delay_1ms(); LCD_write_string(0,1,"123456789abcdefg"); } }