Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC CTS and RTS implementation question

Status
Not open for further replies.

glenjoy

Banned
Joined
Jan 1, 2004
Messages
962
Helped
72
Reputation
146
Reaction score
20
Trophy points
1,298
Location
Philippines
Activity points
0
rts cts pic rs232

Hi,

I am currenty making an RS232 communication, the problem is that CTS and RTS is required for handshaking, has anybody tried this using CCS C?

Thanks.
 

pic rts cts

In any MICROCONTROLER the UART only handles TXD and RDX lines
The CTS,RTS ,and other lines you have to control them by assign them to GPIO and set those lines with firmware according to your needs
All this is very simple ..
Usually an interrupt receives a character .,.then the vector routine reads it and if some more handling of this is required well set CTS = 0 to indicate not to send more characters till you're done processing the one just received .The way you decide to implement the RS232 protocol depends of the speed and how the DTE ( the host )equipment is set
This is very simple just get some information on how RS232 protocol is supposed to work ..though nobody respects it .

DTR -> DSR the "R"s -- this is just to detect the equipment is connected this is not needed most of the times just hardwire it
RTS -> CTS the "S"s -- just implement this to control the comunication flow ..

if DTR is needed just feed it with CTS
TX -> RX
 
rts/cts handshaking in pic

yaiks, I am more confused, do you have any notes about this implementation on PIC and C, because my clients bluetooth dongle requires these.
 

pic18 cts

glenjoy said:
yaiks, I am more confused, do you have any notes about this implementation on PIC and C, because my clients bluetooth dongle requires these.

glenjoy,

are you absolutely sure you that you really need to take care for the handshake lines?

I am asking this because I have done many projects involving serial communication and all that was required is to "short circuit" the handshake lines on the equipment side so that the equipment "thinks" that everything is OK as eltonjohn explained. I have never contolled and checked the handshake lines in my projects until today.

Look here for some additional info:
http://www.airborn.com.au/rs232.html
**broken link removed**
http://www.windmill.co.uk/monitor74.html

best regards
 

pic rs232 rts

Hi,

Is this the one on what you mean shorting out?

rs232a.gif


Thanks.
 

rts cts handshaking pic ccs c

glenjoy said:
Hi,

Is this the one on what you mean shorting out?

rs232a.gif


Thanks.

Yes but in my projects I never connected Pin1 just 4->6 and 7->8 on a DB9 connector.
best regards
 
Last edited by a moderator:

    glenjoy

    Points: 2
    Helpful Answer Positive Rating
rts cts handshake with pic

Hi, the setup is, a bluetooth device is connected to the PC and abother bluetooth device is connected to the microcontroller, the problem is the microcontroller cannot receive the data from the PC. Only TX and RX is connected into the bluetooth and mcircontroller.

Now, where will I put the above schematic diagram? On the PC side or the microcntroller side? Thanks you.
 

pic32 rts cts

Is the Flow Control in Hyperterminal the one that controls the handshaking?

Here is the user manual of the bluetooth dongle. I think it is just okay to upload this here because this is unavailable into the manufacturer's website.
 

cts rts handshaking implementation

glenjoy said:
Hi, the setup is, a bluetooth device is connected to the PC and abother bluetooth device is connected to the microcontroller, the problem is the microcontroller cannot receive the data from the PC. Only TX and RX is connected into the bluetooth and mcircontroller.

Now, where will I put the above schematic diagram? On the PC side or the microcntroller side? Thanks you.

I will study your manual when I have a little spare time ...

You must connect above diagram on the microcontroller side.

And yes the Flow Control in Hyperterminal controls handshake.

Edit

OK I took a look at your manual in the meantime.

As far as I can see you dongle is powered from the RS232 lines so this might be a little problem ...

What kind of level converter do you use to interface your dongle to the microcontroller MAX232 or similiar??

If yes I would use one output of the MAX232 to drive RTS and DTR (connected together) and connect the driving input of the MAX232 to GND so that RTS and DTR of the bluetooth dongle have a level of 8 ... 12 V.

Your connector should be configured as if it was a PC see the DTE picture here:
https://www.sprut.de/electronic/interfaces/rs232/rs232kabel2.gif

This should power the dongle and if I am correct should get you going.

best regards
 

implementing rs232 protocol rts cts on pic

The bluetooth dongle has an external power, it has a switch so you can choose if get power from the RS232 or get power external.

I am using MAX233 to avoid the capacitor hassles of the MAX232.
 

rts y cts con pic

The connected to my micrcontroller is the DTE dongle(male db9).
 

cts/rts microcontroller

glenjoy said:
The connected to my micrcontroller is the DTE dongle(male db9).

Ok then to get things started use external power (at first) and short circuit the handshake lines at the dongle which is connected to your microcontroller as described above.

good luck
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top