| Author |
Message |
|
|
Posted: Dec 01, 2006 - 01:07 PM |
|

Joined: Nov 28, 2006
Posts: 7
|
|
Hello Everyone,
I am very new to microcontrollers, so please excuse my ignorance in this subject.
I am trying to make an ATMEGA32 microcontroller communicate with an RF Reader through the serial port by sending a series of bytes recognized by the reader.
I am using an ATMEGA32 microcontroller - with a MAX232 chip converting from TTL signal to RS232 compatible signals. I am supplying the MAX232 chip with Transmit, Receive, +5, and GND lines.
However, the Reader (DCE device) requires CTS/RTS handshaking to accept the series of bytes incoming on its serial port. Therefore, I also need RTS and CTS pins from the microcontroller side.
Is there a way to simulate these pins in hardware or software? Or is there another RS232 compatible chip that offers RTS/CTS lines?
I was told that I could manually drive RTS and listen for CTS in my code when sending/receiving data. However, I don’t know how to do that.
Any help is really appreciated!
Thanks,
Elie Mouchrik |
|
|
| |
|
|
|
|
|
Posted: Dec 01, 2006 - 03:24 PM |
|


Joined: Apr 16, 2001
Posts: 3522
Location: Phoenix, Arizona
|
|
| That last line is pretty much your answer, you code need to control RTS and monitor CTS. Have you googled on things like "hardware handshaking" or "RTS/CTS"? |
|
|
| |
|
|
|
|
|
Posted: Dec 01, 2006 - 03:28 PM |
|


Joined: Sep 04, 2002
Posts: 21272
Location: Orlando Florida
|
|
| You also need to know which device is the 'Data Communication Equipment' and which is the 'Data Terminal Equipment' because the Ready To Send and Clear To Send have meaning for only one side of the equipment... so keep a lookout for DCE and DTE when reading about RTS and DTS |
|
|
| |
|
|
|
|
|
Posted: Dec 01, 2006 - 05:36 PM |
|

Joined: Nov 28, 2006
Posts: 7
|
|
Hey guys,
Thank you for your fast replies.
So should I connect two of the pins of the ATMega’s port(s) to the second receive & transmit lines of the MAX232 chip – and then raise and lower the bits on these pins to toggle RTS/CTS ?
Thanks again. |
|
|
| |
|
|
|
|
|
Posted: Dec 01, 2006 - 11:11 PM |
|

Joined: May 24, 2004
Posts: 6002
Location: Tampere, Finland
|
|
Yes, that's about it. But you need to know which device is DTE (terminal) and which is DCE (communication equipment).
I never remember how the handshake lines went, but I suspect PC or AVR sends the RTS to your reader, and CTS line comes from reader to indicate clear to send.
- Jani |
|
|
| |
|
|
|
|
|
Posted: Apr 28, 2010 - 03:58 PM |
|

Joined: Dec 31, 2006
Posts: 168
|
|
Simple solution,
just short the cts and rts pin of the device requiring flow control [as a stop gap solution, which is working for me for a long time now.]
www.jigarsavla.com |
|
|
| |
|
|
|
|
|