Is it possible to use TXS0108 with SPI? Not working here...

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
daemach
 
Posts: 146
Joined: Fri Feb 13, 2009 2:07 pm

Is it possible to use TXS0108 with SPI? Not working here...

Post by daemach »

I'm trying to use a TXS0108 to translate 3.3v to 5v I2C and SPI. The I2C side works great, but the SPI side doesn't. It seems that MISO and SCK are being driven high, possibly due to the pullup resistors in the TXS0108. This interferes with all of the SPI devices as well as trying to burn a bootloader.

The TXB0108 doesn't use pullups.

Should this be working? If so, what am I missing? I'm using an atmega328 and arduino code to drive this. If I should be using the TXB line rather than the TXS line, do I need to add pullup resistors on both sides of the i2c lines? The devices plugged into the i2c bus should all have their own pullups. Does the atmega328 pull up the SDA and SCL lines? What is safest/most robust?

TXS - http://www.ti.com/lit/ds/symlink/txs0108e.pdf
TXB - http://www.ti.com/lit/ds/symlink/txb0108.pdf

Any help would be appreciated!
TXS0108SPI.png
TXS0108SPI.png (20.39 KiB) Viewed 3055 times

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Is it possible to use TXS0108 with SPI? Not working here...

Post by adafruit_support_mike »

Daemach wrote:I'm trying to use a TXS0108 to translate 3.3v to 5v I2C and SPI. The I2C side works great, but the SPI side doesn't. It seems that MISO and SCK are being driven high, possibly due to the pullup resistors in the TXS0108. This interferes with all of the SPI devices as well as trying to burn a bootloader.
I doubt the pullups are the problem, for a couple of reasons. First, the datasheet lists them as having values of 4k or 40k, depending on whether you're trying to pull up or down. Any pin on a '328 should be able to swing that kind of resistance around without trouble. Second, both I2C and SPI require clocks. I can't see any obvious reason why the pullups should kill one clock and not the other.

I notice that you have another chip connected to the SPI lines on the 3v3 side, so it's possible you're seeing interaction between that and the level shifter. That would still be wierd, but it's at least something to check.

My first suggestion would be to benchmark the SPI lines by disconnecting everything from them and making sure SCK and MISO actually work. It's always a good idea to verify the obvious before looking for anything more complicated.

If SCK and MISO do work as advertised with no load, try connecting only the level shifter. If the problem comes back, make a note of it but check all the other connections in isolation just to be sure. If the problem only exists when the level shifter is connected, that's probably your culprit, and your best bet will be to try the other chip. If you see the problem in other conditions, you'll have more ideas for what to check.

The only other obvious question I can think of is, "what's your SPI clock speed?" The datasheet says the TXS is rated for speeds up to 20MHz, so it's hypothetucally possible you're trying to push it too fast, though I doubt it.

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”