Problem with Flag Output of UART RX Block
Posted: Wed Dec 14, 2011 10:23 pm
My Build Environment:
MATLAB R2011a
Block Set Version 3.5b
My Application:
I'm using the block set with a dsPIC33. I'm streaming ADC samples over UART1. You could call it a low speed oscilloscope. Each sample is encoded to a 5 character frame which is packed with a Vector Concatenate block and transmitted with the UART TX block. Because I'm sampling in the neighborhood of 100Hz, the TX block gets executed very frequently. The baud rate is set to 115200 and the simulation step size is set to 500us.
The application is also designed to receive commands which is accomplished with a UART RX block. I use the Flag output to indicate that a new character has been received and needs to be processed.
My Problem:
The encoded samples are being transmitted without issue over UART1. However, I'm having trouble getting UART1 to receive data reliably once the UART TX block starts being executed frequently. I've tied the Flag output from the UART RX block to a digital output and sampled it with an oscilloscope. When the UART TX block is being executed frequently, the Flag output doesn't go high. I've tried using and not using RX and TX interrupts. However, the problem persists whether or not interrupts are used. Are there any known caveats with executing the UART TX block frequently, or am I simply doing something wrong?
I'd be enormously grateful for any help the community could render and will gladly contribute back in the near future!
MATLAB R2011a
Block Set Version 3.5b
My Application:
I'm using the block set with a dsPIC33. I'm streaming ADC samples over UART1. You could call it a low speed oscilloscope. Each sample is encoded to a 5 character frame which is packed with a Vector Concatenate block and transmitted with the UART TX block. Because I'm sampling in the neighborhood of 100Hz, the TX block gets executed very frequently. The baud rate is set to 115200 and the simulation step size is set to 500us.
The application is also designed to receive commands which is accomplished with a UART RX block. I use the Flag output to indicate that a new character has been received and needs to be processed.
My Problem:
The encoded samples are being transmitted without issue over UART1. However, I'm having trouble getting UART1 to receive data reliably once the UART TX block starts being executed frequently. I've tied the Flag output from the UART RX block to a digital output and sampled it with an oscilloscope. When the UART TX block is being executed frequently, the Flag output doesn't go high. I've tried using and not using RX and TX interrupts. However, the problem persists whether or not interrupts are used. Are there any known caveats with executing the UART TX block frequently, or am I simply doing something wrong?
I'd be enormously grateful for any help the community could render and will gladly contribute back in the near future!