- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you using a Cypress Kit? Which one?? CY8CKIT-0xx ???
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Thank you for your feedback.
I use CY8C4248LQI-BL583 which corresponds to CY8CKIT-143A PSoC 4 BLE 256KB MODULE.
Marlene
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 */
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content