Go Down

Topic: TTL voltage level? HELP! (Read 2834 times) previous topic - next topic

RjSowden

So I got a MT3329 GPS chip and I'm trying to wire it up to my arduino Duemilenove. I'm relatively new to this aspect of electronics so I thought that this would be a relatively easy but informative project. So far, though, I've got nothing from the module. The MT3329's TX pin goes to the arduino RX pin, and the Arduino's TX pin goes to the MT3329's TX pin. However, when I test the voltage level of the arduinos TX, I've notices that its 5 volts.With the Module, its ~3.3 volts (around 3.4 volts)

My question is this:
Can the arduino read 3.3 volt TTL logic levels, hence why I don't seem to be getting data from it? If it can't, what do I need to scale the module's 3.3 volt logic to the arduino's logic level? Is it a simple transistor, or more complex?

Little background: I've tried reading the chips serial data by: Using the software Serial library, Also writing to eeprom from the default TX/RX when the arduino is unplugged, all to no avail?

Please help ASAP as I have an entire weekend at which I can do whatever I like, which can't be said for the week afterwards :/

Thanks!!!!!!

wanderson

Bad news, you may have damaged your gps chip.  Good news, if not, all you need is a level translator that will translate 3.3v logic and 5v logic (or use a 3.3v arduino)
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

RjSowden

Ahhhh okay, thanks! the MT3329 has a USB option so i'll try that. If thats bad, I'll know I've damaged the chip. If its good I'll get a translator, Thanks! I don't suppose you'd know the part number/ chip number of the kind of translator I'd need to get?

wanderson

Lady Ada, Sparkfun, and others offer breakout boards with the converters.  If you just want a chip, there are a number of options, but I use a 74HC4050E
New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

Runaway Pancake

#4
Jun 22, 2012, 06:13 pm Last Edit: Jun 22, 2012, 06:18 pm by Runaway Pancake Reason: 1
The Arduino/ATmega should be (and often is) happy with 3V3 data coming in (at RX), you shouldn't need to "scale up".
The GPS might not like taking 5V data in, but you could scale that down with a voltage divider.

* * * * If you had a couple of transistors and a few resistors, it'd be easy to make a couple of inverting switches, a double inverter, to bring this up to 5V instead of buying ICs and so on. * * * *
"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

kg4wsv

Quote
The Arduino/ATmega should be (and often is) happy with 3V3 data coming in


Really?  Let's look at the datasheet.  The ATmega328 datasheets says:

Quote
VIH (voltage for an input high)         min 0.7VCC


and a footnote says:

Quote
"Min" means the lowest value where the pin is guaranteed to be read as high


VCC on the Arduino is 5V.  0.7 * 5V = 3.5V.

So, according to the datasheet, you can NOT count on a standard 5V arduino to read a 3.3V signal as high.

-j


CrossRoads

You didn't quite read the chart in Section 29 correctly kg4wsv:

Input High Voltage, except XTAL1 and RESET pins

Condition:
VCC = 2.4V - 5.5V

VinHi Min = 0.6VCC

"Min." means the lowest value where the pin is guaranteed to be read as high

>> 0.6 * 5V = 3V.

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

kg4wsv

Quote
You didn't quite read the chart in Section 29 correctly


eh?  "29. Instruction Set Summary".  What's that got to do with it?  :)

Turns out I'm looking at the "ATmega48P/88P/168P/328P" full datasheet, dated 02/09.  crossroads is right, I obviously read the wrong line.

BUT:  what is the minimum VOH for the other device?  Looking at the MT3329 GPS datasheet,

Quote
TXA TTL H Level VCC=3.3V 2.1V - 2.8V


So, maximum VOH is 2.8V, but minimum VIH for a 5V ATmega328P is 0.6*VCC = 3.0V.

This will probably work, but it will not be reliable.  This is how you get circuits that seem to work, but act squirrelly when the battery gets low, or when you move it out to the car and it's cold outside, or ....

-j

CrossRoads

I was reading Section 29, Electrical Characteristics, from '328 Spec Rev 8271D-AVR-05/11.
Time to upgrade your copy?

Complete doc is up to 558 pages plus 8 pages of Table of Contents at the end of the document.

5/11 seems to be the latest Rev:

ATmega48A/PA/88A/PA/168A/PA/328/P Complete
(file size: 21150715, 567 pages, revision D, updated: 05/2011)

ATmega48A/PA/88A/PA/168A/PA/328/P Summary
(file size: 501131, 35 pages, revision D, updated: 05/2011)

2.8V feeding in could be a problem.
Maybe run from 4.5V instead of 5:
4.5 * .6 = 2.7

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Tom Carpenter

The other option would be to run the GPS at a slightly higher voltage.

From its datasheet:
Quote
Operation supply Voltage   Min=3.2v  Typ=3.3v  Max=5v


So if you were to go for something like 4v for the GPS, that would push up its TX voltage to ~3.5V
~Tom~

oric_dan

From the discussion, it sounds like 0.6*5V = 3V input to the Arduino should be
ok, but if you chose to do level-shifting, then rather than wiring up a complete
chip, you could use

- a series-diode [1N914] and pullup resistor [4.7K to 5V] on the TX out of the
  GPS module, to give 3.3+0.7V = 4V input to the Arduino.

- a simple voltage divider[as others suggested], 2.4K series w/4.7K to ground 
  on the RX input pin to the GPS module.

Go Up