Hi there,
I am new to the NXP / freescale SDK eco system and I am having some difficulties implementing a serial communication protocol on LPC5512 using USART and DMA.
From I understood so far (maybe I am wrong), when using DMA one must know in advance the size in bytes of the next Rx transfer. This is a problem while implementing the new communication protocol, because its individual messages have variable length, and since one cannot guess which message will be transmitted next the DMA Rx transfer size cannot be set. Is my understanding correct? (If not what am I missing?)
To work around this, I am currently using 1 byte long Rx transfers and, although it works, it seems to be a terribly inefficient implementation to have one interrupt per byte received.
After some research I've read about some solutions like:
1 Triggering an interrupt when the physical Rx line goes idle for some time after an Rx begins
2 Triggering an interrupt when a specific byte pattern is received
This specific communication protocol messages allows for timeouts between messages and the messages have specific header and trailer markers which could be used to detect the message boundaries. So both solutions could be adopted. However, these solutions were adopted for STM32 MCUs. From all the documentation and SDK src code reading so far, I am not sure such interrupt mechanisms are available in the LPC5512 MCU. Are they?
Is it there a way to implement this king of behavior for the LPC5512 using DMA transfers? I've look into the SDK for some similar examples but I could not find any. If it is indeed possible could someone provide an example?
It would be much appreciated!
Kind regards,
Bruno.