• We recently switched our forum platform. If you experience any issues please email support@crystalfontz.com

Get lcd lines form 635 in Linux

sergio

New member
Hi.
I'm tring to get the text previously written in the four lines of 635 lcd in Linux using C.
I have the pdf datasheet manual:

10 (0x0A): Read 8 Bytes of LCD Memory
This command will return the contents of the LCD’s DDRAM or CGRAM. This command is intended for debugging.
type = 0x0A = 1010
valid data_length is 1
data[0] = address code of desired data
data[0] is the address code native to the LCD controller:
0x40 ( 64) to 0x7F (127) for CGRAM
0x80 (128) to 0x93 (147) for DDRAM, line 0
0xA0 (160) to 0xB3 (179) for DDRAM, line 1
0xC0 (192) to 0xD3 (211) for DDRAM, line 2
0xE0 (224) to 0xF3 (243) for DDRAM, line 3
The return packet will be:
type = 0x40 | 0x0A = 0x4A = 7410
data_length = 9
data[0]of the return packet will be the address code.
data[1-8] of the return packet will be the data read from the LCD controller's memory.

but, How can I get the bytes after calling send_packet() method?
The check_for_packet() method returns true, but I don't know how retrieve the data...

Thanks.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

sergio

New member
more code

This is that I'm trying:

outgoing_response.command = 10;
outgoing_response.data[0]=128;
outgoing_response.data_length = 1;
send_packet();
while (!check_for_packet())
;
ShowReceivedPacket();
if(check_for_packet())
{
if( incoming_command.command==0x4A)
{
std::cout<<"response"<<std::endl;
}
else
{
std::cout<<"bad response"<<std::endl;
}
}

And always get "bad response".
I've tried with sending different "outgoing_response.data[0]", and comaring to other "incoming_command.commands", but no results...
 
Since you are not showing any of the details of your code, I have to wonder how (or if) you are handling the CRC properly.
 

sergio

New member
Crc

Is necesary to use CRC?
In Linux example for 635, there isn't any example...

What is the command to read from LCD like?

I'm trying with this but no results...

std::string output="";
outgoing_response.command = 10;
outgoing_response.data[0]=128;
outgoing_response.data_length = 1;
send_packet();
while (!check_for_packet())
;
ShowReceivedPacket();
if(check_for_packet())
{
if( incoming_command.command==0x40 | 0x0A)
{
std::cout<<"response"<<std::endl;
}
}

Thank You
 
USB LCD Displays - Graphic and Character LCDs with a Keypad
Top