Shift 0-1.8V logic to 0-5V logic

beagleboarddigital potentiometergpiolevel-shiftingspi

I'm using BeagleBoard-xM McSPI to drive an MCP42050 digital potentiometer. Before using the SPI chip itself I'll try bitbanging through 3 GPIOs (but my question relates to both configurations).

BB outputs 1.8V for logic high (and, I think, 0V for low). But MCP42050 needs >3.5V for high (VDD = 5V, which is a must) and <1.5V for low.

What I need? A level shifter of course (3 actually, for each SPI signal). The problem is: I need to make one using only shelf components (common BJTs, resistors, FETs and so on).

I've seen this question and one of its answers almost resolved my issues.

Based on Glaser's solution (most voted), I've though myself to cascade two NPN BJTs sharing common emitter. Input signal connected to first BJT's base (limited by a R1 resistor). First BJT's collector connected to second BJT's base. And both collectors connected to 5V through two resistors (R2 and R3).

I could not find in MCP42050 datasheet how much current do I need to drive its input, so I suspect very little is needed. And that's why I've thought about a high value for all resistors, like 4k7 or 5k6.

Additional info: I think I don't need very high frequencies. The higher frequency involved is SCK signal, in bursts of 16 cycles, and BB-xM McSPI can work with frequencies as low as 4kHz (it froze when I tried 3kHz). The shift is unidirectional.

Here my questions:

  1. Will it work?
  2. How to compute R1, R2 and R3?
  3. It would be very nice to have both BJTs in a single component (Darlington pairs come to mind), but I don't know whether there is a shelf component for this. Do you know?
  4. I don't mind loosing some BJTs (to runaway breakdown, for example); but I do mind burning my BB-xM. How can I protect it against such accidents (specially when fiddling with resistors values)?
  5. Any other suggestion (instead of my cascading BJTs circuitry)?

Thanks. Sorry if they are newbie questions; they'll get harder as I improve my skills.

Edit

As noted by NickT there is a better circuit, using a single FET plus 1 resistor.

But now I stepped in another problem: I just found that BSN10A is not that common. Been to 6 local shops and no one have even heard of it. So now I'm looking for an equivalent component or circuitry.

Besides, the 4th question is still valid: how can I protect the Beagle?

Best Answer

There is also a single-NPN possibility in that question that may work for your setup provided the output impedance of the 1.8V part is much smaller than the input impedance of the 5V part (this is certainly the case here). You'd have to adjust the resistor values.

Disclaimer : I'm the op of the linked question, but didn't use that setup extensively (I ultimately went for the 2-diode route).