Shop OBEX P1 Docs P2 Docs Learn Events
Configpin and threshold — Parallax Forums

Configpin and threshold

WolfbrotherWolfbrother Posts: 129
edited 2009-07-04 21:27 in BASIC Stamp
I'm looking at Configpin threshold command and want to set one pin to CMOS levels, do I have to mask the entire I/O or can I just address this one input pin? I'm using the datalogger on another pin, the standard LCD on another and using the Serial port on pin 1 to communicate with the outside world. I'm guessing that if I set them all as outputs except the one input then whatever threshold command I would have is ignored.

Setup:

CONFIGPIN DIRECTION· %111110111111111··· ' All pins outputs but 10
CONFIGPIN THRESHOLD %000001000000000··· ' Pin 10 CMOS

Or can I just address that one pin 10 in a more direct manner.

Thanks,

Dave

Comments

  • dev/nulldev/null Posts: 381
    edited 2009-07-03 21:42
    You have to address all pins at once.
    Another way of doing it:

    mDirection VAR Word
    mThreshold VAR Word
    mDirection = $FFFF : mDirection.BYTE0.BIT1 = 0: CONFIGPIN DIRECTION, mDirection
    mThreshold = 0 : mThreshold.BYTE1.BIT1 = 1 : CONFIGPIN THRESHOLD, mThreshold
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    /dev/null
  • WolfbrotherWolfbrother Posts: 129
    edited 2009-07-04 21:27
    Thanks. I have to do it the long way so I can count bits and figure out what I meant...
Sign In or Register to comment.