Go Down

Topic: uLCD-144 4D problem with Duemilanove (Read 3316 times) previous topic - next topic

a.periz

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

GaryP

The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

a.periz

Sorry :)

Code: [Select]
void setup()
{
   Serial.begin(9600);
   delay(1000);
   
   Serial.write(0x55);
   while(!Serial.available());
   Serial.print(Serial.read(), HEX);
}

void loop()
{
}


GaryP

Then it must be physical coneection problem, or broken device.

Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

a.periz

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

GaryP

I was talking about the Duemilanove...
;)

It's time to check your circuit, could you show us how it is put together?

Cheers,
Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

a.periz

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

GaryP

What comes to my mind is that your TX and RX are swapped, could it be?

Kari
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

RuggedCircuits

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

a.periz

Quote
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"...

Quote
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!

GaryP

#10
Mar 26, 2011, 07:58 pm Last Edit: Mar 27, 2011, 08:26 pm by GaryP Reason: 1

Sorry :)

Code: [Select]
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
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

a.periz

In this pdf:
http://www.4dsystems.com.au/downloads/Serial-Display-Modules/uLCD-144(SGC)/Docs/uLCD-144-SGC-DS-rev1.pdf
at page 10 they said to wait up to 500ms from reset to send the autobaud command (0x55) so I wait 1s. The display waits until 5s for this command.
Then the display should answer with the ACK (0x06), so I wait for that.

Thank you

GaryP


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
The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

a.periz

Pin numbers are the same in both cards:
0 for RX
1 for TX

I can't really understand...

Thanks kari!

floresta

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

Go Up