This widget could not be displayed.
Anonymous
Not applicable
Jun 05, 2017
03:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 05, 2017
03:33 AM
I'm trying to detect a UART data that uses a mark/space as parity bit, I tried the following code but it doesn't seem to work for me. temp = UART_GetChar() if(temp != 0) { If(UART_ReadRxStatus() & UART_RX_STS_MARKSPS) { while(USB_CDCIsReady() == 0); USB_PutChar('M') } else { while(USB_CDCIsReady() == 0); USB_PutChar('S') } } The usb always returns an S regardless of the parity bit and the data that is being received. The data is being received correctly though I just can't detect whether the parity bit is high or low.
Labels
- Labels:
-
PSoC 5LP
7 Replies
Jun 05, 2017
04:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 05, 2017
04:35 AM
Did you already try UART_SpiUartReadRxData() API which returns a 32bit value. Datasheet says:
uint32: Next data element from the receive buffer.
The amount of data bits to be received depends on Data bits selection (the data bit counting starts from LSB of return value).
Bob
This widget could not be displayed.
Anonymous
Not applicable
Jun 06, 2017
03:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 06, 2017
03:01 AM
I figured out the problem, I can detect the parity bit but when increasing the buffer size of the UART block it all fails and I can't detect the parity bit anymore, why can't I detect it when the buffer size is higher than 4 and the internal interrupt is enabled? I still manage to get the rest of the data correctly though.
Jun 06, 2017
06:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 06, 2017
06:19 AM
The buffer only holds byte data, no extras, no status, no 9th bit. So you'll need your own interrupt handler (which is not too difficult) to implement a circular buffer algorithm.
Bob
This widget could not be displayed.
Anonymous
Not applicable
Jun 06, 2017
07:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 06, 2017
07:40 AM
Since the buffer doesn't hold any parity bits shouldn't I be able to detect the parity regardless of the buffer size?
Jun 06, 2017
10:16 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 06, 2017
10:16 AM
I don't see how to. Where to save that extra bit to?
Bob
This widget could not be displayed.
Anonymous
Not applicable
Jun 07, 2017
08:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 07, 2017
08:56 PM
All I need is to detect the parity bit and add it to the received data Basically detecting a 9 bit data but the parity seems to do me some problems
Jun 08, 2017
02:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 08, 2017
02:36 AM
As I already said: You need to do it yourself, a nine bit UART is something rare. Not too difficult.
Bob
This widget could not be displayed.