Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
ewm00
PostPosted: Dec 01, 2006 - 01:07 PM
Newbie


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
 
 View user's profile Send private message  
Reply with quote Back to top
dksmall
PostPosted: Dec 01, 2006 - 03:24 PM
Raving lunatic


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"?
 
 View user's profile Send private message  
Reply with quote Back to top
bobgardner
PostPosted: Dec 01, 2006 - 03:28 PM
10k+ Postman


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
 
 View user's profile Send private message Send e-mail Visit poster's website 
Reply with quote Back to top
ewm00
PostPosted: Dec 01, 2006 - 05:36 PM
Newbie


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.
 
 View user's profile Send private message  
Reply with quote Back to top
Jepael
PostPosted: Dec 01, 2006 - 11:11 PM
Raving lunatic


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
 
 View user's profile Send private message  
Reply with quote Back to top
bugmenott
PostPosted: Apr 28, 2010 - 03:58 PM
Hangaround


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
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits