Sending commands via 'C' printf

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
Jason van Ryan
LCD?
Posts: 9
Joined: Fri Jun 19, 2009 11:20 pm

Sending commands via 'C' printf

Post 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
Ray
Matrix Orbital
Matrix Orbital
Posts: 745
Joined: Thu Dec 13, 2001 4:00 pm
Location: Earth.... I think..
Contact:

Post 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.
Jason van Ryan
LCD?
Posts: 9
Joined: Fri Jun 19, 2009 11:20 pm

Post by Jason van Ryan »

Thanks - I'll give that a try.
Jason van Ryan
LCD?
Posts: 9
Joined: Fri Jun 19, 2009 11:20 pm

Post 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
Ray
Matrix Orbital
Matrix Orbital
Posts: 745
Joined: Thu Dec 13, 2001 4:00 pm
Location: Earth.... I think..
Contact:

Post by Ray »

printf("%c%c",0xfe,0x53);
Jason van Ryan
LCD?
Posts: 9
Joined: Fri Jun 19, 2009 11:20 pm

Post 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?
Jason van Ryan
LCD?
Posts: 9
Joined: Fri Jun 19, 2009 11:20 pm

Post 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?
Jason van Ryan
LCD?
Posts: 9
Joined: Fri Jun 19, 2009 11:20 pm

Post 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?
Jason van Ryan
LCD?
Posts: 9
Joined: Fri Jun 19, 2009 11:20 pm

Post 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.
Raquel
Matrix Orbital
Matrix Orbital
Posts: 834
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post 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,
Raquel Malinis
Design and Development
Matrix Orbital
Jason van Ryan
LCD?
Posts: 9
Joined: Fri Jun 19, 2009 11:20 pm

Post 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.
Raquel
Matrix Orbital
Matrix Orbital
Posts: 834
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Post 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,
Raquel Malinis
Design and Development
Matrix Orbital
Jason van Ryan
LCD?
Posts: 9
Joined: Fri Jun 19, 2009 11:20 pm

Post 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
Post Reply