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.
Hi,
Iam using msp430g2553 so working on 16x2 lcd,in 4 bit mode
i try but no charecters is display
so pls send any link or sample code for lcd msp430g2553
i have problem with 16x2 lcd by using msp430g2553,so plz help me or any sample for lcd in "c"
A lot of people have problem with the "contrast control". If you do not have the appropriate voltage on the pin, you cannot see anything on the display. Even "c" cannot solve that problem.
I assume the LCD controller is a HD44780 or is HD44780 compatible?
Before looking into the software aspect have you biased the contrast adjust pin and has the module has been interfaced correctly to the 3.3 V logic?
I have some example code but is spread all over the place :S
Usage:
https://github.com/alanbarr/msp430-launchpad/tree/master/examples/lcd
"Library" files:
https://github.com/alanbarr/msp430-launchpad/blob/master/common/inc/time430.h
https://github.com/alanbarr/msp430-launchpad/blob/master/common/inc/devices/ST7066_HD44780.h
https://github.com/alanbarr/msp430-launchpad/blob/master/common/src/lcd_st7066.c
https://github.com/alanbarr/msp430-launchpad/blob/master/common/inc/lcd_st7066.h
I've written how to interface 16x2 lcd with msp430 launchpad in my blog. The link is : http://learningmsp430.wordpress.com/2013/11/16/16x2-lcd-interfacing-in-4-bit-mode/
old_cow_yellow said:A lot of people have problem with the "contrast control". If you do not have the appropriate voltage on the pin, you cannot see anything on the display. Even "c" cannot solve that problem.
That is right! But I still have problem with enough voltage and contrast. (I can control the brightness of the cells)
Hello Allan,
Quite a good fascinating piece of CODE . Thank you for your share.
I'm having compilation errors , I'm unable to get past them .I have attached the pictures along with this reply. Could you please take a look.I'm using CCS 6.0.1.00040 .
I'm also attaching the ZIP file of the project. Do let me know what is the problem.
Thank you for the great piece of code.jhd162a.zip
Hello,
Unfortunately I don't use CCS, but looking at the code I would hazard a guess that the compiler may be looking for the function lcdReadDataFromRam() - its prototype in lcd_st7066.h is not protected in a #if LCD_READING_FUNCTIONALITY.
Alan
I reffered your code to write my own, however there is a bug.The lcd just turns on on proteus but does not display anything..could you please help me resolve this..
#include
#define RS BIT1 //p2.1
#define EN BIT0//p2.0
void lcd_cmd (volatile char c);
void lcd_data(char d);
void lcd_init();
void lcd_string(char *p);
int main(void) {
WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer
P2DIR|=RS;//p2.1 as output
P2DIR|=EN;//p2.0 as output
P2OUT &= 0x00;
P3DIR=0XF0;//p3- D4 to D7 as output
while(1)
{
lcd_init();
lcd_data(“S”);
}
return 0;
}
void lcd_cmd (volatile char c)
{
__delay_cycles(50000);
__delay_cycles(50000);
__delay_cycles(50000);
volatile char temp;
P2OUT&=~RS;
temp=c;
temp&=0XF0;
P3OUT&=0X0F;
P3OUT|=temp;
P2OUT^=EN;
__delay_cycles(50000);
P2OUT^=EN;
temp=c<<4;
temp&=0XF0;
P3OUT&=0X0F;
P3OUT|=temp;
P2OUT^=EN;
__delay_cycles(50000);
P2OUT^=EN;
}
void lcd_data(char d)
{
__delay_cycles(50000);
__delay_cycles(50000);
__delay_cycles(50000);
volatile char temp;
P2OUT|=RS;
temp=(d-1);
temp&=0XF0;
P3OUT&=0X0F;
P3OUT|=temp;
P2OUT^=EN;
__delay_cycles(50000);
P2OUT^=EN;
temp=(d-1);
temp=temp<<4;
temp&=0XF0;
P3OUT&=0X0F;
P3OUT|=temp;
P2OUT^=EN;
__delay_cycles(50000);
P2OUT^=EN;
}
void lcd_init()
{
lcd_cmd(0X33);
lcd_cmd(0X32);
lcd_cmd(0X28); //selecting bus width=4;
lcd_cmd(0X01);
lcd_cmd(0X06);
lcd_cmd(0X80);
}
i read somewhere that instead of using check_busy() function we can simply use delay and connect R/W to ground.So i have written the code accordingly.
Please answer as soon as possible….:D
Regards Shreya
Hi Shreya!
If you still have problems with your HD44780 display, you could do me a favour and test out the following library for me:
Dennis
**Attention** This is a public forum