Author Topic: Raspberry Pi GPIO 3.3V <-> 5V  (Read 9378 times)

0 Members and 1 Guest are viewing this topic.

Offline itvend

  • Contributor
  • Posts: 25
  • Country: ee
  • dumb as f**k
Raspberry Pi GPIO 3.3V <-> 5V
« on: July 02, 2013, 05:04:59 pm »
Hello everybody.

So i have atmega32 and raspberry pi and i wish to connect them with SPI. Is it good idea to convert SPI 3.3V signals to 5V for atmega using transistor based buffer like on schematic ( attachment )
Hmmm got nothing.
 

Offline warrmr

  • Contributor
  • Posts: 5
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #1 on: July 02, 2013, 07:09:03 pm »
Try something like this http://www.adafruit.com/products/757 Its similar to your design.
 

Offline itvend

  • Contributor
  • Posts: 25
  • Country: ee
  • dumb as f**k
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #2 on: July 02, 2013, 07:16:08 pm »
cant buy this module but it was one of ideas , DIP IC would be great, any suggestions ?
Hmmm got nothing.
 

Offline tld

  • Regular Contributor
  • *
  • Posts: 86
  • Country: no
    • Personal Website
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #3 on: July 02, 2013, 07:51:38 pm »
Any reason you can't use an atmega32L, and run it off of 3.3V as well?
 

Offline itvend

  • Contributor
  • Posts: 25
  • Country: ee
  • dumb as f**k
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #4 on: July 02, 2013, 08:10:08 pm »
buy new uC , i thought about it. but what about schematic would it work for SPI
Hmmm got nothing.
 

Offline warrmr

  • Contributor
  • Posts: 5
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #5 on: July 02, 2013, 09:09:22 pm »
Have a look at one of the TXB0108 chips, its an 8 channel converter, if you look around I'm sure you can get one cheaper with less channels.

Otherwise take a look at the schematics for the spark fun level converter, and modify the schematic so that it is bi-directional on both channels as in this current form only the tx lines are bi-directional.

https://www.sparkfun.com/datasheets/BreakoutBoards/Level-Converter-v10.pdf


http://www.adafruit.com/datasheets/txb0108.pdf
http://www.adafruit.com/datasheets/txb0108appnote.pdf
 

Offline Ziltoid

  • Contributor
  • Posts: 23
  • Country: de
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #6 on: July 02, 2013, 09:22:44 pm »
Maybe you can get around it with a simple Voltage divider from 5 to 3.3V, and check how the other device interprets the 3.3V. If it reads the 3.3V as high you just need some resistors!
 

Offline itvend

  • Contributor
  • Posts: 25
  • Country: ee
  • dumb as f**k
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #7 on: July 02, 2013, 09:26:40 pm »
That i know and was my plan , but problem is 3.3V to 5V
Hmmm got nothing.
 

Offline millerb

  • Regular Contributor
  • *
  • Posts: 71
  • Country: us
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #8 on: July 02, 2013, 09:26:52 pm »
Is there a compelling reason to be running your microcontroller at 5V? If not, supply with 3.3V and move on. I pretty much treat 5V as legacy these days and would only use level shifters if I needed to talk to a 5V part, which is almost never.
 

Offline Ziltoid

  • Contributor
  • Posts: 23
  • Country: de
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #9 on: July 02, 2013, 09:58:43 pm »
Your Rasp is runnig at 3.3V and the Atmel at 5V right? Check if the Atmel is taking the 3.3V as a Digital High!
 

Offline c4757p

  • Super Contributor
  • ***
  • Posts: 7805
  • Country: us
  • adieu
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #10 on: July 02, 2013, 10:20:56 pm »
Is there a compelling reason to be running your microcontroller at 5V? If not, supply with 3.3V and move on. I pretty much treat 5V as legacy these days and would only use level shifters if I needed to talk to a 5V part, which is almost never.

