Skip to main content

Experiment to CC2640R2F and CC2650


Image result for Bluetooth

Image result for cc2640r2fImage result for cc2650

This is the first experiment to do on a connection between CC2650 and CC2640R2F

In this experiment, I use a CC2650 as a simple central device and scanning another peripheral (CC2640).

This tutor follows the TI Guide:
http://dev.ti.com/tirex/explore/content/simplelink_academy_cc2640r2sdk_3_10_01_00/modules/blestack/ble_scan_adv_basic/ble_scan_adv_basic.html

However, this tutor use for two CC2640 experiments so we need to combine two Source:

Simplelink for CC2640R2 ver 3.10.0.0.xx

and SimpleLink for CC2650 ver ble_sdk_2_02_00_31


Notice 1: You must configure UART for each project to connect two KITs. 
Notice 2: The code does not display Advertising Data and I will try later
Update:
After two days to debug the problems belong to the function convert number string to text string 

char *Util_convertBytes2Str(uint8_t *pData, uint8_t length) { uint8_t charCnt; char hex[] = "0123456789ABCDEF"; static char str[(3*31)+1]; char *pStr = str; //*pStr++ = '0'; //*pStr++ = 'x'; char len = length/4 -1; for (charCnt = 0; charCnt < len; charCnt++) { *pStr++ = hex[*pData >> 4]; *pStr++ = hex[*pData++ & 0x0F]; if(!((charCnt+1) >= len)) { *pStr++ = ':'; } } pStr = NULL; return str; }

the Length of pData is 31 however its format different to charCount (Actually just 7 characters) so we need to modify the TI's original tutorial

We can change some feature to test the example operation; for particularly I change the feature

#define DEFAULT_DISCOVERY_MODE                DEVDISC_MODE_ALL
#define DEFAULT_DISCOVERY_WHITE_LIST          FALSE

in simple_central.c for scanner
#define DEFAULT_DISCOVERABLE_MODE            GAP_ADTYPE_FLAGS_GENERAL
in simple_peripheral.c for advertiser


Comments

Popular posts from this blog

Tự nhiên

Tự nhiên là những gì thuộc về tính tự có vốn là của nó, không có sự giải thích nào cho tự nhiên cả. Đó gọi là tự nhiên như cái tên mang ý nghĩa của nó vậy. Khoa học tự nhiên là khoa học liên quan tới nghiên cứu và tìm hiểu các vấn đề thuộc về đặc tính vốn có của sự vật theo một hình thức tự nó mà không phải là do con người tạo ra. Theo đó toán học, lý học, hóa học được xem là các ngành khoa học tự nhiên. Thật ra toán học nên được xem là ngành khoa học xã hội hơn là tự nhiên, vì về bản chất, toán học là thứ ngôn ngữ do con người sáng tạo ra. Vì thế nó mang những hình thái phụ thuộc vào nhận thức và cảm quan của người sáng tạo ra nó. Tuy nhiên toán học mang đặc tính tự nhiên ở chỗ, nó là phương tiện được xây dựng để mô tả đường lối của tự nhiên.
Experiment to CC2640R2 and Sensor Booster Pack In this example, I follow a tutorial from TI to read sensor OTP3001. http://dev.ti.com/tirex/content/simplelink_academy_cc2640r2sdk_1_13_02_07/modules/ble_02_thermostat/ble_02_thermostat.html Because the sensor TMP0007 has out of date now, so I little modify to use with OTP3001. Step1. Copy file i2ctmp from simpllink sdk  cc2640R2 version Reference The Booster pack datasheet  http://www.ti.com/lit/ug/slau666b/slau666b.pdf TMP0007 and OTP3001 share the I2C bus including SCL, SDA.  Address's  TMP is 0x04, Data Register: 0x00 Address's OTP is 0x47, DataRegister: 0x00  So in the code we modify: #define OTP3001_REG         0x0000  /* Die Temp Result Register for TMP006 */ #define OTP3001_ADDR        0x47; According to OTP3001 datasheet, in default, a configuration register (address 0x01) in sleep mode, so if we read data ou...
 Permutation function  def permute(s):     n = len(s)      if n <= 1:          return s     elif n == 2:         return [''.join([s[0],s[1]]),''.join([s[1],s[0]])]     else:# n > 2         snew = []         for i in range(n):             a = [k for k in s]#copy s to a             #print(s)             ele = a.pop(i)             for p in permute(a):                 q = ele + p                 if not(q in snew):                     snew.append(q)          return snew def permutations(string):     s = [ele for ele in string]     return permute(s) This code ...