Sep 23, 2020
02:48 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 23, 2020
02:48 PM
The serial protocol we're using has a variable packet size. I don't know how many bytes to receive. So DAVE UART App is not too useful.
So I setup DAVE UART App to be set to direct, then setup interrupts manually.
If I setup FIFO trigger level to be 0 & don't change, it interrupts after each byte received and reception works fine.
My minimum packet size is 6 bytes. Max can be as high as 25.
I tried to set the trigger level to trigger at 6, then examine a byte in packet to determine how many more bytes are coming.
This didn't work so well, random read values.
So, it appears changing the trigger level via XMC_USIC_CH_RXFIFO_SetSizeTriggerLimit() inside an ISR is a problem.
Is there a way to safely change the trigger limit?
So I setup DAVE UART App to be set to direct, then setup interrupts manually.
If I setup FIFO trigger level to be 0 & don't change, it interrupts after each byte received and reception works fine.
My minimum packet size is 6 bytes. Max can be as high as 25.
I tried to set the trigger level to trigger at 6, then examine a byte in packet to determine how many more bytes are coming.
This didn't work so well, random read values.
So, it appears changing the trigger level via XMC_USIC_CH_RXFIFO_SetSizeTriggerLimit() inside an ISR is a problem.
Is there a way to safely change the trigger limit?
- Tags:
- IFX
2 Replies
Sep 29, 2020
09:14 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 29, 2020
09:14 AM
Hi,
Could you try with the following function?
Regards,
Jesus
Could you try with the following function?
__STATIC_INLINE void XMC_USIC_CH_RXFIFO_SetTriggerLimit(XMC_USIC_CH_t *const channel,
const uint32_t limit)
{
channel->RBCTR = (channel->RBCTR & (uint32_t)~USIC_CH_RBCTR_LIMIT_Msk) | ((limit << USIC_CH_RBCTR_LIMIT_Pos) & USIC_CH_RBCTR_LIMIT_Msk);
}
Regards,
Jesus
Oct 01, 2020
02:17 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 01, 2020
02:17 PM
I'll give that a try when I can.
What I was seeing was a string of serial bytes on the scope And the ISR read all the bytes,but one of the bytes was not what was in the serial stream.
Almost like if a byte was coming in & at that instance the trigger limit was changed, data byte was corrupted.
What I was seeing was a string of serial bytes on the scope And the ISR read all the bytes,but one of the bytes was not what was in the serial stream.
Almost like if a byte was coming in & at that instance the trigger limit was changed, data byte was corrupted.