• 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 » Low Power RF Bluetooth® Low Energy & ANT Forum » Communicate with CC2540 USB dongle with serial terminal program(tera term)
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Communicate with CC2540 USB dongle with serial terminal program(tera term)

Communicate with CC2540 USB dongle with serial terminal program(tera term)

This question is answered
Vivek Ravi
Posted by Vivek Ravi
on Aug 08 2012 15:00 PM
Prodigy235 points

Hey guys,

So far I've been testing my BLE project by using Btool to control the USB dongle(loaded with CC2540_USB dongle_HostTestReleaseAll.hex). As I understand it, loading the  USB dongle with the hostTestRelease file lets you control the dongle through a virtual COM port. So, I'd like to move away from Btool and write a labview vi to control it.

Before I do that though, I wanted to test it by trying to control it through a serial terminal program like tera term. So I open tera term and it recognizes the CC2540 as a COM port(COM port 3 on my PC). I setup the the serial port with the same parameters Btool uses. Now, I try to send it "01 00 FE 26 08 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00"  which is the Gap_Device Init code that Btool first sends when you open it. But there is no response. Can anybody tell me why I'm not able to read anything back? Is it the string format? Do I need to send it an ASCII string? Will I need to include a new line terminate character? 

I would really appreciate any help or suggestions.

regards,

V

Communicate with CC2540 USB dongle with serial terminal program(tera term)
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • kazola
    Posted by kazola
    on Aug 08 2012 15:11 PM
    Guru10665 points

    Hi Vivek, you have several similar examples at the top rows of the forum, in the linux examples.

    Can you give them a try and let us know?

    Thanks! :)



    Please click the     Verify Answer     button on a post if it answers your question! :)

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ehad Akeila1
    Posted by Ehad Akeila1
    on Oct 18 2012 06:05 AM
    Prodigy20 points

    I'm trying to do the same. I want to develop my own application on MATLAB to communicate with the usb dongle through HCI commands via a serial connection. Before doing that I tried using Realterm to send any command but I couldnt enter anything in the terminal. I've looked at the provided examples including those developed in  Linux but couldn't find any clue why I dont get a response from the dongle. The only two applications that work are BTool and BleHealthDemo (which is based on BTool) . I looked at the BleHealthDemo code but didnt get any helpful hint.

    I feel there is something has to be done to initialise the connection to the usb dongle under Windows 7. I looked at the JavaSimplePeripheral code and it seems it doesnt work on Windows 7. I wonder if anyone has managed to communicate with the dongle using applications other than BTool.

    Regards

    Ehad

    BLE CC2540_usb
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Dirty Harry
    Posted by Dirty Harry
    on Oct 19 2012 17:54 PM
    Verified Answer
    Verified by Dirty Harry
    Mastermind19350 points

    Simple - just send "binary" bytes that correspond to a command that should have a response. Take the read board address command which is exactly 4 binary bytes but shown as hex: 0x01 0x09 0x10 0x00

    Then you will recieve the 13 binary bytes of response.

    I use Br@y Terminal to open port at 115200,8,N,1 & no flow control and can talk to this .hex image:

    C:\Texas Instruments\BLE-CC254x-1.2.1 - Copy\Accessories\HexFiles\CC2540_USBdongle_HostTestRelease_All.hex

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Ehad Akeila1
    Posted by Ehad Akeila1
    on Oct 31 2012 00:28 AM
    Prodigy20 points

    Thanks a lot, it's working now. I had to send and receive the data as ASCII characters in MATLAB.  Here is a sample code for testing the serial communication with the USB dongle:

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

    clear
    clc
    try
    fclose(INSTRFIND);%closes all current ports
    catch
    end
    s = serial('COM2');
    set(s,'BaudRate',115200,'Timeout',0.2,'FlowControl','none','Parity','none');

    fopen(s);

    GAP_initialise=['01';'00';'FE';'26';'08';'03';'00';'00';'00';'00';'00';'00';'00'
    '00';'00';'00';'00';'00';'00';'00';'00';'00';'00';'00';'00';'00'
    '00';'00';'00';'00';'00';'00';'00';'00';'00';'00';'00';'00';'01'
    '00';'00';'00'];
    dec=hex2dec(GAP_initialise);
    fwrite(s,char(dec)');
    [A,count] = fread(s,30);
    h=dec2hex(A);
    h_disp='';
    for i=1:length(h)
    h_disp=[h_disp h(i,:) ' '];
    end
    h_disp

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

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Dirty Harry
    Posted by Dirty Harry
    on Oct 31 2012 11:14 AM
    Suggested Answer
    Mastermind19350 points

    Br@y Terminal has an great macro functionality - at the bottom left corner of the gui, press the 'Set Macros' button and for macro one, M1, enter the hex of the message you want to send. So to read the board address:

    $01$09$10$00

    Then just press M1 to send the binary 4 bytes.

    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