UART transmission problem in example project SCB_UartComm loaded on CY8C4248LQI-BL583. Both RX ad TX transmit

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

cross mob
Anonymous
Not applicable

Hi everyone,

My problem is the following:

I d/l then example project SCB_UartComm  on CY8C4248LQI-BL583.

Both RX ad TX transmit, I wan the pin 1.4 to be configured as RX ...

I already checked on several different boards but this does not help there is also not short circuit between RX and TX.

Thank you for your feedback,

Regards,

Marlene

0 Likes
1 Solution

This cannot work as you want to. After placing the data into the Tx buffer you should wait for the data received. This usually is done by polling UART_SpiUartGetRxBufferSize() API. When the result is > 0 there are data in the receive buffer.

Datasheet for UART states clearly that reding when there are no data present has undefined results.

Bob

View solution in original post

0 Likes
16 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received

Do you mean that you want to use a different pin than what the example uses? Please post your code so we can check it by clicking on file and then create workspace bundle and attach it to a new comment.

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Are you using a Cypress Kit? Which one?? CY8CKIT-0xx ???

Bob

0 Likes
Anonymous
Not applicable

Hi, Thank you for your feedback.

I use CY8C4248LQI-BL583 which corresponds to CY8CKIT-143A PSoC 4 BLE 256KB MODULE.

Marlene

0 Likes

No chance, UART Rx is hard wired on board to P1(5) and Tx to P1(4). Internal PSoC restrictions do not allow for free choice of UART components pins.

Bob

0 Likes
Anonymous
Not applicable

Is it not the other way around?

Uart rx to P1(4)

Uart Tx to P1(5)

I did set the pinning as described above

Thanks

Marlene

0 Likes

Yes, You are right. I took the crossed over names from the schematic. Pins are connectes to the USB bridge. When you want your own pins you should use P0(4) as Rx  and P0(5) as Tx

Bob

0 Likes
Anonymous
Not applicable

Hi,

I actually do  not want to change the pinning. I am fine as it is with:

Uart rx to P1(4)

Uart rx to P1(5)

However without any changes to this example project the board transmits on the rx(I can see it on the scope)

0 Likes
Anonymous
Not applicable

Acc to your last feedback I made some change and

Uart rx to P0(4) instead of P1(4)

Uart rx to P0(5) instead of P1(5)

In this case the function UART_UartGetChar(); receives a single the value 2A whatever the input.

Regards,

Marlene

0 Likes
Anonymous
Not applicable

Acc to your last feedback I made following changes in the pinning

Uart rx to P0(4) instead of P1(4)

Uart rx to P0(5) instead of P1(5)

In this case the function UART_UartGetChar(); receives a single value "2A "whatever the input.

Regards,

Marlene

0 Likes
Anonymous
Not applicable

I must add that I had the same problem with all our CY8C4248LQI-BL583 boards as well as all CY8C4248LQI-BL483 but not for the boards 214009-00

0 Likes

Can you please post your complete project or a shortened version that shows the error so that we all can have a look at all of your settings. To do so, use

Creator->File->Create Workspace Bundle (minimal)

and attach the resulting file.

And please show external wiring (if any)

Bob

0 Likes
Anonymous
Not applicable

Acc to your last feedback I made following changes in the pinning

Uart rx to P0(4) instead of P1(4)

Uart rx to P0(5) instead of P1(5)

with those changes the function UART_UartGetChar(); receives a single value "2A "whatever the input.

I must add that I had the same problems with all our CY8C4248LQI-BL583 boards as well as all CY8C4248LQI-BL483 but the UART worked perfectly fine on the boards 214009-00

Regards,

Marlene

0 Likes
Anonymous
Not applicable

I attached the project:

When I connect rx P1(4)   to tx P1(5).ch_r gets the value FFFFFFFF at line 58.

Regards

Marlene

0 Likes

This cannot work as you want to. After placing the data into the Tx buffer you should wait for the data received. This usually is done by polling UART_SpiUartGetRxBufferSize() API. When the result is > 0 there are data in the receive buffer.

Datasheet for UART states clearly that reding when there are no data present has undefined results.

Bob

0 Likes
Anonymous
Not applicable

Hi,

I added the polling of UART_SpiUartGetRxBufferSize() API.

The size is always 0 ...

See below or the attached bundle

Regards,

Marlene

#include <project.h>

/*******************************************************************************

* Function Name: main

********************************************************************************

* Summary:

*  The main function performs the following actions:

*  1. Sets up UART component.

*  2. UART sends text header into the serial terminal.

*  3. UART waits for the characters to send them back to the serial terminal.

*

* Parameters:

*  None

*

* Return:

*  None

*

*******************************************************************************/

int main()

{

    uint32 ch_s = 0x00000000000000;

    uint32 ch_r = 0x00000000000000;

    /* Start SCB (UART mode) operation */

    UART_Start();

    for (;;)

    {

        /* Get received character or zero if nothing has been received yet */

        UART_SpiUartWriteTxData(++ch_s);

        while(ch_r!=ch_s){

            while(!UART_SpiUartGetRxBufferSize()) ;

            ch_r = UART_SpiUartReadRxData();}

    ch_r =0;

    

    }

}

/* [] END OF FILE */

0 Likes

Here is a program for your chip that does full duplex.  Also read the PDF in the file.

0 Likes