Hi,
I have the ez430 rf2560 kit. I'm wondering if I don't use any of the sample application code and build my own code from scratch, do I need any libraries from the sample code? Another question is, after i configure the UART in MSP430F5190, do I need to do anything to configure the CC2560? Of I just need to look at the TX/RX buffer directly and no need to worry about the CC2560? Please forgive my innocence.
Thanks a lot,
Kevin
when i said libraries, i mean libraries files and head files.
Kevin,
Yes. Unless you build your own bluetooth stack or use another stack, you will need those libraries. The MSP430+Bluetooth requires a stack running on the MSP430.
Gustavo
---------------------------------------------------------------------------------------------------------Please click the Verify Answer button on this post if it answers your question.---------------------------------------------------------------------------------------------------------
Configuring the UART, managing the buffers and configuring the CC2560 is done as part of the MindTree BT stack.
Thanks for both of your replies. If I decided to use the sample code, and I need to use the MSP430 ADC to sample some signals, how should I handle the interrupt priority with the bluetooth's usart interrupts? Do I also want to develop my appl_adc.c file? Should I create a user task semaphore to handle the interrupt in my application file?
Xiaodong,
I suggest that you leverage the already existing code that samples the ADC that's connected to the Accelerometer. Since that works, getting your own sensor to work should be easy.
Gustavo,
That's a good idea. Seems like for the ez430 platform, they use I2C to read from the accelerometer directly. However, for the MSPEXP-PAN13xx SDK, they use the ADC12 to sample and do that. I'm thinking I should just put the hal_adc.c from this SDK and added to the ez430 SDK and modified that file. That should be OK right? I might ask you again if I have any other questions.
There are a few differences(as you have noted) in the hardware. You should be able to merge the two of them together.
After I pair my BT adapter from my laptop to the EZ430 transmitter, it shows that I cannot open the com port that was connected to it by the PC application code. I also tried hyperterminal and it failed to open it as well. Any solution to open the com port?
Can you explanin how you paired the device? did you change the name? Did the computer tell you which ports it opened?
I changed the name of my adapter to BlueMSP-Demo0666. uUnder device manager and connected BT device, it shows that it is connected to COM 14. And when i use the automatc detect port code, it is not shown under the available com port list in the debug window. So i go ahead create a com_port.txt file and put 14 in it and when I run it again , I type 999 and it said it fails to open the com port 14.
Are you using the program bundled with the EZ430 SDK? The EXP SDK might have a different filtering. What is the name it is showing up with in device manager?
It is shown as BlueMSP-066A.
Are you using the Microsoft stack, the Toshiba stack or another stack on your machine?
I can read the data using the PC application now. The trick and also problem is, I need to remove the device from my connected BT device list everytime I power off the EZ430 transmitter. Any comments on why it would do that? Moreover, new problem is, when I change the buffer[0] [1] [2] [3] from the sdk_spp_data_read function, the PC application code doesn't display any receive message. When I change back to the original code, I found that if I do not twist the ez430 transmitter, there will not be any data receive from the PC application code. Is it because the accelerometer chip does not send out any data if it is not accelerate? But why it wouldn't receive message if I change the buffer to some static number? My target application requires sending the data constantly without going into any chilling mode.
Thanks,
1) I've had to do this sometimes myself. Have you tried clicking on the S1 button before trying to open the bluetooth port? The Bluetooth connection needs to be up I believe
2) There is some packetization when data is received. The following is present in appl_spp.c:
case SPP_RECVD_DATA_IND: sdk_display("SPP_RECVD_DATA_IND -> Data received successfully\n"); sdk_display("\n----------------HEX DUMP------------------------\n"); for (index = 0; index < datalen; index++) { sdk_display("%02X ", l_data[index]); } sdk_display("\n------------------------------------------------\n"); if (TRUE == sdk_usb_detected) {#ifdef PACKETISE_USB_DATA packet[INDEX_0] = SOH; /* SOH Character */ memcpy(&packet[INDEX_1], l_data, PAYLOAD_SIZE); packet[INDEX_5] = calculate_checksum(packet); packet[INDEX_6] = '\0'; halUsbSendString(packet);#else memcpy(packet, l_data, PAYLOAD_SIZE); packet[INDEX_5] = '\0'; halUsbSendString(packet);#endif /* #ifdef PACKETISE_USB_DATA */ } break;