• TI Thinks Resolved

CC1312R: Sub-1 GHz forum

Intellectual 1580 points

Replies: 2

Views: 64

Part Number: CC1312R

I've implemented a UART example using driverlib from SDK3.20.00.68, and can't get the Rx interrupt to work.   I am able to poll using UARTCharsAvail, and properly receive a character.  But the ISR is never hit.

Here's the code:

 

UARTDisable(UART0_BASE);

UARTConfigSetExpClk(UART0_BASE, CPU_CLOCK_HZ, baud, UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE);

UARTFIFOEnable(UART0_BASE);

UARTHwFlowControlDisable(UART0_BASE);

UARTFIFOLevelSet(UART0_BASE, UART_FIFO_TX1_8, UART_FIFO_RX1_8);

UARTIntEnable(UART0_BASE, UART_INT_RT | UART_INT_RX);

UARTIntRegister(UART0_BASE, INTRX_DEBUG_IRQHandler);

UARTIntClear(UART0_BASE, UART_INT_OE | UART_INT_BE | UART_INT_PE | UART_INT_FE | UART_INT_RT | UART_INT_TX | UART_INT_RX | UART_INT_CTS);

UARTEnable(UART0_BASE);

 

if (UARTCharsAvail(UART0_BASE))

{   

receive[j] = UART_GetByte(0);

UART_TXByte(empty, receive[j]);

}

 

void INTRX_DEBUG_IRQHandler(void)

{

receive[j] = UART_GetByte(0);

UART_TXByte(empty, receive[j]);

}

 

  • Hi Hendrix,

    Is there a reason you're using driverlib instead of TI Drivers? 

    With TI Dtivers you could  use UART_MODE_CALLBACK and it will trigger interrupt on UART TX and RX. You will find some example in SDK docs: file:///C:/ti/simplelink_cc2640r2_sdk_1_40_00_45/docs/tidrivers/doxygen/html/_u_a_r_t_c_c26_x_x_8h.html

    Thanks,

    Alexis

  • In reply to Alexis Crandall20:

    I'm helping a customer who wants to keep things very low-level, thus the driverlib approach.  I can get the TI driver examples to work, but there don't seem to be any examples that use driverlib directly.   

    Since the UART is working, it's only the interrupt piece that's an issue.  It appears that UARTIntRegister puts the vector in SRAM, not the flash vector table.  But even if I manually put the vector in the flash table (in startup_ccs.c), I don't get interrupts.  

    I forgot to include it above, but I'm also enable global interrupts with this:

    IntEnable(INT_UART0_COMB);
    IntPendClear(INT_UART0_COMB);
    IntMasterEnable();