Jump to content
43oh

alphanumeric35

Members
  • Content Count

    3
  • Joined

  • Last visited

Posts posted by alphanumeric35

  1. On 12/3/2020 at 9:25 PM, energia said:

    Which MSP430 are you using? I recently tested it on an MSP430F5529 and that worked.

    One thing to note though is that pins 3 and 4 are already used by Hardware Serial which you use in your Sketch (Serial.xyz()).

    Try changing to different pins. I would suggest you try pins 11 and 12 if you are not using those for anything else.

    Robert

     

    On 12/4/2020 at 7:52 PM, StefanSch said:

    G2553 has a Hardware Serial Interface,  so do not use the Software implementation. 

    Serial BTSerial.....

    Should work

     

    Thanks for the  replies,  i changed the pins, flipped some wires and it almost works! :) The code looks like this now;

     

    #include <SoftwareSerial.h>

    SoftwareSerial BTSerial(11, 12); 

    void setup() 
    {
      pinMode(10, OUTPUT);  // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
      digitalWrite(10, HIGH); 
      Serial.begin(9600);
      Serial.write("Enter AT commands:");
      BTSerial.begin(38400);  // HC-05 default speed in AT command more
    }

    void loop()
    {

      // Keep reading from HC-05 and send to Arduino Serial Monitor
      if (BTSerial.available()){
        Serial.write(BTSerial.read());
      }
      // Keep reading from Arduino Serial Monitor and send to HC-05
      if (Serial.available()){
        BTSerial.write(Serial.read());
      }
    }

    When i send "AT", it returns some weird answer. You can see it in the image. What should i do to fix it?

    Ekran Alıntısı.PNG

  2. Hi, i'm trying to run AT commands on HC-05 connected to MSP430G2553. The code below works on Arduino but i need to do it with MSP430. I changed the pins to match the MSP, tried to run the code but i see nothing on serial monitor. Total noob here and needs help. :)

    #include <SoftwareSerial.h>

    SoftwareSerial BTSerial(3, 4); 

    void setup() 
    {
      pinMode(9, OUTPUT);  // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
      digitalWrite(9, HIGH); 
      Serial.begin(9600);
      Serial.write("Enter AT commands:");
      BTSerial.begin(38400);  // HC-05 default speed in AT command more
    }

    void loop()
    {

      // Keep reading from HC-05 and send to Arduino Serial Monitor
      if (BTSerial.available())
        Serial.write(BTSerial.read());

      // Keep reading from Arduino Serial Monitor and send to HC-05
      if (Serial.available())
        BTSerial.write(Serial.read());

    }

×
×
  • Create New...