hi all,
when i use the HalUARTRead()and HalUARTWrite(),i found it doesn't work very well,how should i do?
Dears,
I have some experiences on using HALUARTRead() and JHALUARTWrite(). If you can specify your problem more clear, maybe I can help. For example, what kind of configuration do you use it, on coordinator, router, or end device? And, what your problem using these two API?
Regards!
YK Chen
Hello YiKai Chen
May I share your experience.
I am writing a code using HALUARTWrite() function.
Just Example:
uint8 A[3];
A[0]=1;
A[1]=2;
A[2]=3;
HALUARTWRITE(Port0,A,3);
But it gives following HEX values on PC:
06 Instead of 1
18 Instead of 2
1E Instead of 3
Can you tell me what is the exact problem.
Thanks in Advance.
Hi Imatiaz,
Do you initialize uart correctly? Do you use correct baud rate of UART? The followings are source code example used to initialized UART for your reference.
void initUart(halUARTCBack_t pf){ halUARTCfg_t uartConfig; uartConfig.configured = TRUE; uartConfig.baudRate = HAL_UART_BR_115200; uartConfig.flowControl = FALSE; uartConfig.flowControlThreshold = 48; uartConfig.rx.maxBufSize = 128; uartConfig.tx.maxBufSize = 128; uartConfig.idleTimeout = 6; uartConfig.intEnable = TRUE; uartConfig.callBackFunc = pf; HalUARTOpen (HAL_UART_PORT_0, &uartConfig);}