This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2560: UART CC2560 with ATTiny1634

Part Number: CC2560
Other Parts Discussed in Thread: CC2540

Hi, 

I am new user, i am trying to use PAN1326B for my project. but I dont know how to begin. Can you help me?

My project plan: I use ATTiny1634 to connect (UART) with PAN1326B (CC2560). i want to communicate with another device by bluetooth. 

I am using atmel studio to programm for it, and I use reference from https://github.com/RedBearLab/BLE_HCI/tree/master/arduino

Can I use HCI command from this library (CC2540) for my project (CC2560) ?

I am waiting for some components, so I cant test my circuit now. 

this my code:

Thank you so much 

hng

sorry for my bad english

1538.main.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* main.c
*
* Created: 6/26/2017 11:28:29 AM
* BLE_HCI central
*/
#define F_CPU 8000000
#include <avr/io.h>
#include <stdio.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include "CPble_UART.h"
//#include "CPble_HCI_driver.h"
//#include "CPble_PCM_driver.h"
#include "CPble_MSPIM.h"
#include <stdlib.h>
#include <string.h>
#include "CPble_typedef.h"
char found_address[6];
char ble_event_process()
{
//uint8_t type, event_code, data_len, status1;
//uint16_t event;
//uint8_t buf[64];
char type, event_code, data_len, status1;
char event;
char buf[64];
UART0_Init();
// UART0_Receive(); receive a char,
type = UART0_Receive();
_delay_ms(35);
event_code = UART0_Receive();
data_len = UART0_Receive();
UART1_Init();
SerialPrint1("-----------------------------\r\n");
SerialPrint1("-Type :");
SerialPrint1(type);
SerialPrint1("\n");
SerialPrint1("-EventCode :");
SerialPrint1(event_code);
SerialPrint1("\n");
SerialPrint1("-Data Length :");
SerialPrint1(data_len);
SerialPrint1("\n");
for (int i = 0; i < data_len; i++) {
buf[i] = UART0_Receive();}
event = BUILD_UINT16(buf[0], buf[1]);
status1 = buf[2];
SerialPrint1("-Event :");
SerialPrint1(event);
SerialPrint1("\n");
SerialPrint1("-Status :");
SerialPrint1(status1);
SerialPrint1("\n");
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
CPble_hci.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
* CPble_hci.c
*
* Created: 6/30/2017 1:19:10 PM
*
*/
//#include <AltSoftSerial.h>
#include "CPble_typedef.h"
#include "CPble_hci.h"
#include <string.h>
#include <stdio.h>
#include <stdint.h>
uint8_t GAP_DeviceInit( uint8_t taskID, uint8_t profileRole, uint8_t maxScanResponses, uint8_t *pIRK, uint8_t *pSRK, uint32_t *pSignCounter )
{
uint8_t buf[42];
uint8_t len = 0;
buf[len++] = 0x01; // -Type : 0x01 (Command)
buf[len++] = 0x00; // -Opcode : 0xFE00 (GAP_DeviceInit)
buf[len++] = 0xFE;
buf[len++] = 0x26; // -Data Length 0x26bytes (38bytes) = 1 + 1 + 16 + 16 + 4
buf[len++] = profileRole; // Profile Role
buf[len++] = maxScanResponses; // MaxScanRsps
memcpy(&buf[len], pIRK, 16); // IRK // copy 16bytes from pIRK to buf[]
len += 16;
memcpy(&buf[len], pSRK, 16); // SRK // copy 16bytes from pSRK to buf[]
len += 16;
memcpy(&buf[len], pSignCounter, 4); // SignCounter // copy 4bytes from pSignCounter to buf[]
len += 4;
UART0_Init();
SerialPrintln0(buf, len);
//AltSoftSerial.write(buf, len);
return 1;
}
uint8_t GAP_DeviceDiscoveryRequest( gapDevDiscReq_t *pParams )
{
uint8_t buf[20];
uint8_t len = 0;
buf[len++] = 0x01; // -Type : 0x01 (Command)
buf[len++] = 0x04; // -Opcode : 0xFE04 (GAP_DeviceDiscoveryRequest)
buf[len++] = 0xFE;
buf[len++] = 0x03; // -Data Length 0x03bytes (3bytes) = 1 + 1 + 1
buf[len++] = pParams->mode; // Mode
buf[len++] = pParams->activeScan; // ActiveScan
buf[len++] = pParams->whiteList; // WhiteList
// hci_tl_write(buf, len);
// hci_tl_wait_for_response();
UART0_Init();
SerialPrintln0(buf, len);
//AltSoftSerial.write(buf, len);
return 1;
}
uint8_t GAP_EstablishLinkReq( gapEstLinkReq_t *pParams )
{
uint8_t buf[20];
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
CPble_hci.hCPble_typedef.h

3487.pic.docx

  • Hi , We have assigned your query to relevant expert. We will get back to you shortly .

    Thanks
    Saurabh
  • Hoang,

    Just to clarify, are you trying to use the ATTiny device as the processor platform for the C2560? If not, what device are you using as the platform?

    Also for reference, here is the CC2560 wiki. processors.wiki.ti.com/.../CC256x
  • Hi, 

    Ja, I am trying to use ATtiny1634 as the processor platform for CC2560. 

    I am trying to build:

    AtmelStudio (AVR) ----(FTDI)-----ATTiny163-------(UART-Levelshifter) ----------PAN1326B             PAN1326B     -------------(UART-Levelshifter)-------ATTiny1634--------(FTDI)----------AtmelStudio(AVR)

    I am trying to transmitt data between 2 bluetooth devices (PAN1326B) 

    Thank you

  • Hoang,

    We do not offer support for MCUs other than the ones listed in our wiki (MSP432, MSP430, Tiva, STM32F4). For assistance with porting to other MCUs, please utilize the resources at this site.