AVR reading from LCD hd44780

460 Views Asked by At

I am currently writing a small project based on avr ATmega32 and a few other components (LED, microswitch). I am using Mirosław Kardaś's LCD library and header file from ftp://novitech.pl/Ladowarka/LCD/ . Also I use this function to send data via RS232:

char USART_wysylanie ()
{
    while ( !(UCSRA & (1<<UDRE)) );
    UDR = data;
}

The task I made for myself is to get via rs232 the data that is currently displayed on my hd44780 2x16 (connected via 4bit). The thing is that when I use

        if (KEY_DOWN_3)
    {
        unsigned char message;
        int i;
        for (i=0;i<=4;i++)
        {
           lcd_locate(0,i);
           message = _lcd_read_byte();
           USART_wysylanie(message);
        }
    }       

my terminal shows nothing when set to ANSII, when displaying as HEX I get 01 02 03... and all over again, bt I want to get exactly what is on my LCD, and in it's RAM. The communication with RS is good because when I use something like ... USART_wysylanie ('s') everything is OK. Any ideas how can I make my code to READ LCD content?

0

There are 0 best solutions below