Join us on Twitter Join us on Facebook Meet Orbie THE DOG!
Home FAQ Profile Search Members Groups PM's Register Login/Out SmartFeedSmartFeed
LK204-25 and Arduino Mega
Last Thread | Next Thread  >

Post new topic Reply to topic
Matrix Orbital > LK/VK/PK/MX/GLK/GVK Series

Author Thread
Jacqmaster
LCD?


Joined: 08 Mar 2010
Posts: 4
Location: Pomona
LK204-25 and Arduino Mega  Reply with quote  

I just bought the LK204-25 and its default setting is RS232 mode.
I connected the LK204-Rx pin to Arduino Mega Tx1 (Serial1) and get 5V power from Arduino as well.
When power up the module, I can see the default startup screen.
But when I run the below tiny program, the result totally awkward.


void setup() {
Serial.begin(9600);
Serial1.begin(19200);
Serial1.flush();
}

void loop() {
if (Serial.available()) {
Serial1.print(Serial.read(), BYTE);
Serial.flush();
}
}

If I enter "a" from Arduino serial monitor, the LK204 LCD will display "0" on it.
Can someone help me out?
Post Mon Mar 08, 2010 12:55 am
 View user's profile Send private message
Ray
Matrix Orbital
Matrix Orbital


Joined: 13 Dec 2001
Posts: 671
Location: Earth.... I think..
 Reply with quote  

I suspect the Arduino is operating on TTL levels
Post Mon Mar 08, 2010 4:33 am
 View user's profile Send private message Send e-mail Visit poster's website
Jacqmaster
LCD?


Joined: 08 Mar 2010
Posts: 4
Location: Pomona
 Reply with quote  

quote:
Originally posted by Ray
I suspect the Arduino is operating on TTL levels


Thus, I just need to add MAX232 driver between Arduino and LK204 to converting the voltage level, am I right?

THanks,
Post Mon Mar 08, 2010 12:16 pm
 View user's profile Send private message
Ray
Matrix Orbital
Matrix Orbital


Joined: 13 Dec 2001
Posts: 671
Location: Earth.... I think..
 Reply with quote  

If you have a steady hand you can also move the zero ohm resistors on the back of the module from rs232 to ttl.
Post Mon Mar 08, 2010 12:20 pm
 View user's profile Send private message Send e-mail Visit poster's website
Jacqmaster
LCD?


Joined: 08 Mar 2010
Posts: 4
Location: Pomona
 Reply with quote  

quote:
Originally posted by Ray
If you have a steady hand you can also move the zero ohm resistors on the back of the module from rs232 to ttl.


Finally, I added one MAX202 circuit and it works greats. But I got another while connecting to a 4x4 keypad. When I short R1-C1, the LCD will display 246, R1-C2 =>61.
How can get read the keypad map such as R1-C1=>A, R1-C2=>B
Post Fri Mar 19, 2010 11:52 pm
 View user's profile Send private message
Raquel
Matrix Orbital
Matrix Orbital


Joined: 19 Aug 2004
Posts: 630
Location: MO Office
 Reply with quote  

Hi Jacqmaster,

It sounds like somehow the EEPROM in your display module has been corrupt. By default, the keys should be transmitting those that are depicted in the tables on page 40 of the manual .

By using Assign Keypad Code command (254 / 213) you should be able to assign any values that you want the display to transmit when certain key combinations are shorted (depressed). See section 9.9 of the manual.

I hope this helps,

_________________
Raquel Malinis
Design and Development
Matrix Orbital
Post Tue Mar 23, 2010 7:43 am
 View user's profile Send private message
Jacqmaster
LCD?


Joined: 08 Mar 2010
Posts: 4
Location: Pomona
 Reply with quote  

quote:
Originally posted by Raquel
Hi Jacqmaster,

It sounds like somehow the EEPROM in your display module has been corrupt. By default, the keys should be transmitting those that are depicted in the tables on page 40 of the manual .

By using Assign Keypad Code command (254 / 213) you should be able to assign any values that you want the display to transmit when certain key combinations are shorted (depressed). See section 9.9 of the manual.

I hope this helps,


May I ask one newbie question. In Arduino, I have to send separate commands in order to achieve the execution. for example,

Serial.print(254, BYTE);
Serial.print(213, BYTE);

but now I am not sure to issue command correctly.

Serial.print("ABCDEFGHIJKLMNOPQRSTUVWXY");

or some other formats.

Thanks,
Post Tue Mar 23, 2010 1:59 pm
 View user's profile Send private message
Clark
Matrix Orbital
Matrix Orbital


Joined: 17 Aug 2007
Posts: 351
 Reply with quote  

Hi Jacqmaster,

Text will be sent out to the serial port in the same way as commands. I'm not familiar with the Arduino language but you might try sending ('A', BYTE). If that fails you may be down to looking up values, such as (65, BYTE), I find ascii-table.com can help there.

To make things a little easier, you may be able to go with an array, something like BYTE mydata [2] = {254, 213}; and throw the serial.print into a for loop to spit out the bytes one by one.

Anyway, you may want to sift through our app notes on the matrixorbital.ca site for a little inspiration, and feel free to throw up another post if you get hung up again.

Thanks,
~Troy

_________________
Troy Clark
Technical Support
Matrix Orbital
Post Wed Mar 24, 2010 9:59 am
 View user's profile Send private message

â
Post new topic Reply to topic
Forum Jump:
Jump to:  

All times are GMT - 8 Hours.
The time now is Thu Jul 29, 2010 6:30 am
  Display posts from previous:      


Powered by phpBB: © 2001 phpBB Group

Visit the Matrix Orbital Web Site