We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all, Can anyone of you give me an idea as to how to perform flow control on the serial port. In other words which registers of the UART control the CTS-RTS business. Regards, Vipin
There are no control pins for CTS, RTS, DTR, etc. in the 8051/251 devices. To support this, you must use I/O pins on the device. You can then program them to support any hardware you want.
Well, does it mean that, lets say if I have Port 1 being governed by an internal UART then, I have to set/reset the CTS-RTS specific pins directly on the port P1. If yes, then can you please elaborate somewhat more on how do I achieve this. regards, Vipin
Yes. You must write a sendByte() and recvByte() function and in sendByte() look at the pin on Port 1 you will use as CTS. When CTS is asserted, send the byte, if not return failure or block until CTS is asserted. In recvByte() look at you input ring buffer that you have created and manage and see if it is close to full (you must decide on the threshold). If it is, then assert the Port 1 pin you have designated to operate as RTS, wait wouldn't this be CTS from the 8051's perspective? I'm all confused now. Anyway, in the two functions mentioned above, check for one of the signals from the other device before sending and assert your 8051's signal and assert it if your ring buffer is uncomfortably full. Sorry for the poor quality of this response, it's Sunday. - Mark