OT - Bluetooth serial comms issues


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Oct 2009
    Posts
    583

    Default OT - Bluetooth serial comms issues

    hi,

    Not really related to PBpro, but I wondered if someone might be able to offer some further suggestions to an issue I'm having problems with and can't get my head round as to whats happening.

    I use an HC-05 module that was purchased last year in an existing project and it works fine. It is interfaced directly to the PIC's (18F4680) TX/RX pins and even though the device is rated at 3.3v logic for the TX/RX lines, and the PIC outputs at 5v logic it talsk as expected. I've been working on another project and have purchased a couple more of these BT modules, but I can't get them to communicate with the PIC.

    In development on the breadboard I use a small USB/Serial board which uses an FTDI chipset which runs at 5v logic. Using a PC application I can communicate between the PC and the PIC without any problems. The protocol is simple, the Application (or serial terminal applications for that matter) sends a capital Q to the PIC, which then streams out all the values in one long steam of bytes. When updating, the PC application sends a capital S and then the new values in the same set of bytes. The coms routine is simply
    Code:
    FOR TempWD = 0 TO 500
        IF RCIF=1 THEN GOSUB coms                   ; Check to see if PC application connected
        PAUSE 1
    next TempWD
    and then

    Code:
    coms:
    
    HSERIN [nTest]
        SELECT CASE nTest
        CASE "Q"                    ; if Q then send data to PC
        Goto Term_TX 
        CASE "S"                    ; if S then receive data from PC
        goto Term_RX
    return
    Crude but it works and makes things simple at both ends.

    Now having set the HC-05 to the same settings as the FTDI board (baud, stop bit etc) I connected to the PIC and powered up. Didn't get anything back from the PC application, nor when using a serial monitor application. So I added an bi-directional logic level shift board and got the logic analyser out. Some tests were sporadic, but 90% of the time I got some form of results. With four of the 8 inputs connected I scanned the 3.3v TX and RX lines, and the 5v TX and RX lines either side of the shift board, and was pleased to see that with a direct loop back (on the 5v TX/RX side) the traces on both sides were all the same. So I connected this to the PIC and sent a Q... but got no response ! I checked all the settings, they emulated the FTDI com port settings exactly.

    So this generation of HC-05 modules don't like 5v logic, and running it via a logic shift chip (TXB0108) fails for some reason. The only difference between the old and new modules is that when the port is connected and open, the LED flashes twice every couple of seconds on the new one where as the old module the LED lights solidly, so maybe there has been a change of firmware / chipset or something that added t the mix compounds things.

    I've attached an image with the trace of it working with the FTDI chipset based converter, and the loop back after the TXB board (where the TX and RX lines are shorted together so it echo's back what was sent). Any ideas - I've tried two boards (from same supplier) and really would like to add BT comms to this (and future) projects.


  2. #2
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: OT - Bluetooth serial comms issues

    I've just scoped the output from the logic shifter, seems the signals are swinging from 5v to 3.3v rather than 5v to 0v


  3. #3
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: OT - Bluetooth serial comms issues

    Seems the logic level shifter is the cause. Using simple voltage dividers on both RX and TX lines it worked fne


  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: OT - Bluetooth serial comms issues

    Are you VCCA and VCCB are connected to the correct voltages? Also are you sure you have the correct logic level inputs/outputs connected to the correct level shift pins?
    Dave Purola,
    N8NTA
    EN82fn

  5. #5
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: OT - Bluetooth serial comms issues

    Hi Dave,

    Yes, 3.3v and 5v sides are correct voltages, and I tried all the pins A1-B1, A2-B2 etc

Similar Threads

  1. OT - (slightly) - Bluetooth issues
    By Scampy in forum Off Topic
    Replies: 3
    Last Post: - 26th June 2015, 20:43
  2. 12F683 Serial Comms
    By ross246 in forum Serial
    Replies: 7
    Last Post: - 17th November 2010, 16:38
  3. PC Serial comms
    By Bill Legge in forum Serial
    Replies: 7
    Last Post: - 13th December 2009, 23:37
  4. PIC12F675 comms issues
    By Peter1960 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 25th March 2007, 04:24
  5. Serial comms / Bootloader
    By koossa in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 30th October 2005, 18:48

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts