Hi all,
I am trying to read 16 byte data from UART to process but I have an issue which I dont understand.
Data which I want to receive is 11 11 FF 03 0f 00 00 00 00 3e 34 01 01 a7 34 12 ..
First 11 11 is header and 34 12 is footer.
After first packet which I read, I have always got byte 0x11. I did not solve.
this is the simple code
SysCtlPeripheralEnable(PERIPH_GPIO_BLUETOOTH_UART); GPIOPinConfigure(CONF_GPIO_BLUETOOTH_UART_RX); GPIOPinConfigure(CONF_GPIO_BLUETOOTH_UART_TX); GPIOPinTypeUART(BASE_GPIO_BLUETOOTH_UART, PIN_GPIO_BLUETOOTH_UART_RX|PIN_GPIO_BLUETOOTH_UART_TX); SysCtlPeripheralEnable(PERIPH_UART_BLUETOOTH); IntDisable(INT_UART_BLUETOOTH); UARTDisable(BASE_UART_BLUETOOTH); UARTClockSourceSet(BASE_UART_BLUETOOTH, UART_CLOCK_PIOSC); UARTConfigSetExpClk(BASE_UART_BLUETOOTH, 16000000, BAUDRATE_BLUETOOTH, UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE); UARTFIFODisable(BASE_UART_BLUETOOTH); UARTIntEnable(BASE_UART_BLUETOOTH, UART_INT_RX | UART_INT_RT); UARTIntRegister(BASE_UART_BLUETOOTH, IntBluetooth); UARTEnable(BASE_UART_BLUETOOTH);
while (UARTCharsAvail(BASE_UART_BLUETOOTH))
{
rcvd_byte = UARTCharGet(BASE_UART_BLUETOOTH);
}
Thanks in advance