psoc 4 uart serial read write

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

cross mob
Anonymous
Not applicable

How to serial print string via bluetooth device, there is only uart putchar option.

   

condition-

   

I am transmitting a word to bluetooth device via uart.

   

Synchronously I would like to receive a continuous string[size n]  from the bluetooth device without any break from transmission data. 

   

 

   

For eg. I transmit "hello" from psoc over uart

   

and would like to receive any string eg. "Apple"

   

what i get : helloAhellophellophellolhelloe..

0 Likes
1 Solution
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received
        Please send you project code so we can determine what is wrong with your code.   

View solution in original post

0 Likes
3 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received
        Please send you project code so we can determine what is wrong with your code.   
0 Likes
Anonymous
Not applicable

simple uart tranmit receive using psco 4 protype kit, trogh pins 7.0 for  rx and 7.1 for tx. I receive data "HELLO" in my bluetooth device(HC05) terminal however receive data not showing up on serial window connected to com port of psoc.

   

#include <project.h>
#include "string.h"
int main()
{
    CyGlobalIntEnable; /* Enable global interrupts. */
    UART_Start();
    char8 rxData;
    //int i;
    //Tx_Start();
    /* Place your initialization/startup code here (e.g. MyInst_Start()) */

   

    for(;;)
    {
       UART_UartPutString("HELLO");
        //Tx_PutString("H");
       CyDelay(1000);

   

    rxData = UART_UartGetChar();
   if (rxData){
    UART_UartPutChar(rxData);}
CyDelay(1000);
        /* Place your application code here. */
    }
}

   

/* [] END OF FILE */

0 Likes
JobinT_31
Employee
Employee
50 solutions authored 25 solutions authored 10 solutions authored

It seems like you are sending the HELLO in a for loop.

   

You are only waiting to get a single char, not the complete string.

   

Either you can have a counter to wait until all the char is received or to check for a special character as end of string.

   

Thanks

   

JOBIN GT