• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Low Power RF & Wireless Connectivity » Bluetooth® Applications » ez430 rf256x bluetooth evaluation tool
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

ez430 rf256x bluetooth evaluation tool

ez430 rf256x bluetooth evaluation tool

This question is not answered
J.L
Posted by J.L
on Jul 31 2012 07:17 AM
Prodigy130 points

hello,

i have some problems sending data via bluetooth.

the demo software is just working fine and i can receive the accl-data on the terminal screen.

now i want to modify the demo code that way that i just want to send some data, like a bunch of numbers or letters.

i know that there are a lot of different sending, writing and reading functions in the demo-code. my problem is to find the right place within the code to place my "code".

i would like to know where to modify the code for my special purposes and which files a have to modyfie.

thanks alot for your help

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Zahid Haq
    Posted by Zahid Haq
    on Jul 31 2012 18:57 PM
    Expert5030 points

    If you are using MindTree’s stack, you can start with this simple application, the UART bridge:

    http://processors.wiki.ti.com/index.php/CC256x_MT_UART_BRIDGE

    The stack uses FreeRTOS, which divides user code in tasks (ie. user_task.c).

    Let me know if you have any questions,

    ZH

    ------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.

    Please visit our CC256x Forum Guidelines and FAQs

    Check out our CC256x Bluetooth Main Wiki page: http://processors.wiki.ti.com/index.php/CC256x

    ------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J.L
    Posted by J.L
    on Aug 01 2012 04:55 AM
    Prodigy130 points

    thaks for your reply...

    i modified the code suggested in the wiki but i got some errors, exactly in the user_task.c file. i got the error "declaration is incompatible with previous "config_uart_send_timer" ". i just copy/paste this section out of the wiki thats why i dont understand this error.

    any suggestions? 

    further i would like to know, where i can put my one "code" if the changes described in the wiki are finaly "running"?

    thanks for your help

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J.L
    Posted by J.L
    on Aug 01 2012 05:07 AM
    Prodigy130 points

    the "wiki-code modification" is now working, i just forgott something ;)

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J.L
    Posted by J.L
    on Aug 01 2012 06:33 AM
    Prodigy130 points

    hello again ;)

    as mentioned, the wiki-modification is now working...now i would like to know in wich file i have to put "my code", which should send data via blothooth from one target board (connected to the battery board) to the other board (connected to the PC) so i can see the incomming data on the terminal screen. as i already said, i know that there are different write, read and send functions but i cant figure out which is the "right" one for my purposes.

    any help would be nice....

    p.s.: i am totaly knew at this...

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Zahid Haq
    Posted by Zahid Haq
    on Aug 01 2012 11:26 AM
    Expert5030 points

    I'm not sure what it is you want to do but if you understand how the UART bridge code modification works, you should be able to create a task to send data. The user_task_routine in user_task.c is a task that runs periodically based on what is in the circular_user_buffer such as when SWITCH_S1 or SWITCH_S2 is pressed. You can use UPDATE_USER_BUFFER(YOUR_TASK_CODE) to add an additional task to be run inside user_task_routine where you can add your own switch statement:

    case YOUR_TASK_CODE:

    appl_spp_write(dev_index, halUsbReceiveBuffer, bytesToSend); //for example, to send data (line copied from UART bridge code)

    break;

    Regards,
    Zahid 

    ------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.

    Please visit our CC256x Forum Guidelines and FAQs

    Check out our CC256x Bluetooth Main Wiki page: http://processors.wiki.ti.com/index.php/CC256x

    ------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J.L
    Posted by J.L
    on Aug 01 2012 11:54 AM
    Prodigy130 points

    thanks for your reply...

    just to clerify my purposes:

    i want to send some numbers, maybe through a counter, from the targetboard connected to the battery-kit to the other targetboard connected with usb to the pc...

    its a kind of testsignal for further use...

    i will try the way you mentioned and see if it works...

    thanks again

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J.L
    Posted by J.L
    on Aug 02 2012 04:34 AM
    Prodigy130 points

    hello zahid,

    unfortunately it doesnt work...as i already said i am new to this stuff so please forgive me my innocence...

    could you please explain in a more precise way how i should implement my "code"? i dont really get it but i am not able to phrase my problem...

    i hope you can help me anyway and i really appreciate your help...

    thanks alot

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Zahid Haq
    Posted by Zahid Haq
    on Aug 02 2012 19:18 PM
    Expert5030 points

    For example, if you want to send something from the battery board with a press of a button, you can try this: in appl_sdk.c in line 161:

    case OP_PEER_DATASEND:
    {
    /* Dtasend stop and pause toggle button presses */
    if (SDK_IS_SPP_CONNECTED(0)) {
    if (SDK_IS_SPP_TX_STARTED(0)) {
    /* Stop Sending Data */
    SDK_SPP_CHANGE_TX_STATE(0, SDK_SPP_TX_OFF);

    } else {
    /* Start Sending Data */
    SDK_SPP_CHANGE_TX_STATE(0, SDK_SPP_TX_ON);
    //appl_send_spp_data(0);

    appl_spp_write(0, "hello", 5);

    }

    So this code snippet above(else statement) gets executed every other time SW2 is pressed(first time it stops sending data, second time it starts sending data). 

    If you look in user_task.c, how the above function is called when SW2 is pressed:

    case SWITCH_S2:
    /* Switch SW2 is mapped to contol datasend stop and pause
    * functionality */
    sdk_bluetooth_menu_handler(OP_PEER_DATASEND);
    break;

    So if your UART bridge was working, this should write "hello" to the other device connected to the PC and display it on a serial terminal. 

    Hope this helps,

    Zahid

    ------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.

    Please visit our CC256x Forum Guidelines and FAQs

    Check out our CC256x Bluetooth Main Wiki page: http://processors.wiki.ti.com/index.php/CC256x

    ------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J.L
    Posted by J.L
    on Aug 03 2012 04:18 AM
    Prodigy130 points

    thanks again  for your advice...

    one quick question though:

    does the "code" youve mentioned need to be on both boards because i dont receive anything?

    or is there maybe another change i have to do?

    regards

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Zahid Haq
    Posted by Zahid Haq
    on Aug 05 2012 00:57 AM
    Expert5030 points

    The code to write data should be on the battery board. The receiver connected to the PC should automatically write whatever data it receives to the PC through UART. 

    For example in appl_spp.c (starting line 515):

    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);

    if PACKETISE_USB_DATA is defined, it packetizes the 4 byte data it receives from other device and send it through the USB-UART to the PC. For your application, you can comment out where PACKETISE_USB_DATA  is defined. 

    Another thing you could try is to start with the original code from the web and modify it to continuously send some data instead of accelerometer data: in sdk_pl.c (line 133)

     //comment out accel. data

    /* Pack the x and y co-ordinate values in to buffer */
    buffer[0] = accl_x;
    buffer[1] = (accl_x >> 8);
    buffer[2] = accl_y;
    buffer[3] = (accl_y >> 8);

    //replace with your data

    buffer[0] = 'a';
    buffer[1] = 'b';
    buffer[2] = 'c';
    buffer[3] = 'd';

    And you should see "abcd" instead of random accel data on your serial terminal. 

    Hope this helps,
    ZH 

    ------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.

    Please visit our CC256x Forum Guidelines and FAQs

    Check out our CC256x Bluetooth Main Wiki page: http://processors.wiki.ti.com/index.php/CC256x

    ------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J.L
    Posted by J.L
    on Aug 08 2012 07:20 AM
    Prodigy130 points

    hello,

    again thanks for your help!!!

    as you mentioned i tried to send some letters with the original code...nevertheless i dont receive the lettters but instead some different accl-data, but i commented them out....so i dont understand why this is happening....when i just send the accl-data i receive some negativ nummbers....but when i write some letters in the buffer and comment out the accl-data i receive realy high numbers...is there any connection or do i miss something else? is there maybe a problem with the serial terminal? or do i have to change/modify other files too?

    thanks alot for your help!!!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Zahid Haq
    Posted by Zahid Haq
    on Aug 08 2012 10:58 AM
    Expert5030 points

    Are you using a general program like Putty or Hyperterminal which interprets the serial input as ASCII characters?

    Regards,

    ZH

    ------------------------------------------------------------------------------------------
    Please click the Verify Answer button on this post if it answers your question.

    Please visit our CC256x Forum Guidelines and FAQs

    Check out our CC256x Bluetooth Main Wiki page: http://processors.wiki.ti.com/index.php/CC256x

    ------------------------------------------------------------------------------------------

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J.L
    Posted by J.L
    on Aug 08 2012 13:02 PM
    Prodigy130 points

    im just using the hyperterminal from windows, so no special programm...

    when the both devices are connected, im starting the demo to see the incoming data on the popup hyperterminal screen...

    do i need another programm or is there any mistake im making?

    thanks for your reply, regards

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • J.L
    Posted by J.L
    on Aug 28 2012 03:44 AM
    Prodigy130 points

    hello again...

    i finally got my programm working and i receive data on the pc-screen.

    but i still got some problems:

    i got my counter function working (it just counts from 1 to 1000) it should count with a step size of "1" but sometimes  two consecutive numbers have a step size of "2" or "3".

    in the "CC256x MT UART BRIDGE wiki" it is said that there are two conditions to start sending data, first if the buffer is full and second if the timer expires.

    in my case it should be the first condition...

    my question is, how do i get the stored data to be immediately send, so that i really got i step size of "1" or at least a constant  step size?

    do i have to make all the the changes in the "CC256x MT UART BRIDGE wiki", or is there only one certain point which i have to change?

    thanks again for your help, i appreciate it

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

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.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use