TI E2E Community
MSP430 Ultra-Low Power 16-bit Microcontroller Forum
MSP430G2553 and Bluegiga's BLE112
Has anyone tried interfacing with the BLE112? I am trying to communicate with it through the MSP's UART (USCIA0), but am not receiving a response. Bluegiga provides a nice API to interface with the device (http://www.bluegiga.com/files/bluegiga/BLE%20shared/BLE_Stack_API_reference_v1.3.pdf) and all I am trying to do is send/receive a 'Hello'. This is done by transmitting 0x00000001 to the device, and it should respond with the same thing. I believe the default baud rate for the BLE112 is 115200, which is what I have configured the MSP to. As far as documentation for the BLE112 itself is concerned, there is not very much of it :(
I've got similar problem. My BLE112 module communicate with PC on UART (by adapter USB<->UART). I send comands by aplication BLEGUI. I flashed uartdemo project. When I send commands I don't receive any responce. I was able to comunicate with PC on USB, by I have to communicate on UART. Did you solve your problem and maybe coul you give me any advice?
I am facing the same issue. I can see the 'system boot' message coming from the module, but am trying to send the hello message and don't get a response.
I will post back if I figure it out.
Ok I got it to where I can talk to it - for me I had to turn off the sleeposc function (which is supposedly not permitted for the BLE112) and specify a wakeup pin. These don't seem to have to both be done, but this is what got me talking to it. A little playing with it should get you the right combination. I may post back when I get it all hammered out the right way, but this should at least get you going.
Here is my hardware.xml file
<?xml version="1.0" encoding="UTF-8" ?>
<hardware> <sleeposc enable="false" ppm="30" /> <usb enable="false" /> <txpower power="15" bias="5" /> <script enable="false" /> <usart channel="0" mode="uart" stop="high" start="low" stopbits="1" alternate="1" baud="57600" endpoint="api" flow="false" /> <port index="0" tristatemask="0" pull="down" /> <wakeup_pin enable="true" port="1" pin="0" /> <slow_clock enable="false" /></hardware>
Did you try it with USART 1 Alt. 2 (P1.7, P1.6, P1.5, P1.4 <-> RX, TX, RT, CT)?
I have just checked my USB<->UART adapter. When I use a terminal program (Realterm) to send any char I can observe process on oscilloscope, but when I send command from blegui I can see notthing. Did you have similar problem?
I'm facing the same problem.
It seem a problem related with the BL112 sleep mode.
In order to communicate with the module I have to assert the wakeup pin.... no good.
The "problem" is most likely that the you have the power mode (PM3) enabled in the hardware configuration. This can cause the BLE112 to go into PM3, from where you need to wake it up using a GPIO.
If you do not want this operation, you can also disable the PM3 from the hardware configuration and then the GPIO wake-up is not needed.
-Mikko SavolainenBluegiga Technologies
I have a different Problem. I try to read an accelerometer via I2C. I already tried a lot to read it but I dont know where i have to put in the register Adress. I have the simple
call hardware_i2c_read(adress, length)(result, data_len, data_data) line where i dont know to put in my register adress. And the next problem i dont know how to enable the pull-up's on pin 1_6 and 1_7. It should be in the hardware.xml, but i dont know already. If anybody has an idea or better an example how to read and write to I2C sensors pls help....
Thanx a lot
Here's a code snipplet for you how to use the I2C and write a byte into a specific address:
# Write to address 128 one byte (0xf5).
# written indicates how many bytes were successfully written.
You should not need to configure the I2C pins separately, just make sure UART or SPI are not configured for channel 1.
For more information, please have a look at the documentation on our web site.
I am also using the MSP430 to act as the host for the BLE112. I am having issues with even seeing the system_boot response. From what I can tell, my hardware.xml file is configured correctly (see below) and my UART RX ISR is fairly minimal.Do you have any suggestions on how communicate correctly with the BLE112 over UART? Would you be willing to show me your implementation?
<?xml version="1.0" encoding="UTF-8" ?><hardware>
<sleeposc enable="false" ppm="30" /> <script enable="false" /> <sleep enable="false" /> <wakeup_pin enable="false" /> <txpower power="15" bias="5" /> <port index="0" pull="down" tristatemask="0" /> <port index="1" pull="down" tristatemask="0" /> <usb enable="false" endpoint="none" /> <usart channel="1" baud="38400" alternate="1" endpoint="api" flow="false" mode="packet" />
__interrupt void UART_RX_ISR(void)
int8_t e = UCA0STAT & UCRXERR;
int8_t c = UCA0RXBUF;
//if(e) return; //ignore chars with framing or overrun errors
if (InBufInIdx < IN_BUFFER_SIZE_MINUS_ONE)
InBuf[InBufInIdx++] = c; // add to buffer
InBuf = 0; //note the buffer overflow as command null
__bic_SR_register_on_exit(LPM0_bits); // rti with cpu running
I tried your hardware configuration with my BLE112 development kit and it seems to work as expected,
so I can send/receive BGAPI commands over UART.
The development kit has a proper 4-wire UART (TX,RX,RTS and CTS), but as you are using the packet
mode, it should work with just TX and RX only.
Thanks for the input, I actually just discovered what my problem was and it is on the MSP430 side of the programming. Here's what I've found. It turns out that my initialization of the DCO was off (I found this by measuring it on a GPIO pin, thanks for that help). The problem were the macro definitions I used for setting up the 8 MHz clock. Originally, this is what I had:
BCSCTL1 = (XT2OFF | CAL_BC1_8MHZ); //configure for 8MHzDCOCTL = CAL_DCO_8MHZ;
The problem with this is that the CAL_BC1_8MHZ and CAL_DCO_8MHZ were the incorrect definitions. They instead need to be this (just remove a single underscore):
BCSCTL1 = (XT2OFF | CALBC1_8MHZ); //configure for 8MHzDCOCTL = CALDCO_8MHZ;
Sometimes it's just a simple, albiet a bit cryptic, oversight that causes all the problems. Thanks for your help.
Here is a BLE112 starter kit we designed to help us use the BLE112 device and be able to reprogram it useing the CC debugger: http://esdn.com.au/Products/USB-BLE112.html
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.