Shop OBEX P1 Docs P2 Docs Learn Events
Smart Pin Question — Parallax Forums

Smart Pin Question

On Arduino a pin can be setup as: pinMode(_dataPin, INPUT_PULLUP)

This sets the pin to input and ~20K pull-up. I dont' see anything in the smart pin docs but was wondering if something like this is possible ?

Comments

  • whickerwhicker Posts: 749
    edited 2022-08-10 23:00

    Not possible to keep the pin direction an input. The pin direction becomes an output and you can drive the output high or low with a few different selectable resistances.

    The device the pin is connected to can safely override the P2 output level, and the pin's input state can still be read even if the direction is output.

    So yes it's possible to have the same end result as "input pull-up". But the pin direction being output and then still reading the input register often confuses people.

    This also applies to an open collector configuration as well. You can do a moderate pulldown and a high impedance "high" state by keeping the output register low, but toggling the direction register.

    Or many other possibilities.

  • evanhevanh Posts: 15,915
    edited 2022-08-11 00:22

    Better way, and more accurate, to look at it is the pins are always inputs and the DIR control just enables/disables output drive circuits.

    Prop2 has a selection of eight drive strengths per pin, including Floating. And high and low drive are independent config fields so asymmetrical strengths are an option too.

    Spin2 document has the predefined WRPIN symbols:

  • evanhevanh Posts: 15,915

    For reference, 1k5 ohms is faster acting than 1 mAmp.

  • @evanh,

    That is exactly what I was looking for. Where is that documented at ? I didn't see it in the spin2 google doc.

  • evanhevanh Posts: 15,915
    edited 2022-08-11 01:18

    It's the partnering doc that Chip wrote alongside the silicon doc - https://docs.google.com/document/d/16qVkmA6Co5fUNKJHF6pBfGfDupuRwDtf-wyieh_fbqw/edit

    EDIT: Oh, the symbol lists are at the end of that Spin2 doc. Just after the large Debug section.

    BTW, Parallax have a couple of handy links for all their docs at the very top of the forums now.

Sign In or Register to comment.