cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 5, 3 & 1 MCU

New Contributor II

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
Reply
1 Solution
Moderator
Moderator

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
Reply
3 Replies
Moderator
Moderator

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
Reply
New Contributor II

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
Reply
New Contributor II

Solved using SPI !! thanks

0 Likes
Reply