Connect with us

Bluetooth PIC connection

Discussion in 'Microcontrollers, Programming and IoT' started by ami85t, Mar 10, 2014.

Scroll to continue with content
  1. ami85t


    Feb 19, 2014
    I am sending data via UART from a pic to a Bluetooth device.
    the PIC is from the pic16f family and the BT is RN42SM.

    The default configuration for the Bluetooth module is:
    " When the module receives data, it strips the Bluetooth headers and trailers and passes the user data to the UART port. When data is written to the UART port, the module constructs the Bluetooth packet and sends it out over the Bluetooth wireless connection." (data sheet)

    because the BT is transmitting all the time I would
    want to stop the UART transmission when the data has been all transmitted.
    1. Can I do this by changing the UART RTS or CTS bit of the BT?
    is that the purpose of one of these bits in the first place?
    if not, do these bits need to be wired anywhere?

    2. Can that be done by changing somehow any of the IO bit? (see page 5 in BT data sheet attachment)
    what information can be sent to the PIC from the IO bits?

    Thanks, Amitai
  2. kpatz


    Feb 24, 2014
    When you stop passing data to the UART (by writing to TXREG on a PIC) it will stop transmitting data (after it finishes sending the last byte/word you gave it). When you start writing data to TXREG again, the UART will start sending the data again.

    Do you mean you want the BT module to stop transmitting? If you do that, your Bluetooth connection will be lost. There's probably commands you can send to the module to tell it to pair or unpair, or turn on/off the transmitter.

    RTS/CTS is used for flow control, for devices that can't handle large amounts of data at high speed. Think of it as a "hold up, I'm still processing the last piece of data you sent me!" message, then a "ok, I'm ready, continue" message.
  3. ami85t


    Feb 19, 2014
    Thanks for the quick reply,
    If the BT doesn't transmit when the UART finishes its transmit that's perfect.
    Do the RTS/CTS need to be wired anywhere ?
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day