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