Bob Smith

9S08AW32 SCI using interrupts - how to use hardware CTS/RTS

Discussion created by Bob Smith on Feb 28, 2008
Latest reply on Feb 28, 2008 by Jim Donelson
I have a 9S08AW32 using the SCI to read commands and write text messages out to a terminal window (Hyperterminal in Windoze).

I needed to add a function to transfer a approx 1Mb file from the PC side to an external SPI flash on the uC (speed is not a big concern).

I thought this would be easy, I'll just use CTS/RTS handshaking, enable interrupts and set up a 256 Byte buffer that stops the transfer when full (to write out to the SPI flash).

Everything but the handshaking is working.  I have a female DB9 on my board that connects to the PC via a serial to USB converter.  I'm using CTS (pin 8 on the DB9) to control the flow from the PC (I don't send any data back during the transfer, so I'm not using RTS). When my buffer is almost full, I raise the CTS pin, wait to see if any additional SCI data is in transit and then go into my SPI routines.Handshaking is enabled in hyperterminal, but the data does not stop coming.

It appears to work with a few bytes, but when I try an amount of data that requires me to pause the flow, it doesn't seem to work.

Any suggestions or examples??