Shop OBEX P1 Docs P2 Docs Learn Events
PULLUP PULLDOWN — Parallax Forums


UnsoundcodeUnsoundcode Posts: 1,532
edited 2023-11-29 21:06 in Forth

I have the accessory set for the evaluation board and I want to test the one that has buttons and leds but I'm thinking I need to put PULLDOWN on the input pin. This is what I have tried and it does not seem to work any tips would be appreciated


I can see where it sets the pin low when I check "lsio" but it is not reading the input from the control button when I press it, the leds are working fine.


  • There are many many possible configurations for the "smart" pins, which makes the setup complicated. Groups of bits form subfunctions and are shifted to their positions and combined to 32bits and then written to x, y and pin-registers with wrpin wxpin and wypin. pulldown is a constant to be used as a bit group in the process.
    You will have to study the smart pin docu and you can have a look in extend.fth, how it is done in Forth. I end up setting directly with %....000111..... .
    This pin configuration is independent from Forth.

  • Christof Eb.Christof Eb. Posts: 1,158
    edited 2023-11-30 16:33

    The smartpin docu, the best at this point :# :

    there I have an example where I define a constant

    %1010 24 << ( B-input: x010 = relative +2 pin's read state 1= inverted )
    %1_11100_0 OR   := #SYNC_TX

    then this is used to configure that pin:

    You would want %00000 = normal mode. I must admit, that I have not used it with other pin drive modes.

    Hope, this helps a litte bit.

  • @"Christof Eb." thanks, that does not look like Forth I will have to study the info in the links and see if I can understand whats going on.

    B.T.W. if I use physical pull down resistors I can read write the inputs just fine it's just that I have this control accessory that conveniently plugs onto the evaluation board and I was hoping to be able to use it.

  • @"Christof Eb." you were right I think although I am still trying to understand how to configure the pins. What I did find was the exact example that I wanted but it is coded in spin2 , I think ?? , so I translated part of this to Forth and it worked.

    Here is the link : use the pull-up,-up or pull-down.

    I really would like for someone to explain these mode bits in more detail and in a simpler way if possible. The Forth documentation seems to detail pullup and pull down but I have tried many different ways and could not make it work. I will show the code I used when I post the "control accessory" demo.

Sign In or Register to comment.