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.

CC2640: UART RX PULL UP AVAILABLE ?

Part Number: CC2640

Hi all,

When the UART RX pin is configured as a general purpose I/O, it is possible to enable and disable an internal pull-up resistor, and to select whether it's a pull-up or a pull-down .So far, everything's fine.

My question is Is it possible to enable pull up on the UART RX pin as it is configured a san input ? My program is waiting for INTERRUPTS on the RX line and if I leave it floating ( by default) its catching up all random inputs and interrupts are generated. Please advise.

The datasheet seems not to highlight this point.

Thanks

Anil

  • The UART_RX pin is set to PIN_PULLDOWN in BoardGpioInitTable and then changed to NO_PULL when calling the UART_open. I do not understand why that should be a problem as your UART_RX pin should be connected to something that is pulling that pin either high or low.

    Siri
  • Hi Siri,

    Appreciate your quick response. In my program, Im continuously monitoring my RX line for interrupt from a PC. Even when the UART Cable is not connected, Im getting random interrupts on my RX line and my ISR is getting executed multiple times. I believe in order to monitor interrupts on the UART _RX line I will have to keep uart_open all the time. This makes my RX pin floating if no UART cable is connected between my microcontroller and PC.

  • Hi Siri,

    Appreciate your quick response. In my program, Im continuously monitoring my RX line for interrupt from a PC. Even when the UART Cable is not connected, Im getting random interrupts on my RX line and my ISR is getting executed multiple times. I believe in order to monitor interrupts on the UART _RX line I will have to keep uart_open all the time. This makes my RX pin floating if no UART cable is connected between my microcontroller and PC.
  • You can try to modify the driver to configure the UART_RX to have a pullup.

    I am not sure which SDK you are using, but you should find a function (UARTCC26XX_initIO in UARTCC26XX.c that can be modified like this:

    static bool UARTCC26XX_initIO(UART_Handle handle) {
        /* Locals */
        UARTCC26XX_Object               *object;
        UARTCC26XX_HWAttrsV2 const     *hwAttrs;
        PIN_Config                      uartPinTable[5];
        uint32_t i = 0;
    
        /* Get the pointer to the object and hwAttrs */
        object = handle->object;
        hwAttrs = handle->hwAttrs;
    
        /* Build local list of pins, allocate through PIN driver and map HW ports */
        uartPinTable[i++] = hwAttrs->rxPin | PIN_INPUT_EN | PIN_PULLUP; //////////////////// PIN_PULLUP added
        /* Make sure UART_TX pin is driven high after calling PIN_open(...) until
        *  we've set the correct peripheral muxing in PINCC26XX_setMux(...)
        *  This is to avoid falling edge glitches when configuring the UART_TX pin.
        */

    I recommend that you include a local copy of the UARTCC26XX.c in your project and modify that file instead of modifying the files in the SDK.

    BR

    Siri