Shop OBEX P1 Docs P2 Docs Learn Events
Diode on Vdd for level shifting — Parallax Forums

Diode on Vdd for level shifting

jstjohnzjstjohnz Posts: 91
edited 2011-09-08 11:22 in Propeller 1
Edit: title should read diode in Vss line for level shifting.

Hopefully I can explain this clearly. I have a prop board that drives RGB pixels. Even though most pixel controllers are 5V chips, I have never had an issue with the prop's 3.3v outputs driving them reliably.

Now, however, I've encountered a type of pixels where the 3.3V high level of the prop is marginal. My proposed solution is to insert a diode between the power supply ground terminal and Vss of the prop, with the cathode side to power supply ground and the anode to the prop circuitry Vss.

Basically, Vss of the prop would then be at +0.7V with respect to pixel ground, and Vdd would be at +4.0 volts with respect to pixel ground. My output signals would have the same range. This would give me the margin I need at logic high, and still have plenty of margin at logic low.

It appears to work just fine, but I'm wondering if anyone sees a drawback to this approach.

The only other I/O on the system besides the pixels is a WIZNET ethernet module, and the ethernet is transformer-coupled, so it isn't affected.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-03 07:37
    You can do this, but you have to be really careful about connections to other things (like your programming port). Remember that an accidental short of the diode could destroy the Prop. 4V is right at the edge of the maximum voltage you can apply to any I/O pin or the supply pins.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-09-03 09:11
    Mike is right on the money with his caveat. PCs and instruments (e.g. oscilloscopes) often have their Vss/grounds connected to the mains safety ground. Connecting any two external items (e.g. PC and scope) that use different grounds could fry the Propeller chip. I'd be much more inclined to use a 74HCT logic IC between the Prop and the pixel driver just to keep things kosher ground-wise.

    -Phil
  • jstjohnzjstjohnz Posts: 91
    edited 2011-09-03 12:35
    I've attached a simplified schematic to better illustrate what I'm doing. The diode replaces what is now a direct connection between power supply ground and prop ground. Shorting the diode would not damage anything, it would just revert the circuit back to the original configuration, and change the logic levels back to 0 and 3.3v. The I/O pins and the prop Vdd pins never see more than 3.3V with respect to the prop's Vss. Basically I'm just using the voltage drop across the diode to elevate the prop's Vss to be 0.7V above system ground which in turn changes the logic output levels to 0.7 and 4.0 volts with respect to system ground. And the prop's Vdd becomes 4.0V above system ground. But the prop is still operating at 3.3 volts Vdd-Vss.

    I fully agree that HCT is a better solution, but this is a retrofit to an existing board.
  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-03 12:49
    The same caveats apply. If, for some reason, the output lead gets shorted out to ground, depending on the characteristics of the diode in the ground lead, you may get a fault current in the protective diode on the Prop I/O pin and fry that. You're not showing any other I/O leads and you have to be careful about those. I'm not saying that you can't do this, just that there are risks not present in normal circumstances and things sometimes happen that you don't expect, like accidentally grounding an I/O pin. The Prop is quite robust in terms of normal overcurrent through the I/O driver transistors, but the protective diodes are not similarly robust.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-09-03 13:16
    jstjohnz,

    What is your pixel clock rate? If it's not too high, you could boost the Prop's output voltage to around 3.9V - 4.0V with a weak pull-up (>2.2K) to 5V by modulating dira instead of outa. For example, with a 5.1K pull-up, I'm seeing about a 140ns rise time from dira[0]~~ to dira[0]~, with outa[0] == 0 and no load.

    -Phil
  • jstjohnzjstjohnz Posts: 91
    edited 2011-09-03 18:03
    Mike Green wrote: »
    The same caveats apply. If, for some reason, the output lead gets shorted out to ground, depending on the characteristics of the diode in the ground lead, you may get a fault current in the protective diode on the Prop I/O pin and fry that. You're not showing any other I/O leads and you have to be careful about those. I'm not saying that you can't do this, just that there are risks not present in normal circumstances and things sometimes happen that you don't expect, like accidentally grounding an I/O pin. The Prop is quite robust in terms of normal overcurrent through the I/O driver transistors, but the protective diodes are not similarly robust.

    OK Mike, thanks for your comments. I do see a potential issue (so to speak!) if an output pin is shorted to ground.
  • jstjohnzjstjohnz Posts: 91
    edited 2011-09-03 18:07
    jstjohnz,

    What is your pixel clock rate? If it's not too high, you could boost the Prop's output voltage to around 3.9V - 4.0V with a weak pull-up (>2.2K) to 5V by modulating dira instead of outa. For example, with a 5.1K pull-up, I'm seeing about a 140ns rise time from dira[0]~~ to dira[0]~, with outa[0] == 0 and no load.

    -Phil

    That is a very clever idea, and one I wouldn't have thought of. Probably not enough drive capability for this application but I will keep it in mind for future use.
  • Mark_TMark_T Posts: 1,981
    edited 2011-09-05 03:53
    If the Prop gets its Vdd from a 3V3 regulator that references to the Prop's Vss, then shorting Vss to ground wouldn't be a problem (the level shifting would fail of course). Make sure there is decoupling from Vss to Vdd for the propeller and I think some across the diode would be advisable.

    Alternatively using a schottky diode would a half-way compromise since 3.3 + 0.4 is 3.7V which is not as on-the-edge as 4.0V.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2011-09-05 08:35
    I don't understand why you want to power the Prop in this dangerous unconventional way just to interface to a 5V device. We have conventional methods that work well and are proven.

    Here is the schematic of a bidirectional I2C interface to 5V devices. Its well proven. This can be used for any general level shifting applications. Note! this is basically an "open drain" circuit with pullup resisters on both sides of the MOSFET. If speed is important us 1K or even 470 ohm.
    http://forums.parallax.com/showthread.php?134122
    The actual interface is on the right hand of the schematic.

    Operation:
    Since this is an open drain circuit output and input is done a bit differently.
    Preset the I/O pins with lows. Use the DIRA register as the output.
    When DIRA set to an input the pin is high through the pullup resisters.
    When DIRA set to an output the pin goes low.

    Duane
  • TappermanTapperman Posts: 319
    edited 2011-09-08 11:22
    jstjohnz wrote: »
    I've encountered a type of pixels where the 3.3V high level of the prop is marginal.

    Why not try a 'buffer' chip?

    I use the 4049 for level shifting ... gives me six (inverted) and takes prop signals at 3.3 and up's them to 5v for whatever? I assume we're talking outputs only? Need another buffer to go the other way.

    ... Tim
Sign In or Register to comment.