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.

UART problem in CC254x HAL



Dear all,

I have been trying to use the HAL functions to send data out of the UART (P0_2,3) port. I set the periodic event in 1kHz, and then I put the TX function call inside the event handler function. Could you please have a look at my code?

In the preprocessors:
....
HAL_DMA=FALSE
xPOWER_SAVING
HAL_UART=TRUE
HAL_UART_ISR=1
 ....etc

The pin settings:
  P0SEL =0xC3;  //1100 0011

The Initialization function:
void sbpSerialPacketParser( uint8 port, uint8 event ){}

void serialAppInitTransport( )
  {
  halUARTCfg_t uartConfig;

  // configure UART
  uartConfig.configured = TRUE;
  uartConfig.baudRate = HAL_UART_BR_9600;
  uartConfig.flowControl = FALSE;
  uartConfig.flowControlThreshold = 48;
  uartConfig.rx.maxBufSize = 128;
  uartConfig.tx.maxBufSize = 128;
  uartConfig.idleTimeout = 6;
  uartConfig.intEnable = TRUE;
  uartConfig.callBackFunc = sbpSerialPacketParser;

  (void)HalUARTOpen( SBP_UART_PORT, &uartConfig );

  return;
  }

The TX function-call inside the performPeriodicTask():

  HalUARTWrite(HAL_UART_PORT_0, "hi", 2);

What's wrong with my code? I have look at the signal by a logic analyser, but there was no signal coming out from the TX pin (P0_3).

Where else should look into?

Thank you!

Q

  • Q, 

    Read through this thread: http://e2e.ti.com/support/low_power_rf/f/538/t/218578.aspx

    I just recently had the same problem.  Try to match up your UART registers with the ones I documented and check to make sure they are correct.  

    Also put a breakpoint in HalUartWrite and ensure it's actually being called.  There are some case statements in there that prevent it from being called for me based on my port/alt config

    Also, what do you have your IEN0, IEN1, and IEN2 set to?