This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LCD 4x20 on a LPC1768

Hello everyone,
I'd like to interface a 4x20 character LCD. But I can not do it!
Finally I arrive boot (the black line disappears) but I do not see the cursor blinking and the characters that I want to write.
So I just see whether you already have an interface with LPC1768 and if you do not have a library to share?

So that's not where I am:

Lcd library

void init_LCD(void) {

         LCD_Light (1)
         LCD_EN(0)
         os_dly_wait (100);
         command (0x30);
         os_dly_wait (40);
         command (0x30);
         os_dly_wait (40);
         command (0x30);
         os_dly_wait (40);
         command (0x38);
         os_dly_wait (40);
         command (0x0F);
         os_dly_wait (40);
         command (0x01);
         os_dly_wait (40);
         command (0x06);
         os_dly_wait (40);


}

void command (char data) {

        LPC_GPIO0->FIOPIN |= (data<<15);       /* place data */
        LCD_RS(0)
        LCD_RW(0)
        LCD_EN(1)
        os_dly_wait (2);
        LCD_EN(0)

}

void write (char data) {

        LPC_GPIO0->FIOPIN |= (data<<15);       /* place data */
        LCD_RS(1)
        LCD_RW(0)
        LCD_EN(1)
        os_dly_wait (2);
        LCD_EN(0)


}

void write_char(char data) {

        command (0x38);
        os_dly_wait (40);
        command (0x0c);
        os_dly_wait (40);
        command (0x06);
        os_dly_wait (40);
        write (data);
        os_dly_wait (40);

}

main code

__task void LCD (void) {


init_LCD(); write_char (0x30); for (;;) {}
}

Best regard

Bernard

0