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.

CC2541: Are pull up active for peripheral inputs

Other Parts Discussed in Thread: CC2541

I am designing in a BLE module based on the CC2541and have a question concerning the pull ups on the GPIO pins when they are configured as peripheral inputs?

In particular I am using UART on P05:2.

Document swru191e.pdf ,  the CC2541 User's Manual, appears to contradict itself:

7.3 General-Purpose I/O

When used as an input, the general-purpose I/O port pins can be configured to have a pullup, pulldown or
three-state mode of operation. By default, after a reset, inputs are configured as inputs with pullup. To
deselect the pullup or pulldown function on an input, the appropriate bit within the PxINP must be set to 1.
The I/O port pins P1.0 and P1.1 do not have pullup or pulldown capability. Note that pins configured as
peripheral I/O signals do not have pullup or pulldown capability, even if the peripheral function is an input.


7.6 Peripheral I/O

For USART and timer I/O, setting the appropriate PxSEL bits to 1 is required for the output signals on a
digital I/O pin to be controlled by the peripheral. For peripheral inputs from digital I/O pins, this is optional.
PxSEL = 1 overrides the pullup or pulldown setting of a pin, so to be able to control pullup and pulldown
with the PxINP bits, the PxSEL bit should be set to 0 for that pin.

 

My gut feel for the USART is to go with 7.6 in that it spefically mentions two particular peripheral types but  Iwould like to know if anyone has a definitve answer.


Thank you

  • Hi Marc,

    This means:

    - For a peripheral like the UART you _must_ set PxSEL for the output pins, however it is not required for the input pins.

    - If you want to use pull-up or -down on the input pins you must not set PxSEL for those pins since this will override the pull-functionality (in other words you configure the input pins as GPIOs, but the signal will still reach the peripheral)

    I hope this was clear, if not feel free to ask again!

    Cheers,
    Fredrik

  • Thanks Fredrik,

    Yes, this answers my question.  Slightly counterintuitive but I understand.

    Many thanks

    Marc