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.