Shop OBEX P1 Docs P2 Docs Learn Events
Interfacing 5V to the Propeller — Parallax Forums

Interfacing 5V to the Propeller

Vega256Vega256 Posts: 197
edited 2012-12-17 13:53 in Propeller 1
Hey guys,

In my setup, VDD with respect to VSS is 3.3V, so according the datasheet, the maximum voltage with respect to VSS that I can apply to any of the IO pins is -0.3V to 3.6V, but I wanted to get a 5V signal to an I/O pin, so I put down a 510 ohm for every 5V to the Propeller.

I have had it this way for a long time now: about 6 months. It seems that the Prop has been working fine.

Is this doing internal harm to the Prop? Should I get a higher rated resistor or just avoid interfacing 5V with the Propeller all together?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-14 11:07
    Vega256 wrote:
    Is this doing internal harm to the Prop?

    Maybe. According to the datasheet, the maximum current allowed through the internal protection diodes is 500 uA, and
    (5V - 3.3V - 0.6V) / 510 ohms = 2.16 mA

    -Phil
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-12-14 11:31
    Hi Vega;
    Vega256 wrote: »
    Hey guys,

    In my setup, VDD with respect to VSS is 3.3V, so according the datasheet, the maximum voltage with respect to VSS that I can apply to any of the IO pins is -0.3V to 3.6V, but I wanted to get a 5V signal to an I/O pin, so I put down a 510 ohm for every 5V to the Propeller.

    I have had it this way for a long time now: about 6 months. It seems that the Prop has been working fine.

    Is this doing internal harm to the Prop? Should I get a higher rated resistor or just avoid interfacing 5V with the Propeller all together?
    You might get away with it but it's clearly outside the spec of 0.5mA.
    The rule of thumb is to use 4.7K or so.
    (5.5V - 2.7V - 0.6V) / 0.5mA = 4.4K

    Duane J
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-14 11:45
    Duane,

    In your formula, where did the 5.5 and 2.7 come from? Using my constants, 2.2K is borderline, so 2.7K or 3.3K ought to be big enough -- at least where regulated supplies are used.

    -Phil
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2012-12-14 11:49
    I'm guessing 5.5v is as high as 5v rails are generally allowed, and 2.7 is as low as 3.3v rails are generally allowed.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-12-14 13:36
    Yes, it's good engineering practice to assume the worst case conditions.
    Of course, if your only making and testing a single unit you could use the smaller values but I wouldn't do it.

    Duane J
  • Vega256Vega256 Posts: 197
    edited 2012-12-14 14:37
    Thanks guys. I'll probably just go with 4.7K just to be safe.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-12-14 14:56
    Just to fill in one small gap: there is a price to pay for using a too-high input resistor. The Prop's input capacitance is about 6 pF. Combined with a 4.7K resistor, that amounts to a 28 ns time constant. Since the Prop is capable of resolving times down to 12.5 ns, this could become a factor in certain high-speed apps. I'm not saying 4.7K is a bad choice. On the contrary, it should be fine for most apps. BTW, Parallax uses 3.9K on the Prop BOE to couple the servo header signals.

    -Phil
  • Vega256Vega256 Posts: 197
    edited 2012-12-14 15:20
    Good call, Phil. I think that this is somewhat of a high-speed application; I need to get those signals to the Prop as quickly and safely as possible. As you originally suggested, perhaps 3.3K is better?
  • Mike GreenMike Green Posts: 23,101
    edited 2012-12-14 15:47
    Remember that Phil is talking about HIGH SPEED with switching times well under a hundred nanoseconds. "Quickly" and "safely" trade off in your situation. It would be short-sighted to allow for "quickly" when it's not necessary. A larger resistor, by slowing things down, reduces radiated switching noise ... there are all sorts of angles to this.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-12-17 06:10
    OK, to get high speed the impedance's, resistance in this case, must be fairly low. However, low resistive values are unsafe for the Prop pins.
    One nice way to get safe low impedance's is to use a form of the circuit used to buffet I2C signals.
    5V-3.3V.png

    This circuit assumes a 5V, or higher even 12V, logic gate on the left and a Prop Input pin on the right.
    The resister can be even smaller depending on the low drive capabilities of the gate on the left,

    Duane J
    305 x 105 - 6K
  • AntoineDoinelAntoineDoinel Posts: 312
    edited 2012-12-17 06:47
    Just to fill in one small gap: there is a price to pay for using a too-high input resistor. The Prop's input capacitance is about 6 pF. Combined with a 4.7K resistor, that amounts to a 28 ns time constant. Since the Prop is capable of resolving times down to 12.5 ns, this could become a factor in certain high-speed apps. I'm not saying 4.7K is a bad choice. On the contrary, it should be fine for most apps. BTW, Parallax uses 3.9K on the Prop BOE to couple the servo header signals.

    -Phil

    Phil,

    is there any reason why we can't use a small capacitor in parallel with each limiting resistor?

    I've only tried simulating this, but once I nailed the cap value, it looks like rise time is greatly improved, while leaving full protection at DC.

    (the specific application I had in mind was soldering capacitors to the pads on the underside of the Propeller ASC+ board, since the pads are already there! :lol:)

    Maybe there's something obvious that I'm missing?
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2012-12-17 08:30
    Hi Antoine;
    Phil,

    is there any reason why we can't use a small capacitor in parallel with each limiting resistor?

    I've only tried simulating this, but once I nailed the cap value, it looks like rise time is greatly improved, while leaving full protection at DC.

    (the specific application I had in mind was soldering capacitors to the pads on the underside of the Propeller ASC+ board, since the pads are already there! :lol:)

    Maybe there's something obvious that I'm missing?
    You are quite right. We often call these "Speedup Capacitors".
    The speedup cap is essentially in series with the pin cap.
    This forms a kind of voltage divider to the fast rise time of the signal.
    Lets assume the pin capacitance is 6pF and the input is 5V.
    The speedup cap should be:
    ( Vout / ( Vin - Vout ) * CpF
    ( 3.3V / ( 5V - 3.3V )) * 6pF = 12pF

    However, I suspect the capacitance at the pin is more than the 6pF in the spec.
    The extra capacitance is is in the PC board and other components.
    Maybe as high as 20pF or more, depending on the layout. so in this case the speedup would be about 39pF.
    Some of this capacitance is is already in the series 4.7KΩ resister.

    Caution, don't assume you can use a large capacitor as this can inject a fairly large current into the pin's protection diodes.

    Duane J
  • AntoineDoinelAntoineDoinel Posts: 312
    edited 2012-12-17 13:53
    Hi Antoine;
    You are quite right. We often call these "Speedup Capacitors".
    The speedup cap is essentially in series with the pin cap.
    This forms a kind of voltage divider to the fast rise time of the signal.
    Lets assume the pin capacitance is 6pF and the input is 5V.
    The speedup cap should be:
    ( Vout / ( Vin - Vout ) * CpF
    ( 3.3V / ( 5V - 3.3V )) * 6pF = 12pF

    However, I suspect the capacitance at the pin is more than the 6pF in the spec.
    The extra capacitance is is in the PC board and other components.
    Maybe as high as 20pF or more, depending on the layout. so in this case the speedup would be about 39pF.
    Some of this capacitance is is already in the series 4.7KΩ resister.

    Caution, don't assume you can use a large capacitor as this can inject a fairly large current into the pin's protection diodes.

    Duane J

    Thanks for the tips Duane!

    so something in 22pF-33pF range, like the ones used to compensate crystals.
    Without a fast scope, I guess it might be tested before/after insertion using an high speed protocol, for example reading an SD card.
Sign In or Register to comment.