This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2530: Reading Dio pin in dio input pullup mode

Part Number: CC2530

Tool/software:

When reading a Dio pin in Dio input pull-up mode, Low and High are read mixed.
the below code sets P1.0~P1.7 to input mode(pullup).

uint8 regvalue=0xff;
P1SEL &= ~regvalue //set P1 to dio 
P1DIR&=~regvalue;//set P1 to input mode
P1INP&=~regvalue;//pullup or down 
P2INP&=~0x40;//set P1 to pullup

and then measuring the terminal P1.0~P1.7 with mulitester.
P1.0,P1.1 and  P1.4 : 0.3V
others : 3.3V

Question1) Why are some terminals Low level even though there is internal pull-up?                   

Question2) I added external resistors as pull-up resistors to P1.0 ~ P1.7. So I got the desired result.
                   How can I get HIGH level DIO values ​​from all terminals without external resistors?

  • Hello Edan,

    It is noted in the CC253x/4x User's Guide that "I/O port pins P1.0 and P1.1 do not have pullup or pulldown capability". 

    Ensure that P1.4 configurations are not overwritten elsewhere in your code.  If register OBSSEL4 sets bit 7 (EN) then "this overwrites the standard GPIO behavior of P1.4".  You can confirm all relevant P1.x registers inside a debug session with the Register View.

    With the correct settings then P1.4 can be pulled up internally like the rest, however P1.0 and P1.1 will require external resistors.

    Regards,
    Ryan

  • Thank you.
    Your answer is always a great help to me.