Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

PSoC™ 4 Forum Discussions

vica_4467471
Level 1
Level 1
First question asked Welcome!

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
Level 7
Level 7
500 replies posted 250 replies posted 250 sign-ins

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
Level 9
Level 9
500 solutions authored 1000 replies posted 750 replies posted

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