jkeating
Posts: 11
Joined: Thu Aug 01, 2013 5:05 am

UART ATMEGA

Wed Aug 21, 2013 4:31 am

I am currently working on a project to read data from a GPS device and display that data on a LCD. Currently I'm using avr-gcc on the PI to program the AVR on the gertboard. The AVR is controlling the LCD and I'd also like the AVR to control/read the GPS device. Ive got the LCD up and running, now to the GPS. It uses UART but I'm not clear on how to connect things. I'm using a EM-406 GPS. Has anyone done this? I think reading the data will be pretty straight forward once I have everything connected right.

So I guess my question is how do I interface with the UART of the ATMEGA on the gertboard? I tried to find some reference in the forums but didn't find anything. Can someone point me in the right direction please? Much help is appreciated.

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: UART ATMEGA

Wed Aug 21, 2013 12:27 pm

Connect the GPS UART to the D0 & D1 pins, but first make sure the TX-output of the GPS is 3V3.
(I don't know in how far the ATMEGA is 5V tolerant)
If not use a resistor divider of e.g. 5K6 + 3K3:

GPS TX --> 3K3 --> <point A> ---> Pi
<point A> --> 5K6 --> gnd

GPS TX goes to D1,
Atmega D0 goes to RX of GPS.

jkeating
Posts: 11
Joined: Thu Aug 01, 2013 5:05 am

Re: UART ATMEGA

Wed Aug 21, 2013 1:41 pm

Thanks for the reply Gert. Looking at my GPS's datasheet I found this:

ProtProtocol
Electrical Level: TTL level,
Output Voltage Level: 0V~2.85V
Baud Rate: 4800 bps
OuOutput Message: NMEA 0183 GGA, GSA,
GSV,
RRMC (VTG, GLL optional)

So the voltage being 0v-2.85V shouldn't need to worry about frying the atmega correct? Just plug it direct to the RX pin?

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: UART ATMEGA

Wed Aug 21, 2013 6:32 pm

Yes.

Return to “HATs and other add-ons”