Hello,
I know it's kind of weird to read from an LCD screen, but the pic I'm using doesn't have a lot of ram, so I can't store all the information on the PIC.
So anyways.. I need to read some information from the LCD screen... I've looked at the timing.. and came up with this code:
LCD_DATA = parallel bus to the LCD
I'm running a 40MHz clock... so wait = 100nS
data always comes up as 0x0F as I set it to in the beginning of the procedure.
As always... any help is very much appreciated.. Thanks.
I know it's kind of weird to read from an LCD screen, but the pic I'm using doesn't have a lot of ram, so I can't store all the information on the PIC.
So anyways.. I need to read some information from the LCD screen... I've looked at the timing.. and came up with this code:
LCD_DATA = parallel bus to the LCD
I'm running a 40MHz clock... so wait = 100nS
Code:
ubyte LCD_RD_data(ubyte controller)
{
//returns data from the selected controller
ubyte data = 0;
LCD_DATA = 0x0F;
LCD_DI = high;
LCD_EN = high;
LCD_RW = low;
LCD_CS1 = high;
LCD_CS2 = high;
wait;
wait;
LCD_EN = low;
wait;
wait;
LCD_RW = high;
if (controller) LCD_CS1 = low;
else LCD_CS2 = low;
wait;
wait;
LCD_EN = high;
wait;
wait;
data = LCD_DATA;
wait;
LCD_EN = low;
LCD_RW = low;
return data;
}
data always comes up as 0x0F as I set it to in the beginning of the procedure.
As always... any help is very much appreciated.. Thanks.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.