I just got my Arduino today, and I decided to link it to my nspire.
I just have a little problem, my nspire's uart port is 3.3 volt TTL, while the arduino's is 5 volt TTL. This voltage is to high for my nspire, and causes most of the time a reboot when I connect it.

I've been thinking what I could to lower the voltage, and I found this: http://en.wikipedia.org/wiki/Voltage_divider . Do you think this is the right way to safely drop the voltage? (I'm not an expert in electronics as you can see Smile

Thanks in advance!
It's "safe", but not the best alternative. In my gCnBridge (and soon, Clove 3), schematic here, I use 68-ohm resistors to perform current-limiting for USB, and a pair of diodes with a 0.7V drop each, a total of a 1.4v drop, to get 5v down to a more manageable 3.6v. However, since you're dealing with bidirectional, serial communication, a diode ladder is not a good choice. I believe what you want is something like a level shifter:

http://forum.sparkfun.com/viewtopic.php?p=16942
http://www.maxim-ic.com/app-notes/index.mvp/id/3007
Hmm, those level shifter look real nice, thanks for pointing them out Smile

Currently, I only have one way communication, from the nspire to the arduino, so your way might work for me. But I first got to do some research with the data you gave me Smile
jimbauwens wrote:
Hmm, those level shifter look real nice, thanks for pointing them out Smile

Currently, I only have one way communication, from the nspire to the arduino, so your way might work for me. But I first got to do some research with the data you gave me Smile
Good deal, I hope it helps. Keep us posted on your progress.
A voltage divider should work well enough if you're not drawing too much current and your I/O lines don't have too high a capacitance. I connected an SD card (3.3V) to an AVR (5V) using simple voltage dividers to drop the AVR's 5V output to a safe level for the SD card's input and connected the SD card's 3.3V output directly to the AVR's input. I can access the card with a 10MHz clock without any issues.
Funnily enough, I'm researching that exact thing now for Clove 3's "base station" in order to share T9 dictionaries (how I'm going to step through the possibilities fast enough is another issue I'm not looking forward to solving) and what I was reading was saying that at 8MHz (and presumably 10MHz), the rising/falling edges through a resistor divider are too shallow for most newer cards, but that 4MHz will work. You haven't found that to be true, clearly. What values did you use for your divider?
Disclaimer: I don't have a scope so haven't inspected what's going on, and it may be out of spec, but have run CP/M off that SD card for many hours without any issues thus far. The machine would sometimes lose the SD card on boot but I traced this to initialising the card at 4MHz instead of 400kHz. Several other components share the SPI bus, too, and it all seems to work (touch wood).

I used a 2K2 and a 3K3 resistor.
Very Happy Touch wood, that's funny. We say "knock [on] wood", usually omitting the "on". And excellent, I'll have to throw together a demo today and try it. You voltage-divided for both the SPI data lines and VCC?
Simple resistor voltage dividers aren't very good for power supplies as the voltage drops as more current is drawn from them, though fortunately I had a 3V3 power supply on the board for another component (dsPIC33F). The dsPIC33F has some 5V-tolerant I/O pins so could use 5V signals for I/O without fear of damaging it.
I've made a little voltage divider just to try, but for some reason my arduino locks up when I connect it. I have one resister of 50 ohm, and another of 100 (I also tried one of 140 to raise to voltage a bit).

I only use the rx pin of my arduino, so the voltage divider is connected to that. Any idea what I might be doing wrong?


Arduino RX --------[50 ohm]----- Nspire Tx ----- [100 ohm] -------- GND
benryves wrote:
Simple resistor voltage dividers aren't very good for power supplies as the voltage drops as more current is drawn from them, though fortunately I had a 3V3 power supply on the board for another component (dsPIC33F). The dsPIC33F has some 5V-tolerant I/O pins so could use 5V signals for I/O without fear of damaging it.
a, I was hoping I could avoid a 3.3V supply; it seems not.

Jim: Ideally you should be using much larger resistors, like 5K and 10K instead. You want as little current to be flowing through the divider as possible, which is fine, considering that very little current is required for most digital I/O. What do you mean that it locks up?
Oh, I did not know that having bigger resistors would keep the same voltage. This might help me allot, so thanks again Smile
My Arduino stops responding to data send over USB, and only works properly when I disconnect the power source and reconnect it.
As long as the ratio is correct, it will work. Smile I guess 5M and 10M probably wouldn't do what you'd want, though, so keep it within reason. Which RX are you attaching to? If it's pin 1/2, then you're just tapping into the FTDI output and bypassing the Arduino entirely.
I just realized that a voltage divider is not good for what I'm doing. I'll be looking at the other solutions that you posted using a max3370.
One thing I've just thought about is whether the signal is of the correct polarity. According to RS-232 levels a "0" has a high voltage (e.g. +12V) and a "1" has a low voltage (e.g. -12V). It also idles at this lower voltage. The AVR's UART produces voltages that correspond to the logic signals (0V for a "0" and VCC for a "1") and so need inversion before connecting to an RS-232 device (a MAX232 performs this inversion for you, for example).
I've made a little max232 converter to connect my nspire to the pc, and it works well. But both the nspire and arduino are TTL, so that's not a problem here Smile
My problem is that the arduino serial input's (RX) voltage is 5v, which the nspire can not handle. And I can't use a voltage divider because the nspire is the transmitter, and the voltage divider just will lower the 3.3v signal.
The Arduino is based around an AVR and 3.3V is perfectly acceptable as a "logic high" according to the datasheet (ATmega168):

Yes, but my nspire doesn't accept the voltage on the arduino's input Sad
I'm not sure what you mean, sorry. I presume the Nspire is producing a signal that varies between 0V and 3.3V? That is more than sufficient for the Arduino serial input's needs, as 0V is a logic low (evidently) and 3.3V is above the 0.6*5=3V needed to register as a logic high.
Haha, It works well when the device is power through the power connector, and not through the usb port. This is probably because the FTDI chip isn't powered then (and as you said yesterday on irc), it will not put the 5v volts on the RX.

Now the real fun can start \o/
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement