CTI on LPC55S06 for Modbus

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CTI on LPC55S06 for Modbus

557 Views
smitz96
Junior Contributor III

Hi NXP Community,

I am implementing a Modbus RTU Slave on the LPC55S06. According to the Modbus specification, I need to detect a 3.5 character silent interval to signal the End of Frame (EOF).

I want to avoid generating an interrupt for every received byte to reset a software timer, as this is too CPU-intensive at high baud rates. I noticed the Flexcomm USART on this device does not have a dedicated "Character Timeout Interrupt" (CTI) that can be set to a specific character-width threshold (like 3.5).

  1. Is there a hidden hardware feature in the Flexcomm USART or FIFO to trigger an interrupt after a programmable period of RX inactivity?

  2. If not, what is the recommended "low-overhead" way to use DMA + CTIMER to detect the 3.5 char gap?

Any example code or application notes for the LPC55xx family regarding this would be greatly appreciated.

Labels (1)
0 Kudos
Reply
1 Reply

458 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @smitz96 

No — the Flexcomm USART on LPC55S06 does not contain any hardware "character timeout" or programmable RX‑idle interrupt.

I think you can use USART + DMA + CTIMER  for RX‑idle detection.

USART RX DMA continuously moves data from FIFO into a circular buffer.

CTIMER  generates interrupt when no data arrives.

You configure a timer for 3.5 character times.
On every RX DMA event, you restart the CTIMER
If timer expires, it means:
No bytes for 3.5 chars   Modbus frame end detected (EOF).
 
BR
Harry
 
0 Kudos
Reply