0
Offline
Newbie
Karma: 0
Posts: 22
Arduino rocks
|
 |
« on: March 26, 2011, 06:35:38 am » |
Hi, I have a uLCD-144 from 4D. It works without problems with an arduino Mega2560, but it fails with Duemilanove. It is very simple to manage: it uses serial communication to send some specific command. For instance, to inizialize it you have to send 0x55 and it should respond with 0x06 (ACK). I wrote a simple sketch that send 0x55 and wait for something from serial and in the mega2560 it works, but in duemilanove doesn't. I can't understand why...
Thank you!
Andrea
|
|
|
|
|
Logged
|
|
|
|
|
Espoo, Finland
Offline
God Member
Karma: 6
Posts: 581
"Oops, try again..."
|
 |
« Reply #1 on: March 26, 2011, 06:52:29 am » |
Code...
Kari
|
|
|
|
|
Logged
|
The only law for me; Ohms Law: U=R*I P=U*I Note to self: "Damn! Why don't you just fix it!!!"
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 22
Arduino rocks
|
 |
« Reply #2 on: March 26, 2011, 07:25:47 am » |
Sorry  void setup() { Serial.begin(9600); delay(1000); Serial.write(0x55); while(!Serial.available()); Serial.print(Serial.read(), HEX); }
void loop() { }
|
|
|
|
|
Logged
|
|
|
|
|
Espoo, Finland
Offline
God Member
Karma: 6
Posts: 581
"Oops, try again..."
|
 |
« Reply #3 on: March 26, 2011, 07:45:26 am » |
Then it must be physical coneection problem, or broken device.
Kari
|
|
|
|
|
Logged
|
The only law for me; Ohms Law: U=R*I P=U*I Note to self: "Damn! Why don't you just fix it!!!"
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 22
Arduino rocks
|
 |
« Reply #4 on: March 26, 2011, 07:58:36 am » |
I agree... but the same display works with the same code in the mega2560. And I tried it with two duemilanove and it doesn't work...
Thank you
Andrea
|
|
|
|
|
Logged
|
|
|
|
|
Espoo, Finland
Offline
God Member
Karma: 6
Posts: 581
"Oops, try again..."
|
 |
« Reply #5 on: March 26, 2011, 08:27:54 am » |
I was talking about the Duemilanove...  It's time to check your circuit, could you show us how it is put together? Cheers, Kari
|
|
|
|
|
Logged
|
The only law for me; Ohms Law: U=R*I P=U*I Note to self: "Damn! Why don't you just fix it!!!"
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 22
Arduino rocks
|
 |
« Reply #6 on: March 26, 2011, 09:15:42 am » |
That's how I connect the display:
Display Arduino 5 (RES) RESET 6 (GND) GND 7 (RX) TX 8 (TX) RX 9 (VIN) +5
Thank you
|
|
|
|
|
Logged
|
|
|
|
|
Espoo, Finland
Offline
God Member
Karma: 6
Posts: 581
"Oops, try again..."
|
 |
« Reply #7 on: March 26, 2011, 10:12:25 am » |
What comes to my mind is that your TX and RX are swapped, could it be?
Kari
|
|
|
|
|
Logged
|
The only law for me; Ohms Law: U=R*I P=U*I Note to self: "Damn! Why don't you just fix it!!!"
|
|
|
|
0
Offline
Faraday Member
Karma: 12
Posts: 2857
ruggedcircuits.com
|
 |
« Reply #8 on: March 26, 2011, 10:50:57 am » |
Do you have the USB plugged in at the same time? Try disconnecting it. -- The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 22
Arduino rocks
|
 |
« Reply #9 on: March 26, 2011, 01:46:31 pm » |
What comes to my mind is that your TX and RX are swapped, could it be? Yes, it is right, because the display tx and rx are from "the display point of view"... Do you have the USB plugged in at the same time? Try disconnecting it. I tried but nothing change... It is unbelievable! Same code, same wiring! I just move wires from the mega to the duemilanove! Thank guys for your time!
|
|
|
|
|
Logged
|
|
|
|
|
Espoo, Finland
Offline
God Member
Karma: 6
Posts: 581
"Oops, try again..."
|
 |
« Reply #10 on: March 26, 2011, 01:58:28 pm » |
Sorry  void setup() { Serial.begin(9600); delay(1000); Serial.write(0x55); while(!Serial.available()); Serial.print(Serial.read(), HEX); }
void loop() { } Now I must ask, what this does, and is this really everything? Kari
|
|
|
|
« Last Edit: March 27, 2011, 01:26:50 pm by GaryP »
|
Logged
|
The only law for me; Ohms Law: U=R*I P=U*I Note to self: "Damn! Why don't you just fix it!!!"
|
|
|
|
|
|
Espoo, Finland
Offline
God Member
Karma: 6
Posts: 581
"Oops, try again..."
|
 |
« Reply #12 on: March 26, 2011, 02:44:56 pm » |
That's how I connect the display:
Display Arduino 5 (RES) RESET 6 (GND) GND 7 (RX) TX 8 (TX) RX 9 (VIN) +5
Thank you
What pin numbers actually, in both cards, mega and duemilanove? Kari
|
|
|
|
|
Logged
|
The only law for me; Ohms Law: U=R*I P=U*I Note to self: "Damn! Why don't you just fix it!!!"
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 22
Arduino rocks
|
 |
« Reply #13 on: March 26, 2011, 03:18:37 pm » |
Pin numbers are the same in both cards: 0 for RX 1 for TX
I can't really understand...
Thanks kari!
|
|
|
|
|
Logged
|
|
|
|
|
Western New York, USA
Offline
Faraday Member
Karma: 17
Posts: 3465
|
 |
« Reply #14 on: March 26, 2011, 04:39:53 pm » |
Which of the four USARTS in the Mega2560 are you using to communicate with your uLCD-144? Is it the same one that is used by the bootloader to download your sketches? In the Duemilanove there is only one USART which is used for both purposes, and therein may lie the reason for the differences in operation.
Don
|
|
|
|
|
Logged
|
|
|
|
|
|