spi 5v to v3 logic.

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

I'm trying to find a way to use a SPI slave (5v) with a SPI master(3v)

 

I'm able to read all data from the master with my atmega32u4 but sending is random.  I would like not to use a level shifter because I need the pbo,1,2,3,4 pins for other 5v logic. Looks like it may work but sending is a problem.

 

 

I added a 3v6 z-diode to my MISO pin to get the voltage at near 3v but it didnt change the issue any.

 

In the above all data goes out as 1,45,0,5a,5a,5a,5a,5a and the in data is never the same. Looking at the wave form I think its trying to do it but maybe is having a hard time pulling low or high.

 

 

 

 

Last Edited: Thu. Jul 18, 2019 - 04:58 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


S_K_U_N_X wrote:
I would like not to use a level shifter because I need the pbo,1,2,3,4 pins for other 5v logic.
Indeed for some level translators whereas others don't.

SPI has fast edges so the simple FET level translators might not work well (should for most AVR TWI); others have an active pull-up that transitions to a passive pull-up (bus hold) so that bits/sec is maintained though the level translator.

S_K_U_N_X wrote:
I added a 3v6 z-diode to my MISO pin to get the voltage at near 3v but it didnt change the issue any.
An alternate way by Schottky diode :

Planet Analog - Articles - SIGNAL CHAIN BASICS #66: How to interface a 5V transceiver to a 3V controller

...

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

a pair of simple fet level shifters will work wonders here!

 

Choose pullup's appropriate for your I2C bus instead of the values shown!

Jim

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...

 

 

 

 

Last Edited: Thu. Jul 18, 2019 - 07:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm trying to find a way to use a SPI slave (5v) with a SPI master(3v)

 

I'm able to read all data from the master with my atmega32u4 but sending is random.  I would like not to use a level shifter because I need the pbo,1,2,3,4 pins for other 5v logic.

Your post sounds a little confusing---are you saying the AVR is the slave?  Is it the one running at 5V?  Then what item is the master?

I need the pbo,1,2,3,4 pins for other 5v logic. If you are referring to the AVR slave, this doesn't make sense

 

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AVR slave yes and yeah, ttl 5v. It receives everything fine but send random.  I'm not sure its random, looks like its having troubles pulling. The master is a gaming console.

 

My point about other 5v logic, is that I need thoes pins not to have permanent components on them as ill be using them for other things.  So I'd like to avoid adding level shifting in my my circuit if possible. Resisters and diodes (to ground) I can turn on and off via a pin. In line components I can not.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

S_K_U_N_X wrote:
... ttl 5v.
(pedantic) CMOS 5V?

TTL 5V and CMOS 5V have different thresholds.

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When I spoke of 5v ttl I'm referring to the atmega32u4 chip. Whatever threshold that may be that the pins operate at.

 

 

I just tried making the SPDR a  1 statically. My output shows 1,2 or 3 in all cases and random at that. So my best guess is the MISO just can not pull or raise the wire in a timely fashion.

Last Edited: Thu. Jul 18, 2019 - 08:20 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

VIL <= 0.2VCC - 0.1V (LVTTL)

VIH >= 0.2VCC + 0.9V (LVTTL)

 

VOL <= 0.7V (VCC = 5V) or 0.5V (VCC = 3V)

VOH >= 4.2V (VCC = 5V) or 2.3V (VCC = 3V)

 

 

"Dare to be naïve." - Buckminster Fuller