PSOC 5LP UART RX SPEED

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

cross mob
MaSi_3530151
Level 1
Level 1
5 sign-ins 5 questions asked First like received

Hello!! I am receiving data from another microcontroller through psoc 5 uart using the following code. The received data is sent to console.  It works but the conversion speed is too slow. It takes almost 1 second to get the data and send it to the console.

Is it possible to spped up this process?

thanks,

túlio

----------------------------------------------------------------------------------------------------------

#include "project.h"

#include <stdio.h>

uint8 rxData;

CY_ISR(isr_rx_handler){ 

        /* Read data from the RX data register */

        rxData = UART_RXDATA_REG; //ch = UART_GetChar();

        /* Send data backward */

        UART_TXDATA_REG = UART_GetByte();//rxData;

        //UART_PutChar(ch);

}

int main(void)

{

    isr_rx_StartEx(isr_rx_handler);

    CyGlobalIntEnable; /* Enable global interrupts. */

    UART_Start();

    UART_PutString("iniciando: \r\n");

    for(;;)

    {

    }

}

0 Likes
1 Solution
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello MaSi_3530151

What is the baud rate that you are using? The easiest way to speed up the communication is to increase the baud rate for both transmission from the other controller as well as to the console.

Apart from this, the current code is well optimized and further increase in speed cannot be achieved.

Would it be possible to switch from UART to a faster communication protocol for either the communication between controllers or to console? I2C and SPI provide much higher datarates compared to UART.

Thanks,

Hari

View solution in original post

0 Likes
3 Replies
Hari
Moderator
Moderator
Moderator
750 replies posted 500 replies posted 250 solutions authored

Hello MaSi_3530151

What is the baud rate that you are using? The easiest way to speed up the communication is to increase the baud rate for both transmission from the other controller as well as to the console.

Apart from this, the current code is well optimized and further increase in speed cannot be achieved.

Would it be possible to switch from UART to a faster communication protocol for either the communication between controllers or to console? I2C and SPI provide much higher datarates compared to UART.

Thanks,

Hari

0 Likes

Iim using 115200. 

the process of sending data through tx is very fast,

but when receiving (getchar) the process is slow. something must be wrong.

0 Likes

Solved using SPI !! thanks