Page 1 of 1

Sending commands via 'C' printf

Posted: Fri Jun 19, 2009 11:29 pm
by Jason van Ryan
Hello. I am trying to set up an LK204-24 for 1200 baud (I'd prefer 300, but 1200 is the lowest)

I can print to the display e.g. 'hello Jason' with no problems at 19200 (display default) - so all this side of things are working

I'm sending the change baud rate command via a printf statement from a uController but it does not seem to work.

printf("%X%X%X",0xFE,0x39,0x53)

Can anyone point me in th e right direction here?

Thanks

Jason

Posted: Sat Jun 20, 2009 2:20 am
by Ray
try %c instead of %x also you might want to experiment with the backlight commands to get your printf working since it has an visible observable result unlike the change baudrate command.

Posted: Sat Jun 20, 2009 9:32 pm
by Jason van Ryan
Thanks - I'll give that a try.

Posted: Sun Jun 21, 2009 2:59 am
by Jason van Ryan
Hi I tried a few things. I selected to turn the blinking block cursor on (I've got one of the PLED displays)

printf("%x",0xFE53); - still no luck

this as well

printf(0xFE53); - still no luck

Posted: Sun Jun 21, 2009 10:23 am
by Ray
printf("%c%c",0xfe,0x53);

Posted: Sun Jun 21, 2009 9:29 pm
by Jason van Ryan
Hi Ray,

I tried that as well, but no luck.

I'm wondering if it s because I have to 'unlock' before I can make any changes?

Posted: Sun Jun 21, 2009 9:29 pm
by Jason van Ryan
Hi Ray,

I tried that as well, but no luck.

I'm wondering if it s because I have to 'unlock' before I can make any changes?

Posted: Sun Jun 21, 2009 9:30 pm
by Jason van Ryan
Hi Ray,

I tried that as well, but no luck.

I'm wondering if it s because I have to 'unlock' before I can make any changes?

Posted: Sun Jun 21, 2009 9:36 pm
by Jason van Ryan
One other question. I dont see any detials in the manual about the RS232 spec -i.e. is it 8 bits, 1 stop, parity/no parity etc.

although I am printing ok 99% of th e timer to the dispay, I am getting some odd characters (graphic symbol) every now and then.

Posted: Mon Jun 22, 2009 10:17 am
by Raquel
Hello Jason,

The RS232 port settings are: 8 data bits, 1 stop bit, no parity, no flow control and 19200 default baud, which you should be able to change to 1200 with the command 0xFE 0x39 <baud>.

Now depending on the board you have, <baud> could be 0x53 or 0xFF.
You mentioned you have an LK204-24 and later mentioned PLED. Maybe you have a PK202-24-USB or a PK202-25?

Thanks,

Posted: Tue Jun 23, 2009 7:02 am
by Jason van Ryan
The marking on the PCB has the PK-204-25 REV 2 place on the model table marked with a little dot. Its a red display type.

Posted: Tue Jun 23, 2009 8:42 am
by Raquel
Hi Jason,

Sorry but the part number you mentioned does not seem to be right (specially when you mentioned that the display is red). Is it possible for you to please take a picture of the display module's front (powered on) and back?

Anywho, have you tried 0xFF or 0x53 as parameter for the command 0xFE 0x39?

edit:
After sending the command, wait for about 100 ms delay and start communicating in 1200 baud. The change is effective (almost) immediately.

Thanks,

Posted: Thu Jun 25, 2009 6:26 am
by Jason van Ryan
Hello Raquel,

I've solved the problem and can now send commands to the display.

Here is what I used to change the baud rate to 1200

printf("%C%C%C",0xFE,0x39,0x53); /* change baud rate to 1200 */

Jason