2016-04-18 04:55 AM
Folks,
I have a complicated set-up where I am receiving serial data via an RS485 transceiver. The USART Rx reads three bytes, looks at those three bytes and works out how many more bytes will be in the remainder of the frame, resets the DMA count to the appropriate figure and eventually receives a full packet. This works fine and I can get multiple frames received just fine. However, sometimes the micro has to turn the line round and send a message out. That works fine, the scope shows everything working perfectly, including a GPIO going high to show when it is receiving the start of the frame and going low at the end of the frame. However, once the return frame has been sent, the next two incoming frames are ignored completely by the Rx DMA. What is really bizarre though, is when I set another set of incoming frames coming in to the micro, the Rx DMA starts working again. I must stress that I am not interfering any way with the system other than having a short gap between bursts of packets. I've inserted a picture of the scope showing: Green: Transmit Serial Data Yellow: Receive Serial Data Blue: Debug line - goes high at the start of a receive frame and low at the end Red: RS485 Direction line. Goes high for the duration of the outgoing frame (if I zoom in it looks perfect). If I stop the debugger and look at the registers at the end of this sequence, the Rx DMA counter register is at three still, so it's clearly not receiving any data into the DMA for some reason. I know this is a long shot, but can anyone think of any reason why if I resent a series of frames in a second or two later, I get exactly the same result? Many thanks!