Hi All,
I thought that I had this all working a couple of days ago, but when I tried it out in anger I found that the basic Tx and Rx were operating Ok provided I did not use RTS/CTS handshaking. With the handshaking enabled the RTS output was not being driven and the CTS did not seem to be read.
After much stepping through the code with the debugger and some guesswork it seems that the way to resolve this is in “nagpio.h”
The original version of this had>>
#define GPIO_UARTA_RTS (-30) /* RTS for UARTA (ns9210/ns9215 errata fix) /
#define GPIO_UARTB_RTS (-31) / RTS for UARTB (ns9210/ns9215 errata fix) /
#define GPIO_UARTC_RTS (-32) / RTS for UARTC (ns9210/ns9215 errata fix) /
#define GPIO_UARTD_RTS (-33) / RTS for UARTD (ns9210/ns9215 errata fix) */
#define GPIO_UARTA_CTS (-34) /* RTS for UARTC /
#define GPIO_UARTB_CTS (-35) / RTS for UARTC /
#define GPIO_UARTC_CTS (-36) / RTS for UARTC /
#define GPIO_UARTD_CTS (-37) / RTS for UARTC */
I revised the port C entries to directly point to the required GPIO lines as follows>>
#define GPIO_UARTA_RTS (-30) /* RTS for UARTA (ns9210/ns9215 errata fix) /
#define GPIO_UARTB_RTS (-31) / RTS for UARTB (ns9210/ns9215 errata fix) /
#define GPIO_UARTC_RTS (13) / RTS for UARTC (ns9210/ns9215 errata fix) /
#define GPIO_UARTD_RTS (-33) / RTS for UARTD (ns9210/ns9215 errata fix) */
#define GPIO_UARTA_CTS (-34) /* RTS for UARTC /
#define GPIO_UARTB_CTS (-35) / RTS for UARTC /
#define GPIO_UARTC_CTS (9) / RTS for UARTC /
#define GPIO_UARTD_CTS (-37) / RTS for UARTC */
Now it seems to work OK with the handshaking.
Overall this appears to be a bit of a bug in a function which is used to take the negative “symbolic constant” and find the required GPIO number.
Hope this helps anyone else who wants to use PortC
Roy