Jump to content
43oh

How to access the UART via Enregia within CSS 6.1.x


Recommended Posts

  • Replies 33
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

You can't have both the Launchpad TX/RX connected and the BT device.  Pull the jumpers and connect the BT device directly to P1.1 and P1.2

Posted Images

Yes eBay will be a better choice for the next ones! it is OK for it to be slave only for this intended application.

 

Yyrkoon, have you been able to make this BT device work with your Launchpad?

 

Rickta59, yes on the msp430g2553 it is connected to the TX on the BT device. and TX on msp430 to RX on BT device.

 

That is a cool idea about jumping RX/TX. I will try it!

@@RobertWoodruff

 

No, we've been toying with these on a beaglebone black. It's pretty cool to have a wireless UART.

Link to post
Share on other sites
(BTW: The BT device defaults to 9600 baud, which is what the UART has been set to)

 

Thoughts?

These sorts of devices are configurable via an AT+ command set. Similar to the ESP wifi devices. So, if you have any doubts, you could always connect this up to a PC using a serial to USB cable. Such as a PL2303 based cable, or similar.

 

There are many guides on the internet about setting these up, and using them. Mostly for Arduino's, but adapting these guides should not be too much trouble.

 

EDIT:

 

Ok, so after rereading your first post, and reading the code, you already know these configure via an AT command set. So . . . not sure where you're going wrong. You do have rx and tx swapped between the bt device, and the launchpad ? Meaning rx to tx, and tx to rx etc ? Rickta mentioned that before, but I did not see a response from you .

 

EDITII: Ok, I see you mention you do have rx / tx swapped in another post . . . You also mention having is powered via the LP, which I was going to mention next . . .

 

@@RobertWoodruff

 

So is Energia picking up the device yet or not ?

Link to post
Share on other sites
* Steps to set to MASTER:

* Set PIO11 HIGH with a 10K resistor in between.

Ah, ok, so this is actually already an HC-05 device. Or similar.

 

So this is what I'm thinking right now. It could be that since I do not see you waiting in your code, that you have a device power up race condition. The launchpad might be beating the bluetooth device at reset. Since the bluetooth device automatically goes to reset when powered up according to the manual.

 

So, maybe put a sleep() in your code initially to see if that's the case.

 

EDIT:

 

Hah ! you do have a delay() in your code, but perhaps 1 second is not enough ? Have to checked to see if the LED blink pattern suggest the bluetooth device is up and operational ?

 

EDIT AGAIN:

 

@@RobertWoodruff

the default baudrate for this device is 38400 since it is an HC-05. page 19-20 in the manual: http://www.ram-e-shop.com/ds/general/Bluetooth_TRx_Module_New.pdf

#include<SoftwareSerial.h>

#define RxD 6
#define TxD 7
SoftwareSerial BT(RxD,TxD);
void setup()
{
Serial.begin(9600);
BT.begin(38400);
delay(1000);
initialize_bluetooth()

. . .
Link to post
Share on other sites

The blinking pattern on the BT device says it is in AT mode.  

 

I am trying to send the simplest command from the Launchpad to the BT device, 'AT' and expecting the BT device to send back 'OK'. But nothing comes back. BTW: This is an 06 rather than an 05 BT device. Wonder if that matters?

 

Thank you,

Link to post
Share on other sites

The blinking pattern on the BT device says it is in AT mode.  

 

I am trying to send the simplest command from the Launchpad to the BT device, 'AT' and expecting the BT device to send back 'OK'. But nothing comes back. BTW: This is an 06 rather than an 05 BT device. Wonder if that matters?

 

Thank you,

It only matters in that an HC-05 can act as a "master" bt device. Meaning it can connect to other devices, not just be connect to. The image on amazon however with 5 pins is an HC-05, and the commands they mention in the manual too. So I do not know, maybe they sell both ? I guess the manual listed as a link from amazon,com has a picture of the HC-05. The one listed to the link you pasted is only 4 pins, so yea, an HC-06. . .  I've got too much going on today ;)

 

An HC-05 will also not be able to accept or make bt connection while it's in AT mode. One of the pins get pulled to ground via a 10k resistor, I believe, which then puts it in AT mode. You remove the pulldown, and it goes back into normal operation mode. AN HC-06 is always in AT mode.

 

EDIT:

 

did you attempt to remove the jumpers from the launchpad board( UART ) to see if that fixed the issue ?

Link to post
Share on other sites

Yes the jumpers are removed, the two outlined in green in the image upthread.

 

There are indications in the manuals that the default baud is 38400. I have tried both 9600 and 38400. ( Both Serial.begin(9600); and Serial.begin(38400); )

 

Still serialEvent is not called (Which in Energia means no traffic on the RX channel of the UART).

 

I am stumped at the moment.

 

Thanks to all for continuing to help debug this !!!

Link to post
Share on other sites

Update: It seems to me that the HC-06 BT unit is just not workable. Other postings are not kind to it either and recommend using the HC-05 instead (even though its Master mode is not needed for this application).

 

Also noticed that the HC-06 cannot be toggled between AT and communications mode. Once it goes from AT to communications it requires power reset to get back to AT. That will not work for the intended application either. This application needs to toggle between the modes from time to time.

 

Have ordered an HP-05 and will attempt to use it.

 

Will post more when the HP-05 arrives. Thanks to all!

 

 

 

Link to post
Share on other sites

Update: It seems to me that the HC-06 BT unit is just not workable. Other postings are not kind to it either and recommend using the HC-05 instead (even though its Master mode is not needed for this application).

 

Also noticed that the HC-06 cannot be toggled between AT and communications mode. Once it goes from AT to communications it requires power reset to get back to AT. That will not work for the intended application either. This application needs to toggle between the modes from time to time.

 

Have ordered an HP-05 and will attempt to use it.

 

Will post more when the HP-05 arrives. Thanks to all!

 

 

 

Maybe the one you have is just faulty ? We have 5 HC-06's, and they all work just fine, but we're also not using them on a launchpad. . . .

Link to post
Share on other sites
  • 2 weeks later...

Hi
I am new to this forum - microcontroller stuff even - and seek some help.
I have an MSP430G2 Launchpad (Rev 1.5) and a brand new hc05 bluetooth module.
I wired TX to RX and RX to TX to fire it up, using VSS and GND from Lauchpad.
The LED of the hc05 is blinking rapidly (which the manual says it is searching for a connection) but there is no visible bt-device on air.
If I press the KEY-button on power on, LED flashing sitches to a 2sec pattern and wiki says I can use AT commands.
As I am using Linux, CCS6 is not working for Launchpad and Energia just outputs nothing on SerialMonitor. Neither on Baud 38400, nor on 9600 (nlcr set).
Also wiki pages state somthing about horizontal TX/RX jumper config on Launchpad >=1.5, which I tried and results to nothing.
What am I missing? I need to have hc05 module in slave mode, so I can connect to it via my phone/notebook.
Thanks in advance for help :)
 

Link to post
Share on other sites

FYI, I use Windows with CSS and the Energia libraries.

 

It is not generally possible to use serial monitor when the HC-05 connected as there is but one UART on the MCU (assuming your Launchpad has a MSP430G2x53 MCU). I use the CSS debugger to monitor the traffic on the UART RX channel (be careful though as the debugger messes up the ISR (interrupt service routines)).

 

Also it is a good idea to connect the HC-O5 WAKEUP pin to something to pull it high to place the HC-05 into AT mode. Pull it low the HC-05 goes to communication s mode.

 

The HC-05 accepts an AT command to place it into slave mode. Though slave mode and 9600 bps is the default.

 

Do not believe I have answered your questions though. Keep asking.

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...