SPI Bus - 5V and 3V3 Devices

Status
Not open for further replies.

kjn

Member
Hi,

So I've run into a little problem and I'm trying to make sure everything is ok before I proceed.

I plan to have 3 devices on the T3.1 Hardware SPI bus.
1x ILI9341 2.2" LCD
1x SDCard
1x Freescale 33977

The ILI9341 and SD card are both 3v3 Logic devices, however the 33977 is a 5V logic device.
By itself the logic high input the 33977 is >2.0v and the serial in pins on the T3.1 are 5V compliant, so the device works ok.

My concern is connecting it to a shared bus where the MISO, MOSI, SCLK are all shared among devices, could the 5V signal on MISO from the 33977 harm the other devices on the bus when it is transmitting?
or when CS is not asserted on these devices (display/SDCard) does their respective MISO lines go High-Z or similar?
If this couldn't be guaranteed (how could I check?) could I use a simple level shifter on the MISO from the 33977 to ensure a proper design of the bus?

Or could I use a SoftSPI (shiftOut(),ShiftIn()) implementation (on separate pins) but would have to modify these with delays to not exceed a 2.0MHz SPI Speed for the 33977 which would otherwise be managed by SPI transactions (also the 33977 uses 16 bit transfers which would be preferred for Hardware SPI on the T3.1)

Advice/Suggestions/Insight?

Thanks
 
Teensy 3.1 is 5V tolerant.

The ILI9341 is not 5V tolerant. Some ILI9341 displays, like the ones Adafruit sells, have 5 to 3V buffers. The cheap one we have does not.

Likewise, SD cards are not 5V tolerant. The SD adaptor we make for Teensy 2.0 has a 5 to 3V buffer. The Wiz820+SD adaptor for Teensy 3.1 does not have any buffers, so do not let another device drive MISO with a 5V signal if you've got a SD card connected directly.

Here's an article I recently wrote, regarding SPI bus sharing.

http://www.dorkbotpdx.org/blog/paul/better_spi_bus_design_in_3_steps

Step 2 has a suggestion about how to test the MISO line, using 2 resistors to make it "float" to a non-logic voltage, so you can easily measure with a voltmeter. You could use a 3V-powered, 5V tolerant buffer chip on MISO, like Adafruit does on their CC3000 module (shown in that article).

If the slower speed is ok, connecting the 5V device to other pins and using shiftIn() and shiftOut() or other bit-bashing code might be the best alternative. Then all the 3V devices could share the SPI bus, without worry of damage from the 5V device.
 
Yes, if the SO pin on the MC33977 is shared with 3.3 V devices' SO pins, they will be overdriven when the '33977 is enabled (CSB is low).

You could ignore the SO pin (i.e. don't connect it), or use a softSPI (this doesn't have to un at 2 MHz), or use a 3-state buffer on the SO (tristate-disable to CSB). Perhaps, (if the other components allow daisy-chaining, you could connect the 3.3 V devices first, and the 33977 last ? (e.g .T3.1 SO --> LCD_SI; LCD_SO --> SDCARD_SI; SDCARD_SO --> 33977_SI; 33977_SO --> T3.1). However this depends on the polarity and phase of the SPI being the same for all components.
 
Hey Guys,

Thanks for the feedback. Certainly the datasheet for the Freescale chip indicates that when CS is asserted Low all other SPI pins go to High-Z.
The ILI9341 also suggests that it will also follow this behaviour.

However I think from a safety standpoint I will either bitbash on seperate pins or use a tri-state buffer on the MISO on the '33977
 
Status
Not open for further replies.
Back
Top