Serial packet transfer from Rabbit RCM5600W to CFA 635-YYE-KL LCD module


New member
All, I have an issue trying to send the serial packet data between a Rabbit RCM5600W with RS232 Serial Comm board to a Crystalfontz CFA635-YYE-KL LCD module. I am using the sample CRC calculation C code, and I am pretty sure it is working. When I send the packet from the rcm5600w to the display, I get no display change. I tried reading the packet using hyperterm, but I get misc characters. I can send strings of data from the rcm5600 to hyperterm ok, and I can change the 635 display using wintest, so I assume it must be a problem creating or sending the packet. I have checked my cables (ok), and tried a few different baud/bit combos, but nothing. Any ideas or debugging tips would be appreciated. Test code sample below.
Thanks in advance.

#define CINBUFSIZE 31
#define COUTBUFSIZE 31
#include <string.h>

unsigned short get_crc(unsigned char count,unsigned char *ptr)
unsigned short crc; //Calculated CRC
unsigned char i; //Loop count, bits in byte
unsigned char data; //Current byte being shifted
crc = 0xFFFF; // Preset to all 1's, prevent loss of leading zeros
data = *ptr++;
i = 8;
if((crc ^ data) & 0x01){
crc >>= 1;
crc ^= 0x8408;
crc >>= 1;
data >>= 1;
} while(--i != 0);
return (~crc);

void main()
#define MAX_DATA_LENGTH 22
struct command_packet{
unsigned char command;
unsigned char data_length;
unsigned char data[MAX_DATA_LENGTH];
unsigned short CRC;
int ret;
// Welcome message for display
char initdisplay[] = "Welcome Message";
packet.command = 31; //31 is command type to send to LCD
/* data_length = length of string +2 for the row and col arg */
packet.data_length = strlen(&initdisplay[0]) + 2;[0] = 0; /* row to send to*/[1] = 0; /* col to send to*/
strncpy(&[2], initdisplay, strlen(initdisplay));
printf("[2] -> [%d]: \"%s\"\n", strlen(&[2]), &[2]);
printf(" length: \"%d\"\n", strlen(&[2]));
printf(" location: \"%x\"\n", &[2]);
printf(" \"%s\"\n", &[2]);
/* calc CRC for entire packet */
packet.CRC = get_crc(strlen(initdisplay) +4,(unsigned char*)&packet.command);
ret = serCwrite(packet,26);
// first, wait until the serial buffer is empty
while (serCwrFree() != COUTBUFSIZE);
// then, wait until the Tx data register and the Tx shift register
// are both empty
while (BitRdPortI(SBSR, 3) || BitRdPortI(SBSR, 2));
// now we can close the serial port without cutting off Tx data
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.


New member
Thanks for the reply, but I still can not get the display to write the Hello World message. I tried the character sequence you supplied, but it did not update the display when run. The rabbit board uses the serCputc command instead of just putc because it has six ports, so I made the updates to the code accordingy. I put the code in a loop and verified the serial voltages on an o-scope. It doesn't do captures but the levels look correct.
I used the wintest software to change the default display and I changed the baud to 19200, so the display seems OK with wintest.
I loaded the Hello World message to the initdisplay array in my previously posted code and verified the CRC routine is calculating the correct checksum dec 14, 229 = x0E xE5. Here's a memory dump from the rabbit IDE that shows the originally code with the initdisplay array updated for the Hello World message. The portion of the structure @dfe4 and CRC 0E E5 are also shown.
Thanks again

dfe4 00 00 48 65 6C 6C 6F 20 57 6F 72 6C 64 20 20 20 ..Hello World
dff4 20 20 20 20 20 20 0E E5 AF 20 00 1A 0B 43 89 22 .å¯ ...C‰"

CF Tech

Some serial libraries will do character translation (CF -> CRLF) or filtering of "binary" codes. Is there a lower level access to the serial port?


New member
Hi, I have not been able to locate any lower level function calls as of yet, but I am still searching. I have been able to read the hex code coming from the output of the serial port and it appears to be sending the proper hex sequence to the display module using the sample code (see attached jpg). The display still does not update with the Hello World message. I am attaching a screenshot that show the hex code sent from the serial port and it does not indicate any CR, CRLF codes. Please advise of any additional test steps. Thanks again.


USB LCD Displays - Graphic and Character LCDs with a Keypad