Jump to content
43oh

Send AT Commands with MSP430 and Hm-11


Recommended Posts

Hello,

 

So I'm currently trying to setup and interface with an HM-11 Bluetooth Module and i currently cant receive any response from the module. I basically just want pass data between two of these modules using these two with one set as a master and another as a slave. Unfortunately I cannot even send AT commands and receive responses confirming that the setup is correct.

Link to post
Share on other sites

Hi there,

 

Sorry about that, total noob here.

 

1. I am using the MSP430g2553

2. I have the RX(MSP430) to the TX of the HM-11 and vice versa

3. My current Energia version is 0101E0016

 

Here is a sample of my code

#include <SoftwareSerial.h>

SoftwareSerial mySerial(P1_1, P1_2); // RX, TX

void setup()  
{
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
   ; // wait for serial port to connect. Needed for Leonardo only
   }


  Serial.println("Hello world!");
  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  // set master
}

void loop() { // run over and over
    // set the data rate for the SoftwareSerial port
  mySerial.print("test I am master  ");
  if (mySerial.available()) {
    Serial.write(mySerial.read());
  }
  if (Serial.available()) {
    mySerial.write(Serial.read());
    Serial.println(Serial.read());
  }
}

Here's a link to the AT commands

https://www.seeedstudio.com/wiki/images/c/cd/Bluetooth4_en.pdf

 

Heres a photo of the response I'm getting from AT

 

https://imgur.com/yRmcqFH

 

My baud is set to 9600 and I'm on COM3

 

My ultimate goal is to connect two hm-11s using two msp430g2553s and have them communicating and seeing the communication between the two via realterm, putty etc.

Link to post
Share on other sites

If you are using the G2 v1.5 Launchpad, have you rotated the RX and TX jumper 90 degrees? Also, I see that you are assigning software serial to the hardware serial port pins on the G2 Launchpad. Please see the example program for software serial in your Energia folder at:  ....\energia-0101E0016\hardware\msp430\libraries\SoftwareSerial\examples\SoftwareSerialExample. The example assigns pins 1.4 and 1.3 for the software serial port.  If you can you may also want to try some of the other Launchpad models that have two or more hardware serial ports (e.g. MSP430F5529, Tiva Launchpad or MSP432 Launchpad).

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...