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

PSoC™ 4

vica_4467471
Level 1
First question asked Welcome!
Level 1

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
250 replies posted 250 sign-ins 100 solutions authored
Level 7

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
1000 replies posted 750 replies posted 500 likes received
Level 9

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