CFA533 command 31 (0x1f) problem

jevoyat

New member
Hi,MC
I'm controlling a CFA-TMI-KL with a dsPIC33FJ via RS232.

The code not working is the following one:

posizNomePag = indPages[actPage];
message[0] = 0x1F;
message[1] = 14;
message[2] = 0;
message[3] = 0;
message[4] = pages[posizNomePag];
message[5] = pages[posizNomePag + 1];
message[6] = pages[posizNomePag + 2];
message[7] = pages[posizNomePag + 3];
message[8] = pages[posizNomePag + 4];
message[9] = pages[posizNomePag + 5];
message[10] = pages[posizNomePag + 6];
message[11] = pages[posizNomePag + 7];
message[12] = pages[posizNomePag + 8];
message[13] = pages[posizNomePag + 9];
message[14] = pages[posizNomePag + 10];
message[15] = pages[posizNomePag + 11];

byteNum = 16;

CRC = get_crc(byteNum, message);

for(ind=0; ind<byteNum; ind++)
{
putc(message[ind]);
}

putc((unsigned int8) CRC);
putc((unsigned int8) (CRC>>8));

//// Indicazione valore grandezza
itoa((int32) pageContrVal[actPage], 10, string); // Da numero a stringa
message[0] = 0x1F;
message[1] = 4;
message[2] = 0;
message[3] = 1;
message[4] = string[0];
message[5] = string[1];

byteNum = 6;

CRC = get_crc(byteNum, message);

for(ind=0; ind<byteNum; ind++)
{
putc(message[ind]);
}

putc((unsigned int8) CRC);
putc((unsigned int8) (CRC>>8));

What happens is that the first command 31 just doesn't appear, I see only the charactrers on the second line. What makes me wonder is that if I invert the two sections, I just see the characters on the first line (i.e. in any case the second command 31 seems to erase the lcd before writing).
What am I missing ?
Thanks a lot for your help

JP Voyat
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
USB LCD Displays - Graphic and Character LCDs with a Keypad
Please supply more information about what kind of data these variables are:
Code:
   posizNomePag = indPages[actPage];
   pages[posizNomePag];
 
Top