Shop OBEX P1 Docs P2 Docs Learn Events
What are some good level shifters for use with an Arduino <-> Propeller? — Parallax Forums

What are some good level shifters for use with an Arduino <-> Propeller?

I've read how many people just use resistors but I think I would rather use level shifters for my next project.  
I've used these in the past with success:https://www.sparkfun.com/products/12009

But those little guys are pricey and I'd like to make an Arduiono shield (with a prop on board).
The shield will mostly receive commands (via SPI) from the Arduino.  In fact, I plan on making the shield just another SPI slave device.
I want to support the Arduino UNO which means 5v will be common.
Any suggestions on what to use?
Thanks!

Comments

  • Do you need Uni-directonal or Bi-Directional?
  • As long as the signals you are using are NOT bi-directional you can use a 74LVC08 AND gate to shift the 5 volt signals down to 3.3 from the Arduino to the Propeller.  The gate inputs are 5 volt tolerant and the NXP data sheet even indicates that this device can be used for mixed voltage interface.The propeller output to the Arduino should not require level translation since the 3.3 volt high Propeller signal is well within the Arduino minimum specs for logic 1 input. I would still place resistors in the line to prevent excess current should the Arduino input pin somehow become an output driving low.  I would imagine there are other 74LVCxx devices available but the -08 is fairly inexpensive.
  • Well, I'm thinking in the beginning to just be uni-directional.  
    I will try the resistor route for now.  Just to make things easier.

    I've read a lot of info on here and it seems to have major dispute.  So, what is the latest recommendation for resistor values?  Since the propeller will be a SPI slave, it will be an input whereas the Arduino will be output.
    So, do you think something like this would work?:
    Arduino PIN OUTPUT    
    >     4k resistor    
    >    Propeller PIN INPUT
    Would it just be in-series like that?  Or would the resistor be tied to ground?  Sorry I'm such a n00b.  :-)
    Thanks
  • 4k in series will probably work.... as will 220, 1k, 10k, 50k, 100k... and it would be bidirectional.

    Including more detailed specs on the input to be driven and the data rate, setup & hold times, etc might get closer to an ideal value.  But, for a quick an dirty value, anything between 2k and 20k should be fine.
  • Well, I'm just kicking around some ideas.  But basically, I would like to convert my Arduino VGM player over to the propeller and use the AYCog, etc.
    But, I would like for the propeller to be a shield of the Arduino so that I could use almost my existing code.  But instead of going to a real AY chip, it would go to a prop emulated one.
    Anyway, I was thinking to keep the design simple, I would setup the prop to just be another SPI slave device.
    So the Arduino would send it a command via SPI and the propeller would intercept this command and do things like load from SD card, send command to AYCog, etc.
    The Arduino would then have 5-6 cogs devoted to AY/SN/SID-cog tunes with only 4 pins.  :-)  Heck, could even extend it out to video.  Basically a miniature arcade on a shield for Arduino.  Would smoke the Uzebox.   LOL
    Shoot, my million dollar idea is out...dang...lol

  • If you need a greater voltage level shift, I have found the LM339 quad differential voltage comparators are a good choice.  I have used them for voltage levels from 3 to 15 volts with great success, but up to 30 volts is possible.  Any uni-direction voltage level shift is possible, ie. an input & output voltage, and a reference voltage.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-07-10 14:27
    I've read how many people just use resistors but I think I would rather use level shifters for my next project. 



    Sounds like you want to do "better" than many people but why use a level shifter when a resistor will work the same????? I'm really confused by  your thinking here but set straight please although I myself use resistors in commercial products for 5V (and 24V) to 3.3V and 74HCT86 running from 5V to invert or buffer to 5V signals that are not TTL compatible.
  • Sounds like you want to do "better" than many people but why use a level shifter when a resistor will work the same????? I'm really confused by  your thinking here but set straight please although I myself use resistors in commercial products for 5V (and 24V) to 3.3V and 74HCT86 running from 5V to invert or buffer to 5V signals that are not TTL compatible. 



    Well, I really don't know if level shifters are better or not.  I just assumed they were for this kind of stuff.  But I really don't know.
    I'm good with resistors.  But, I guess I just need to learn more how it works.  I guess what was confusing me was that it seemed most people couldn't agree on what values to use, etc.  I've used level shifters and it was "dead easy" for me.  So that's why I assumed I would go with them.  
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-07-10 15:03
    Well, I really don't know if level shifters are better or not.  I just assumed they were for this kind of stuff.  But I really don't know.
    I'm good with resistors.  But, I guess I just need to learn more how it works.  I guess what was confusing me was that it seemed most people couldn't agree on what values to use, etc.  I've used level shifters and it was "dead easy" for me.  So that's why I assumed I would go with them.  I can understand how all this kerfuffle has driven you to consider just using level shifters but the resistors work well and it is a pity that the "minimum recommended value" is taken way out of context. As I have explained and reasoned on this matter in many threads there is no advantage to run at this minimum value unless there is a very good reason, usually with very high frequency signals but also taking into account the number of inputs that may be driven at 5V too.

    However once you design in a resistor then it is a very simple matter to change it's value, isn't it? So, design in the resistor then.

    How it works is as simple as you can get, up until the the maximum input voltage the inputs are very high resistance but after that the "input diodes" start conducting and the resistor will limit the current that flows into the 3.3V supply. Since this voltage isn't clamped to ground like many assume but the current flows into Vdd then it can raise the supply voltage on the Prop to it's breakdown voltage, especially with many low value resistors being driven from 5V. The breakdown voltage of around 4V itself probably won't damage the Prop but there are side effects and one I have observed is boot failure in that you get a "Propeller not found".  The problem during reset is that the Prop itself draws very little current so that excess diode current from the 5V signals pushes the supply up beyond the operating limits of the chip.

    You might think that the regulators would hold the supply to 3.3V but they are more like a cruise control, they only apply gas, not brakes, so they cannot pull the supply back down if it is being pushed up externally. 

    So keep it simple and just use resistors (I would use 10k or more normally).
  • Thank you.  That was very helpful.
    So, those resistors would be in-series right?  And NOT to ground?  Like so:
    Arduino PIN OUTPUT    
    >     10k resistor    
    >    Propeller PIN INPUT

    And, should I put in a diode to protect the propeller if the Arduino is accidentally set as output?

    Propeller PIN OUTPUT    
    >     DIODE    
    >    Arduino PIN INPUT


  • Yes, series resistors for 5V to Prop. If you are sending from the Prop to the Arduino I would use 74HCT gates as level shifters and damn the torpedos if the Arduino tries to drive that pin, let it fry I say.
  • ...some men aren't looking for anything logical like money.  They can't be bought, bullied or reasoned with.  Some men just want to watch the pins burn.
    LOL, sorry...couldn't resist.
Sign In or Register to comment.