cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 4

vica_4467471
New Contributor

Hi,

I send command code '~^L' through BLE (Bluetooth) and I have programmed using PSoc Creator 4 to output it into UART ---

UART_UartPutChar(126); // ~
CyDelay(10);
UART_UartPutChar('^'); // ^
CyDelay(10);
UART_UartPutChar(76); // L

And I find that this value detected (tested using HyperTerminal).

However, I find that my ARM processor (receiving the data) behaving erratically. Most of the times it functions properly, but frequently the command does not perform. WHEN I SEPERATELY SEND THE COMMAND FROM HYPERTERMINAL IT WORKS WELL...

Could the data get corrupted ???

Vittal

0 Likes
2 Replies
BiBi_1928986
Valued Contributor

Hello.

Be aware that CyDelay() is implemented as a blocking function.  That means, nothing else runs when CyDelay() is running.  If you have used the polling method to read UART, you can lose receive data when CyDelay() runs.

0 Likes
Len_CONSULTRON
Honored Contributor II

Vittal,

I don't know your specific application but remember that BLE is wireless.  This means that the 'air', which is the 'wire' for BLE, is very subject to interference from the universe.  Use you are using a BLE connection I would recommend an end-to-end messaging type that makes sure the transmission of each character is received before sending the next character.

This erratic behavior may be because characters are being missed due to interference in the environment or the signa l is too weak (transmitter too far away).

Len
"Engineering is an Art. The Art of Compromise."
0 Likes