This. Why would you run the chip at 5V?
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline itvend

  • Contributor
  • Posts: 25
  • Country: ee
  • dumb as f**k
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #11 on: July 02, 2013, 10:52:21 pm »
Why? because it run on 5V and 5V is everywhere , now i feel its just simpler to buy 3.3 uC atmega32l for example   :bullshit: :bullshit: :bullshit: :bullshit:
Hmmm got nothing.
 

Offline Stonent

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #12 on: July 02, 2013, 11:40:21 pm »
On this site, the guy turned his Pi into an Atmel programmer, he kept everything at 3.3 powered from the Pi and it worked fine.

http://kevincuzner.com/2013/05/27/raspberry-pi-as-an-avr-programmer/

I checked Mouser and filtered by just DIPs, and only the "ATmega32-16PU" is not 3.3 capable, but all other ATmega32 chips are.

So that's the 32A, 32L, 324PA, 324P, 324PV10
« Last Edit: July 02, 2013, 11:58:12 pm by Stonent »
The larger the government, the smaller the citizen.
 

Offline RoadRunner

  • Regular Contributor
  • *
  • Posts: 236
  • Country: de
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #13 on: July 03, 2013, 12:11:25 am »
may be these chips are helpful

http://www.ti.com/product/sn74lvc1g125

they take 3.3V input and can work 5V level.
 

Offline itvend

  • Contributor
  • Posts: 25
  • Country: ee
  • dumb as f**k
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #14 on: July 03, 2013, 12:43:54 am »
may be these chips are helpful

http://www.ti.com/product/sn74lvc1g125

they take 3.3V input and can work 5V level.

 :-+ sn74lvc1g125 sucks little, i hate smd parts, but what you gonna do i probably go with sn74lvc1g125 or 3.3V uC, thaks all for generating ideas , but i didnt get answer for my question, does transistor buffer works for spi or not?
Hmmm got nothing.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 7280
  • Country: nz
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #15 on: July 03, 2013, 03:15:01 am »
If it's just for a hobby project just connect the 3.3V directly to the 5V input, it will work fine even though it's outside spec.

From memory the pins change to logic high somewhere between 1V -> 2V
Greek letter 'Psi' (not Pounds per Square Inch)
 

Offline brainwash

  • Frequent Contributor
  • **
  • Posts: 443
  • Country: de
    • Hack Correlation
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #16 on: July 03, 2013, 05:02:39 pm »
Or you can take an 3.3V supply from the rPI and provide that to the microcontroller.
If not possible, read everything here: http://www.newark.com/pdfs/techarticles/microchip/3_3vto5vAnalogTipsnTricksBrchr.pdf
 

Offline ptricks

  • Frequent Contributor
  • **
  • Posts: 664
  • Country: us
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #17 on: July 03, 2013, 09:52:47 pm »
Lots of ways, but here are some easy ones:
https://www.sparkfun.com/tutorials/65

 

Offline tld

  • Regular Contributor
  • *
  • Posts: 86
  • Country: no
    • Personal Website
Re: Raspberry Pi GPIO 3.3V <-> 5V
« Reply #18 on: July 03, 2013, 10:05:08 pm »
thaks all for generating ideas , but i didnt get answer for my question, does transistor buffer works for spi or not?

If I understand you correctly, you're not just looking to solve an actual problem, but also curious if your thinking and possible solution is correct.

I think part of the reason that you haven't gotten a really good answer to that might be that there's a lot of variables at play, and hard to give an answer that's correct for all of them.

As a general answer, yes, it should be a workable to use a transistor-buffer for SPI, as long as you keep an eye on not getting an inverted signal etc.

There is however a lot of factors to consider.  Take speed for example.  How fast will the SPI-bus be?  Will bandwidth/rise-time be fast enough?

Figuring out if everything will always behave the right way - with margins - is quite a bit of work, and virtually impossible without diving into details.

Depending on specific, it's quite possible that a 3.3V signal can register correctly as HIGH on a 5V micro.
For the other direction, you might be able to simply cut down the 5V signal to 3.3V-safe levels using a resistor divider.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf