Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

RN42 Bluetooth + PIC 18F - hardware flow control RTS / CTS

Status
Not open for further replies.

atferrari

Well-Known Member
Most Helpful Member
I intend to control an RN42 Bluetooth module with a 18F PIC micro expecting to receive big chunks of data from the RN42 / send big chunks of data to the RN42

Regarding the RTS / CTS signals, please tell if I got this right whether the module is in "command" or "data" mode.

Micro's RTS pin to be a permanent output going into the RN's CTS input.
Micro's CTS pin to be a permanent input receiving the RN's RTS output.

If the micro needs to process the data received up to now, has to output a high on its RTS pin so the RN stops.
If the micro can receive data, has to output a low on its RTS pin so the RN can resume transmision.

When the micro wants to transmit has to check if it gets a low on its own CTS pin.
If the micro reads a high in it own CTS pin, cannot transmit and keep checking until it gets a low to start again.

Am I right?
 
Last edited:
Request to Send/Clear to send.
I have not used the RN42 but have used the USART CTS/RTS and the relative transmission ends are the a RTS (out) goes to CTS (in) on each respective units.
IOW one is a request command output, the other a status as to readyness to recieve.
If a request to send is sent, the output takes place if the recieving module is ready (CTS), if the reciever's buffer becomes full or data requires processing, then a CTS is sent back to hold up transmission until more data can be recieved.
Not sure if that answers the question?
Max.
 
Request to Send/Clear to send.
I have not used the RN42 but have used the USART CTS/RTS and the relative transmission ends are the a RTS (out) goes to CTS (in) on each respective units.

Yes, the datasheet mentions them as you say. That is clear now.

If a request to send is sent, the output takes place if the recieving module is ready (CTS), if the reciever's buffer becomes full or data requires processing, then a CTS is sent back to hold up transmission until more data can be recieved.
Not sure if that answers the question?
Max.

Sorry Max, I cannot follow you here. The micro can set/clear its own RTS and read its own CTS. As I posted, I understand that the only thing it can do is set/clear its own RTS, but not sure.
 
... then a CTS is sent back to hold up transmission until more data can be recieved.

Should have read RTS not CTS.
CTS is purely an input from the remote stn.
Max.
 
Hola Max again.

The answer to my questions seems to be right there in the datasheet.

Excerpt from datasheet.png


Thanks for replying.

BTW, three days ago I bought two 18F23K22.
 
Nice, I am just about to try using one for the inverted pendulum app AN964, so far I have not used a PID loop on a Pic.
Max.
 
Status
Not open for further replies.

Latest threads

Back
Top