Jump to content
RobertWoodruff

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

Recommended Posts

Thanks, RobertWoodruff :)

Now I get it, there is indeed only one UART on MSP430G2553...

As I cannot use CSS (no linux support for Launchpad), I have to configure HC05 blind via AT commands (I tried using your code for this).

Thing is, I cannot get HC05 to even broadcast a bluetooth device :(

I am totally stuck, as I have never worked with bluetooth before.

Maybe I am missing something fundamentally?

 

Edit: Maybe I should configure HC05 via USB to TTL converter first and then check if it is working - thing is, the converter is at my parent's and I cannot get it for a whole week - at least :(

Share this post


Link to post
Share on other sites

The only way I could figure how to develop the code to interface Launchpad (with single UART MCU) and HC-05 was to download and use CSS on Windows. Otherwise there is just not an effective way to debug what is happening between the MCU and HC-05.

 

Now with all that plumbing in place it is impressive what can be accomplished with the MCU as a control processor and the HC-05 as the means of external communication with the controller. (We are also building an Android app as the human interface to the control system. The Android communicates to the MCU via the BT connection).

 

Try to get CSS on Windows if you can, my recommendation.

Share this post


Link to post
Share on other sites

Many thanks for your help.

I set up a VM with Win7 and got CCS6 running. Thing is, when I do as you did and flash your code I cannot see any "OK" output from debugger on RX.

It receives stuff, but only like '0x0A' and stuff. How do you monitor RX exactly?

And by doing so, you have Jumpers J3 (RX+TX) pulled, right?

Share this post


Link to post
Share on other sites

RX can be monitored by watching, with the CSS debugger, what characters are coming in from the UART interrupts being placed in the "ring_buffer" (HardwareSerial.cpp in Energia). They can also be reliably seen by watching, again with the debugger, the traffic to your serialEvent routine.

 

It is a little tricky because the debugger sort of interferes with the ISRs used to capture the RX traffic.

 

/*
* From BT device on UART
*/
void serialEvent(void) {

 while(Serial.available()) {
  int cInt = Serial.read(); /* fetch next char from the UART buffer */
  command.addChar(cInt);
  if (command.commandIsAvailable()) /* Call the command processor */
   commandProcessor.processCommand(command);
 }
}

 

Hopefully this helps, at least a little bit :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×