Hello,
I’m currently working on a project involving Bluetooth communication using Sparkfun Bluesmirf Silver and MCU TI G2553 programmable via MSP430 Launchpad. Im programming the MCU using the Energia IDE. I am at the very beginning right now and I’m simply trying to program some basic properties of the Bluesmirf using the MCU firmware (name and PIN).
I have connected MCU’s hardware UART RX to Bluesmirf’s TX and vice versa. Vcc is the same for the MCU and Bluesmirf (Multimeter shows values at around 3.5V). I tried configuring the Bluesmirf using Freeduino UNO and Arduino IDE Serial Monitor. When inputting the commands manualy, it worked correctly (with Arduino, the Vcc was 5V). But when trying to configure the Bluesmirf using the firmware I wrote, it doesent work.
Here is the code I’m uploading:
int delayUART = 300;
int delayReset = 3000;
void setup()
{
Serial.begin(9600);
initBTModule();
delay(delayReset);
pinMode(RED_LED, OUTPUT);
}
void loop()
{
digitalWrite(RED_LED, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(RED_LED, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
// Sets up the Sparkfun Bluesmirf Silver Bluetooth module
void initBTModule()
{
delay(delayUART);
sendUART(“$$$\n”); // enter command mode
sendUART(“SN,Kanarek0000\n”); // set name of the device
sendUART(“SP,kanarek0000\n”); // set security PIN code
sendUART(“SU,96\n”); // set baud rate to 9600
sendUART(“R,1\n”); // reset device for changes to take effect
}
// Sends a char sequence using the hardware UART
// pin 1.1 RX
// pin 1.2 TX
void sendUART(char msg)
{
Serial.print(msg);
delay(delayUART);
}
I don’t know if there is a mistake in the AT commands i’m sending or in the UART communication itself. Any help would be greatly appretiated. Thank you!