Open benjaminjnoack opened 6 years ago
Use the digilent to simulate CTS
The XBee is actually using CTS. Ensure the settings in X-CTU are correct for flow control Use the Saleae to determine if the flow control signals are being respected by the usart peripheral.
From Digi docs:
If you send the D6 command to enable RTS flow control, the device does not send data in the serial transmit buffer out the DOUT pin as long as RTS is de-asserted (set high).
From LPC docs
If RTS is configured to appear on a device pin so that it can be sent to an external device, it indicates to an external device the ability of the receiver to receive more data.
It seems the RTS signals of both the XBee and the MCU should be linked, as opposed to crossed with CTS
The CTS line will be utilized by the TX task and will have an interrupt associated with it. The interrupt will be edge triggered. On the falling edge, a flag (?) will be set allowing the TX task to proceed with writes to the USART. On the rising edge the same flag will indicate that transmission is not currently possible. The TX task will block here waiting for the flag to clear.
The RTS line will be utilized by the RX task. It will be set low at the beginning of the task. When the RX task acquires the semaphore it will set the line high. Upon completing the read and posting the data (or printing it) the RX task will then set the line low and block again waiting for another reception.