This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP430F6638: Communicating with HC-05 Bluetooth Module over UART

Part Number: MSP430F6638
Other Parts Discussed in Thread: MSP430G2553

Tool/software: Code Composer Studio

Hello,

We are actually working on a project and we need to send some data wirelessly to a mobile app thanks to the HC-05 bluetooth module. However we want to interface the HC-05 with a MSP430 microcontroller. We know that this is probably not the correct forum to post our question, but we did a lot of research and didn't find answers to our questions. 

So we need the microcontroller to send by uart some data to the HC-05 and then the HC-05 to send these data wirelessly. But first the HC-05 module should be configured. Thus, we have noticed in several forums and sites that we have to configure the HC-05 using AT commands. However as I said we're using MSP430 mcu with "C" language and to configure the HC-05 we have to do it with AT commands, so this is where we're lost because we don't know if it's suitable (since the HC-05 is usually interfaced with arduino) and we don't know how and who should send these AT commands, in order to configure features like beaudRate, setting master/salve mode, etc... for the HC-05. I mean do we have to use the mcu IDE (CCS studio) to send  these commands or another interface ... and it is possible to do it in C language ... ? I mean we found out on the net that it's possible to interface the HC-05 with MSP430 but it was not a MSP430 alone, the HC-05 was interfaced with a whole board (launchpad), but we want to know if it's possbile to configure this HC-05 module with only the MSP430F6638 by uart and which IDE to use in order to send the AT commands. Please any help would be appriciated. I guess it's not something that difficult but since we've never used bluetooth modules it's quite difficult for the moment.

Thank you.

Mike

  • Hello Mike,

    Thanks for your detailed post.

    Mike Jaber said:
    I mean we found out on the net that it's possible to interface the HC-05 with MSP430 but it was not a MSP430 alone, the HC-05 was interfaced with a whole board (launchpad), but we want to know if it's possbile to configure this HC-05 module with only the MSP430F6638 by uart and which IDE to use in order to send the AT commands.

    Using the LaunchPad is beneficial because there are easy-to-connect headers that allow jumper wires to very easily connect to your HC-05 module. The LaunchPad also helps take care of all the recommended circuitry for the device such as the JTAG reset circuit and the capacitors on VCC, VCORE, etc. It's a good platform for you to start developing.

    I searched online and found several of those references you mentioned. Those are good starting points even if they use a different device such as the MSP430G2553. I would recommend starting with a UART code example for the MSP430F6638 and then configure the C code in CCS to match how the code works in those other online references. For UART, it's fairly straight forward. Make the right connections RX > TX and TX > RX, set the baud rate correctly, then understand the protocol required for the HC-05 and send the correct commands.

    Here's the link to the code examples.

    Here's a related thread where Britta points to a helpful UART document.

    MSP430G2553: SEND AT COMMANDS WITH MSP430 TO CONFIGURE HC-05 BLUETOOTH MODULE

    Regards,

    James

  • Hi James,

    Thank you for you response.

    "Using the LaunchPad is beneficial because there are easy-to-connect headers that allow jumper wires to very easily connect to your HC-05 module. The LaunchPad also helps take care of all the recommended circuitry for the device such as the JTAG reset circuit and the capacitors on VCC, VCORE, etc. It's a good platform for you to start developing."

    I mean the point is that we have designed our circuit and project based on the MSP430F6638, that's why in our opinion the launchpad recommendation could not be a solution for us. 

    "I searched online and found several of those references you mentioned. Those are good starting points even if they use a different device such as the MSP430G2553. I would recommend starting with a UART code example for the MSP430F6638 and then configure the C code in CCS to match how the code works in those other online references. For UART, it's fairly straight forward. Make the right connections RX > TX and TX > RX, set the baud rate correctly, then understand the protocol required for the HC-05 and send the correct commands."

    Exactely, as you said UART configuration doesn't seem to be that difficult. Our problem is more between the MSP430F6638 and the HC-05. I mean if it's possible to use the HC-05 with the launchpad which contains a MSP430 MCU, there is no reason why it wouldn't work with an isolated MSP430F6638 without the whole launchpad, right ? Because at the end these AT commands remains data that are sent by UART, their only particularity is that it's "char" data.

    PS : Should I move to the "MSP430G2553: SEND AT COMMANDS WITH MSP430 TO CONFIGURE HC-05 BLUETOOTH MODULE" post for the next questions or it is ok to stay here ? 

    Thank you very much.

    Regards,

    Mike

  • Does your HC-05 operate at 5V or 3.3V? If the latter, you can wire the TX/RX pins directly to your MSP430F6.

    The Launchpad is a convenience, but if you already have a board that's fine.

    If your Arduino code is properly encapsulated, you may be able to use that directly, give or take a few support functions.


  • Hi,

    Thank you for your answer.

    "Does your HC-05 operate at 5V or 3.3V? If the latter, you can wire the TX/RX pins directly to your MSP430F6."

    Yes it operates at 3.3 V. That's what we have done. 

    "If your Arduino code is properly encapsulated, you may be able to use that directly, give or take a few support functions."


    No this is the problem, we are not using arduino. We are using C code with the F6638. We already know that there is plenty of examples for interfacing and configuring HC-05 with arduino code, but now we want to know if it's possible to do it with a F6638 and C code.

    Thank you for your help.

    Mike

  • > we want to know if it's possible to do it with a F6638 and C code

    The short answer is Yes. Arduino uses a restricted C++ with a built-in library -- nothing you can't do in C.

    If you're starting from the beginning with your particular HC-05 variant, you'll have to supply the code. As far as I know TI doesn't have any examples that specific. I wouldn't be surprised if Google turned up some useful examples.

    AT commands are ASCII text you send to the modem, and it sends ASCII text back. Then there's a mechanism, either in-band ("ATsomething") or out-of-band (a GPIO pin), to switch to Data mode; after that everything you send goes over the air.

    There's one HC-05 variant I know of which requires no AT command setup at all -- it powers up in Data mode (using default settings).

  • I believe you are over-thinking this. If you have a serial port available, and know how to send ASCII to the serial port, you can control the HC-05.

    There is no reason to be talking to us, just get out there and do it! If you run into issues, we will be glad to help.

**Attention** This is a public forum