This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Regarding LCD Display

Dear Sir,

I want to display character or number on 16X2 LCD display by using MSP430F5228 microcontroller and MSP-TS430RGC64USB evaluation board. I am using CCS V6 for coding. 

After build up the code nothing getting any error and debug successfully. After interfacing 16X2 LCD with microcontroller then not getting any data or a string on a LCD.

following pin configuration:-

P2.0 (pin no-26)  =RS

P2.1 (pin no-27) =R/W

P2.2 (pin no-28) =Enable

P1.0 to P1.7 (pin no-18 to 25) = data pin

Plese find attached code.

Please reply me as soon as possible st that i can fix my problem.




/* * Create header file for lcd.h * * Created on: Feb 17, 2015 * */ #ifndef LCD_H_ #define LCD_H_ #include <msp430.h> #define DR P2OUT = P2OUT | BIT0 // define RS High #define CWR P2OUT = ~ BIT0 // define RS Low #define READ P2OUT = P2OUT | BIT1 // define Read Signal R/W=1 for reading #define WRITE P2OUT = ~ BIT1 // define Write Signal R/W=0 for writing #define ENABLE_HIGH P2OUT = P2OUT | BIT2 // define Enable High Signal #define ENABLE_LOW P2OUT = ~ BIT2 // define Enable Low Signal /* * main.c */ unsigned int i; unsigned int j; void delay(unsigned int k) { for(j=0;j<=k;j++) { for(i=0;i<1000;i++); } } void data_write(void) { ENABLE_HIGH; delay(2); ENABLE_LOW; } void data_read(void) { ENABLE_LOW; delay(2); ENABLE_HIGH; } void check_busy(void) { P1DIR &=(~BIT7); // make P1.7 as input while ((P1IN&BIT7)==1) { data_read(); } P1DIR |= BIT7; // make P1.7 as output } void send_command(unsigned char cmd) { check_busy(); WRITE; CWR; P1OUT = (P1OUT & 0x00)|(cmd); data_write(); } void send_data(unsigned char data) { check_busy(); WRITE; DR; P1OUT = (P1OUT & 0x00)|(data); data_write(); } void send_string(char*s) { while(*s) { send_data(*s); s++; } } void lcd_init(void) { P2DIR |=0xFF; P1DIR |=0xFF; P2OUT &=0x00; P1OUT &=0x00; send_command(0x38); // 8 bit mode send_command(0x0E); // clear the screen send_command(0x01); // display on cursor on send_command(0x06); // increment cursor send_command(0x80); // cursor postion } #endif /* LCD_H_ */ ********************************************************************************** main.c file #include <msp430.h> #include "lcd.h" /* * main.c for initializing LCD */ int main(void) { //WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer lcd_init(); send_command(0X80); send_string("TSE"); send_command(0xC0); send_string("HELLO"); while(1){} }

**Attention** This is a public forum