Pages: [1]   Go Down
Author Topic: TTL voltage level? HELP!  (Read 2443 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Dallas, Texas
Offline Offline
God Member
*****
Karma: 31
Posts: 887
Old, decrepit curmugeon
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Dallas, Texas
Offline Offline
God Member
*****
Karma: 31
Posts: 887
Old, decrepit curmugeon
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

New true random number library available at: http://code.google.com/p/avr-hardware-random-number-generation/

Current version 1.0.1

Offline Offline
Faraday Member
**
Karma: 65
Posts: 2518
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. * * * *
« Last Edit: June 22, 2012, 11:18:43 am by Runaway Pancake » Logged

"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?"

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27089
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Faraday Member
**
Karma: 8
Posts: 2526
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?  smiley

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
 
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 538
Posts: 27089
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Leeds, UK
Online Online
Edison Member
*
Karma: 80
Posts: 1726
Once the magic blue smoke is released, it won't go back in!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

~Tom~

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 159
Posts: 2916
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: