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

PULLUP PULLDOWN

UnsoundcodeUnsoundcode Posts: 1,530
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

TAQOZ# 36 PIN R SETPIN PULLDOWN

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.

Comments

  • 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,106
    edited 2023-11-30 16:33

    The smartpin docu, the best at this point :# :
    https://docs.google.com/document/d/1gn6oaT5Ib7CytvlZHacmrSbVBJsD9t_-kmvjd7nUR6o/edit

    In https://forums.parallax.com/discussion/175572/p2-taqoz-v2-8-i2s-driver-for-max98357a-amplifier#latest
    there I have an example where I define a constant

    \ %AAAA_BBBB_FFF_MMMMMMMMMMMMM_TT_SSSSS_0
    %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:
    *DIN PIN #SYNC_TX WRPIN

    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 : https://www.elektormagazine.com/articles/parallax-propeller-2-part-5-smart-pin#:~:text=To 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.