Shop OBEX P1 Docs P2 Docs Learn Events
how to "override" signal with propeller — Parallax Forums

how to "override" signal with propeller

mike56mike56 Posts: 22
edited 2009-06-10 20:55 in Propeller 1
I have a sensor which is going to the input pin of another device.· It is +3.3V when the sensor is on and 0V when the sensor is off.

I want to hook up a pin from the propeller to simulate the sensor input.·

Can I do this by directly hooking up an output pin from the propeller without disconnecting the sensor?

I suspect the input pin is pulled high internally.· When the sensor is off, it is open collector input.· When it is high, it ties ground to the input pin.

Also, what is the pin "resistance" of the propeller pins?· Suppose I have a 1k resistor one end + 3.3V and one end to·the·input pin of the propeller. Then the actual input inside the propeller would be the voltage diver between the 1k and the pin resistance.· What is the pin "resistance"?

Thanks in advance for the help.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-10 19:36
    If you're sure the sensor output is open-collector, then you could connect a Propeller pin to the line. You still run the risk of damage to the Propeller I/O pin in case of a programming error where the sensor pulls the line low (to 0V) while the Propeller is trying to hold the line high (+3.3V). That should not happen in normal circumstances. One way to prevent damage is to use a 100 Ohm series resistor in the Propeller I/O lead.

    The Propeller I/O pin doesn't really have a "resistance" because there's a CMOS transistor between the I/O pin and ground (and another one between the I/O pin and Vdd) and the transistor is turned fully on to provide a logic low. The Propeller datasheet (pg 25) gives the output low voltage as 0.4V at 10mA. You'll find that the voltage remains very close to that value until the current gets near to the maximum for the I/O pin (40mA). There's similar behavior for the output high voltage.
  • mike56mike56 Posts: 22
    edited 2009-06-10 20:08
    Thanks for the answer!

    Instead of holding the line high, is there a way to simulate an open collecter type output with the propeller without too much extra discrete components?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-10 20:27
    An open-collector / open-drain output requires a pullup resistor. The Propeller behaves as an open-drain output by toggling the I/O direction register bit (DIRA) while the output register bit remains a zero, so it either pulls the I/O line low or provides a high-impedance.
  • mike56mike56 Posts: 22
    edited 2009-06-10 20:34
    A lot of microcontrollers have programmable internal pullup resistors. Does the propeller not have these? Thanks.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-06-10 20:55
    The Propeller does not have programmable internal pullup resistors.
Sign In or Register to comment.