Timing and communicating

3 views
Skip to first unread message

Gowan

unread,
Nov 15, 2010, 2:02:06 PM11/15/10
to RuggedCircuits
I'd like to write a program to send data from the GAtor to a terminal
I shall write.
I'd like to communicate through the USB fitting on the Gator.
It's mentioned that PC7 is used for USB handshaking.
PD0 and PD1 would be used for a USART port, but that would use PB0 for
synchronous communications (by the book).
How should I address the USB fitting on the board?

Also, I see no obvious external clock. Is this why handshaking is
used?
Thanks

Rugged Circuits

unread,
Nov 15, 2010, 5:16:22 PM11/15/10
to RuggedCircuits
On Nov 15, 2:02 pm, Gowan <peterstew...@telus.net> wrote:
> I'd like to write a program to send data from the GAtor to a terminal
> I shall write.
> I'd like to communicate through the USB fitting on the Gator.
> It's mentioned that PC7 is used for USB handshaking.
> PD0 and PD1 would be used for a USART port, but that would use PB0 for
> synchronous communications (by the book).
> How should I address the USB fitting on the board?

To communicate over the USB interface you will be using the USART
peripheral on PD0 and PD1. On the PC side of things this will appear
as a regular serial port, or you can use the native DLL functions
provided by FTDI.

> Also, I see no obvious external clock. Is this why handshaking is
> used?

The serial USART interface is asynchronous, thus there is no clock
signal. Handshaking is supported on RTS (PC7) and CTS (PC6) as these I/
O pins are connected to the corresponding pins on the FT232 USB
interface device.

> Thanks

Gowan

unread,
Nov 15, 2010, 5:43:09 PM11/15/10
to RuggedCircuits
I've read that the internal rc timer is not accurate enough to support
asychronous USART. Does the use of RTS and CTS mean that doesn't
matter?
thanks

Rugged Circuits

unread,
Nov 16, 2010, 9:05:30 AM11/16/10
to RuggedCircuits
The two matters are unrelated. First, the internal RC oscillator is
frequently accurate enough to support most common USART baud rates,
though temperature extremes may affect it enough to cause
communication problems at very cold or hot ambient temperatures.

However, the Gator board uses an external 20 MHz oscillator, not the
internal RC oscillator, so this is not an issue.

Second, RTS and CTS are used to control the flow of serial data, not
control the baud rate of the USART. If the baud rate is incorrect, RTS
and CTS will not fix that problem.

> thanks

Gowan

unread,
Nov 19, 2010, 10:33:32 AM11/19/10
to RuggedCircuits
Thanks for that info. That cleared up a lot.
In AvrStudio I set the freq to 20 MHZ when I used the code from Dean
Camera's USART polling tutorial.
The returned characters are correct about 90% of the time.
Is there a more accurate freq I should be using?
thanks

Rugged Circuits

unread,
Nov 19, 2010, 5:57:22 PM11/19/10
to RuggedCircuits
No, 20 MHz is the correct frequency. I am not familiar with the USART
polling tutorial. What baud rate is being used? At very high baud
rates it is quite possible to have frequent bit errors, or there may
be a configuration error in the tutorial.

Gowan

unread,
Nov 20, 2010, 11:31:10 AM11/20/10
to RuggedCircuits
I've been trying many different combinations.(div_by, UBBR)
There is still the same problem at the same rate.
The settings are:
9600 baud
20 Mhz
UBRR = 129


Gowan

unread,
Nov 20, 2010, 6:09:31 PM11/20/10
to RuggedCircuits
Can I get any hints on how the Gator terminal was setup, or how the
Analogue app transmits the csv file?


Rugged Circuits

unread,
Nov 20, 2010, 7:13:33 PM11/20/10
to RuggedCircuits
Those settings look correct. The problem could well be with the
software you are running or the configuration of the program on the PC.

Rugged Circuits

unread,
Nov 20, 2010, 7:15:05 PM11/20/10
to RuggedCircuits
On Nov 20, 6:09 pm, Gowan <peterstew...@telus.net> wrote:
> Can I get any hints on how the Gator terminal was setup, or how the
> Analogue app transmits the csv file?

Here is a nice tutorial on Windows serial port programming:

http://www.robbayer.com/files/serial-win.pdf

The Gator GUI program essentially uses this approach.
Reply all
Reply to author
Forward
0 new messages