RS232 communication

GTT TFT Support

Moderator: Mods

Post Reply
JamesZ
LCD?
Posts: 7
Joined: Thu Apr 28, 2011 3:22 am

RS232 communication

Post by JamesZ »

Hello,
I Have some problems with the communication between the screen and my kit of development.
My kit is equipped with a microcontroller from Atmel (AT90CAN128), I use the UART0 to have a dialog with the screen. The setting of my communication are the following: 115200 Baud, 8 bits, no parity, 1 bit stop.

When I connect my kit with a PC, it is functionning normally, and when I connect it with the screen, some bytes are displayed and other no (or I have a rectangular caracter which is displayed).

I try two configuration:
The first one , I set up the HW flow control with my microcontroller in a software manner. I put my RTS pin in a low level and I wait until the screen put it high; but it doesnt work! I look in an oscilloscope the rising edge and I see two times the same pattern for one byte send (but maybe the display understand the first rising pattern like a caracter and the second like my byte).
The second I linked RTS and CTS pin like I see it in an other post, but it didnt work properly, I have still caracters which I dont want.

And the last problem I see, is when I want to send some commands like Set Insertion Point or Clear Screen, the screen didnt understand or it is done with a shift in time!!!
I have make a lot of debug step, with oscilloscope, hyperterminal and so forth but I didnt find where is the problem!
Can you explain me how the RST and CTS signals are used?

Thank you in advance for you answer.

JamesZ
LCD?
Posts: 7
Joined: Thu Apr 28, 2011 3:22 am

Post by JamesZ »

Hello,
I have checked my configuration of my communication, it is 115200 Baud, 8 bits of data, no parity and 1 bit of stop.

I have save a trace of my RS232 communication between my kit of development and the GTT. You can see on this picture that after my byte of data I have an ackwnoledge from my slave (GTT) and I have another one juste after!! And my screen print my data and after it display me another caracter (rectangular shape) that I didnt want!
My code is very simple, I do this things: I send 5 bytes to my screen.
for(i=0;i<5;i++)
{

carac=uart_putchar (Tab6);
_delay_us(50);

}
Do you have already see this case? Is it a known problem from GTT?
Thank you for your response.

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Post by Clark »

Hello James,

I appreciate the image provided, though I would ask that you change a few things so we can get a better idea of what may be going wrong.

First, CTS is an input to the GTT, it will be controlled by your host. To see what the display is doing, please monitor the RTS pin. It is controlled by the GTT and will tell your host when to stop sending data.

Second, please send a known value, and let us know what it is, to make it clear that data is being transmitted successfully from your host.

Finally, check into the uart_putchar function. You seem to indicate that the GTT is showing the information you send to it followed by a non printable character or rectangle. Please ensure putchar is not adding information such as a null character to the end of your byte.

Thanks,
~Troy
Troy Clark
Design & Development
Matrix Orbital

JamesZ
LCD?
Posts: 7
Joined: Thu Apr 28, 2011 3:22 am

Post by JamesZ »

Hello,
Than you for your response.

Sorry to have forget some essential information about my picture. The data which was send is the caracter U, which is 0x55 in hexadecimal format.
I think that the screen understand the value between both acknoledge like a caracter but he printed it like a square shape!
I have checked my function Uart_putchar and it just send one byte, no null caracter or something like that.

In my micrcontroller I didnt have the hardware flow control which is supported by my UART, so I have to manage it by software?!
My interface is joined to this post.

If I understand correctly, when my host want to send some bytes to the display, I have to check if the line CTS (from the point of view of the GTT, pin 6 of the Standart connector) is in a Low logic level (6V), that means that the GTT will accept my data, and then I can send them. After every byte, the GTT will put High the line CTS (from the point of view of the GTT, pin 6 of the Standart connector), which means that my byte was received by my display.
And when my host want to receive data, I have to check if the line RTS (from the point of view of the GTT, pin 5 of the Standart connector) is in a Low logic level, about 6V, that means I can receive data. If the line is in a High logic level (_6V), it means that the transmission is finished.

Can you just check if my explanation is correct, if not can you explain to me how I have to drive the screen to transmit and receive data (with my HW flow control which is done by software)?

Can you explain me that : "If the CTS line is in an invalid or undriven state the GTT will not transmit data", you have posted the last time.

JamesZ
LCD?
Posts: 7
Joined: Thu Apr 28, 2011 3:22 am

Post by JamesZ »

Hello Troy,
Thank you for your response. Dont worry about my name, it is an alias ;)

Can you just sum up the manner to exchange data between my micrcontroller and the screen with the hardware flow control (simply way)?
The role of CTS and RTS?

And please, tell me if this sentences are good:
When I want to send some data to my screen, I manage RTS like that: I put RST low level and the screen understqnd that I want to send to him some data, and I just send it. May I have to check if RTS (from my

JamesZ
LCD?
Posts: 7
Joined: Thu Apr 28, 2011 3:22 am

Post by JamesZ »

Hello Troy,
Thank you for your response, now it is clear.

Clark
Matrix Orbital
Matrix Orbital
Posts: 881
Joined: Fri Aug 17, 2007 10:58 am
Location: Matrix Orbital
Contact:

Post by Clark »

Hello Reno,

My apologies, I did send an email yesterday but I admit it was difficult to confirm the address. I did provide my personal email and you can always post or PM me here if you have any further trouble communicating to your GTT.

Thanks,
~Troy
Troy Clark
Design & Development
Matrix Orbital

Post Reply