Microchip BluSDK. This document includes the following topics: • Technical overview of the ATBTLC1000 board from hardware architecture to software design • Description of the required process for developing the Bluetooth Low Energy peripheral application with the ATBTLC1000 •...
Install the Advanced Software Framework (ASF) package. Note: The software for ATBTLC1000-ZR is supported with ASF 3.35.1 and above. Note: For more information on the previous releases, refer to the Atmel Studio Release Notes available on the Microchip web page.
Bluetooth Low Energy Protocol Stack. ATBTLC1000 Host Software API The ATBTLC1000 is provided with a dedicated Host software API layer. The purpose of this API layer is to provide an easy and reliable solution to add Bluetooth Low Energy capabilities to any user application.
Page 6
The API operation relies on a request-response mechanism. The specific requests are sent to ATBTLC1000 through dedicated API function call. The event messages are then returned by the ATBTLC1000 on request processing or on specific Bluetooth Low Energy events. These event messages are to be handled by the host device, according to the user application requirements.
Page 8
The ATBTLC1000ZR Xplained Pro extension evaluation kit is based on Bluetooth Low Energy 4.1 compliant SoC ATBTLC1000-ZR110CA module. This extension is plugged to any of the supported host MCU Xplained Pro evaluation boards, to quickly add Bluetooth Low Energy connectivity to the platform.
C) and SMBus serial interfaces • Current Measurement Header – Allows measurement of the current consumption of the board. It must be closed to enable power to the ATBTLC1000-ZR110CA module Hardware Setup Ensure that ATBTLC1000ZR-XPRO power consumption header is closed and that jumpers are placed on pins 2 to 3 of headers J105, J106, J107 and J108, as shown in the following figure.
Advanced Software Framework has a pre-configured Bluetooth Low Energy Startup template project that includes Bluetooth Low Energy software API for Host and ATBTLC1000, and their peripheral driver dependencies. This is used as starting project for any Bluetooth Low Energy project development.
Page 13
Creating the Project and Initializing Figure 2-2. Advanced Software Framework_New Example Project Note: ATBTLC1000/SAMB11 related projects are prefixed with “BLE”, making it easier to filter the project in the dialogue box. Select the appropriate “BLE-Startup Template” project corresponding to the intended Host MCU Xplained Pro board and then press OK button to import the BLE startup template project.
Page 14
Note: The main project routine of “Startup Template project” already includes host MCU low level initialization, BLE and ATBTLC1000 initialization. The added ASF components in project can be viewed from “ASF>ASF Wizard”. Select the created project from "Project" drop down box.
Creating the Project and Initializing Figure 2-5. Main Routine Flowchart Configuring ASF for ATBTLC1000-ZR The default “Startup Template Project” is configured for ATBTLC1000-MR module with 6-Wire mode. Navigate to Project properties: Project > Project properties > Toolchain > ARM/GNU C Compiler >...
The Bluetooth Low Energy connectivity is added to the application that is used to connect with the Bluetooth Low Energy central. The first step is about the management of Bluetooth connection with a central device. When using ATBTLC1000 device, this process is managed by dedicated API function calls associated with ATBTLC1000 events handling.
Page 21
For management of advertisement process and cover the different configurations specified by SIG, the ATBTLC1000 Host driver provides the two functions elaborated in the following sections. In the application, use these two functions to setup the following ADV_IN type payload.
The management of the Bluetooth connection at the host MCU level is done through reception and handling of events reported by the ATBTLC1000. These events are generated by ATBTLC1000 GAP, GATT and L2CAP layers to notify the host about the ongoing Bluetooth interaction with other devices in its vicinity.
Page 26
ATBTLC1000 Establishing Connection with Central Device To manage events coming from the ATBTLC1000 module, the host driver must provide a ble_mgr_events_callback_handler function that allows registration of application callback function to be executed on each event reported by the ATBTLC1000 module.
Page 28
Add the following "register_btlc1000_callbacks" function in "startup_template.c". /* Register GAP callbacks at BLE manager level*/ void register_btlc1000_callbacks(void){ /* Register GAP Callbacks */ printf("\n*** Assignment 2.2: Register ATBTLC1000 callbacks"); ble_status = ble_mgr_events_callback_handler(REGISTER_CALL_BACK,\ BLE_GAP_EVENT_TYPE,&app_gap_handle); if (ble_status != true) printf("\n##Error when Registering ATBTLC1000 callbacks");...
Page 29
” to save the project <Ctrl+S>. 11. Click “ ” to program the project binary on the SAM L21 Xplained Pro. <Ctrl+Alt+F5> and check correct initialization of the ATBTLC1000. ™ 12. Open the "Microchip SmartConnect" application on Android or iOS device.
Setting/Handling of Pre-Defined Service Setting/Handling of Pre-Defined Service The management of services are done in the GATT layer of the ATBTLC1000 ROM coded Bluetooth Low Energy Stack. The GATT transactions are based on high-level nested objects called "Profiles", "Services" and "Characteristics" stored in SRAM memory of ATBTLC1000 device. This assignment adds the pre- defined service of information service from ASF library.
Setting/Handling of Pre-Defined Service In this assignment, the following steps are added to the Host MCU application to set up and handle a device information service within the ATBTLC1000 module. The following steps are added to the startup project: •...
Setting/Handling of Pre-Defined Service Figure 4-6. Device Information Service Added to Project Configuring and Loading Device Information Service The ATBTLC1000 Host driver provides a set of GATT functions that allows storing and updating the services in ATBTLC1000 memories. Prototype : at_ble_status_t at_ble_primary_service_define(...
Page 36
“Forget Device” from the mobile settings. The reason for this is that the mobile app stores the previous pairing information, but the ATBTLC1000 device lost the previous pairing information due to RESET since it was stored on temporary storage (RAM).
The central is not required to send read characteristic commands explicitly to the peripheral (GATT server). To setup and handle the custom environment service in ATBTLC1000 module, the following steps are added to the Host MCU application: •...
Figure 5-2. Custom Service Flowchart Configuring and Loading the Custom Environment Service The ATBTLC1000 Host driver provides the following set of GATT functions that allows it to push and update the service descriptions in the ATBTLC1000 SRAM memory. Note: Before starting this assignment, be sure to follow the steps mentioned in...
Page 40
Assignment 4.1: Register GATT Server callbacks"); ble_status = ble_mgr_events_callback_handler(REGISTER_CALL_BACK,\ BLE_GATT_SERVER_EVENT_TYPE,&app_gatt_server_handle); if (ble_status != true) printf("\n##Error when Registering ATBTLC1000 callbacks"); Add custom_environment_service_init and register_gatt_server_callbacks function calls prior to start advertisement in the application main routine to initialize custom service and to register the GATT server callbacks.
Page 41
DBG_LOG("Initializing BLE Application"); /* initialize the BLE chip and Set the Device Address */ ble_device_init(NULL); /* Register ATBTLC1000 Callbacks */ register_btlc1000_callbacks(); /* Custom service init */ custom_environment_service_init ( ) ; /* Register Gatt server callbacks */ register_gatt_server_callbacks ( ) ;...
Page 48
DBG_LOG("Initializing BLE Application"); /* initialize the BLE chip and Set the Device Address */ ble_device_init(NULL); /* Register ATBTLC1000 Callbacks */ register_btlc1000_callbacks(); /* Initialize Device Info service in GATT */ printf("\n*** Assignment 3.2: Start Device Info Service"); dis_init_service(&dis_service_handler); /* Define the primary service in the GATT server database */ if((dis_primary_service_define(&dis_service_handler)) != AT_BLE_SUCCESS)
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A. Silicon Storage Technology is a registered trademark of Microchip Technology Inc. in other countries. GestIC is a registered trademark of Microchip Technology Germany II GmbH & Co. KG, a subsidiary of Microchip Technology Inc., in other countries.
Need help?
Do you have a question about the ATBTLC1000 and is the answer not in the manual?
Questions and answers