Page 1 of 1

NMOS to 3.3v

Posted: Fri Oct 18, 2013 2:46 am
by Justin
Hi Gang,

I am attempting to interface my NMOS 6522 to a 4GB MicroSD card. I purchased a TI TXB0104 to convert between 5V and 3.3V. However, I'm seeing some strange behavior. I stick the multi meter on one of the 3.3V outputs on the A side. The corresponding B side is connected to a 6522 port that has been configured as an output (high bit in the DDR) and is low (low bit in ORB). I read 0 volts on the 3.3 side - good. Then, I toggle it high by writing a 1 bit to ORB. It goes to 1.65 volts. Odd. I then remove the multi meter probe from the output pin and put it back (changing nothing else) and suddenly it reads 3.3V - good.

I also see a similar behavior if I look at the 6522's pins using a logic analyzer. After sending some clocks, the clock line appears to be 'stuck low'. If I remove and reconnect the probe it has somehow gone high.

I'm not sure exactly what's going on here, but I suspect it has something to do with why the card won't respond to my commands. I am considering a different strategy for interfacing the NMOS 6522 to the 3.3V SD card. I scrounged some old posts and found Andre Fachat's method along with this one: http://www.ele.uva.es/~jesus/6502/perif_schem.pdf With the latter, he is just using voltage dividers (although different values for MOSI, SCK, and CS). I read somewhere else that a 3.3V output is enough to be considered a TTL "high", so that explains the direct connection on this circuit.

What's your favorite method for making the transition?

On the software side, I am bringing CS high, writing out 10 $FF bits using Garth's code, dropping CS, sending CMD0 (0x400000000095), and receiving nothing but $FF back for the next 256 frames. Also confirmed that the SD card's DO is high after such operations.

Re: NMOS to 3.3v

Posted: Fri Oct 18, 2013 4:42 am
by GARTHWILSON
I haven't used NMOS since 1985 to know for sure, but I think it won't pull up high enough to hurt your 3.3V part even if you connect it directly. If it can pull up higher, it won't be enough to turn on the 3.3V part's input-protection diodes and give them anywhere near enough current to hurt them. Do measure it though, and see what you get.

The other thing is that it kind of sounds like you don't have the ground connection on the voltage converter IC.

Re: NMOS to 3.3v

Posted: Fri Oct 18, 2013 5:17 am
by Dr Jefyll
Quote:
it won't be enough to turn on the 3.3V part's input-protection diodes and give them anywhere near enough current to hurt them.
Hmm... With this setup, any current passing through the protection diodes will tend to raise the 3.3V supply. So, in addition to measuring input current, it's best to also watch the voltage of the 3.3V supply -- and/or put a Zener there. That said, I agree it seems unlikely that you'll run into a problem, since NMOS outputs don't source much current.

-- Jeff

Re: NMOS to 3.3v

Posted: Tue Oct 22, 2013 2:38 am
by Justin
Got it working. Two possible culprits:

1) The ground issue that Garth suggested. I found a wobbly ground post.
2) Not enough current from the NMOS 6522 to drive the TXB0104. On the 3rd re-reading of the datasheet, I found a single sentence stating that it needed 2mA. The 6522 datasheet says it can source between 200-1000uA.

I added a 74LS367 buffer between the 6522 and the TXB0104, resoldered the wobbly post and voila - I am getting SPI responses. Now to unravel that blasted SD card protocol! :-)