17.CodeLess™ AT Commands

The CodeLess™ AT Command platform allows you to control the BLE connectivity of DA14531 device wihout having to write a sinlge line of code - you simply send ASCII based commands to the device via the UART. More information about the CodeLess platform, including the commands it supports, can be found in the following:

This chapter provides a brief getting started guide to CodeLess, showing you how to get CodeLess running on your DA14531 Development Kit. We will deomstrate how a PC, running a terminal emulator such as TeraTerm etc., can be used to send AT commands to the DA14531 Development Kit and to display any response received.

_images/codeless_config.png

Fig. 44CodeLess Getting Started Configuration

There are four simple steps to get CodeLess running on your DA14531 Development Kit, detailed in the following sections:

  • Prepare the Development Kit

  • Program the Development Kit

  • Configure the Terminal Emulator

  • Send AT Commands to the DA14531

17.1.Preparing the Development Kit

第一步是准备development kit so that the UART on the DA14531 can communicate with the PC from which commands will be sent. Exactly how to do this depends upon the development kit you have. Go to the relevant sub-section below and ensure your kit is configured correctly.

Note

CodeLess cannot be used on the DA14531 Development Kit USB.

17.1.1.DA14531 Module Development Kit PRO

When using a DA14531 Module Development Kit PRO to run CodeLess ensure that the jumpers on the board are configured as shown below:

_images/codeless_531_dk_pro_module.png

Fig. 45DA14531 Module DK PRO CodeLess Configuration

The DA14531 Module Development Kit PRO is now configured to run CodeLess. The next step is to program a CodeLess binary into the board, proceed to the Programming section for details.

17.1.2.DA14531 Development Kit PRO

When using the DA14531 Development Kit PRO to run CodeLess, four jumper wires need to be connected to the board as follows:

  • Pin 17 on J1 [UTX] to pin 27 on J2 [P26]

  • Pin 15 on J1 [URX] to pin 26 on J2 [P25]

  • Pin 13 on J1 [URTS] to pin 28 on J2 [P27]

  • Pin 11 on J1 [UCTS] to pin 29 on J2 [P28]

In addition, ensure that the jumpers on the board are configured as shown below:

_images/codeless_531_dk_pro.png

Fig. 46DA14531 DK PRO CodeLess Configuration

The DA14531 Development Kit PRO is now configured to run CodeLess. The next step is to program a CodeLess binary into the board, proceed to the Programming section for details.

17.2.Programming the Development Kit

Now that the development kit has been correctly configured it must be programmed with a CodeLess binary file. There are a number of programming tools that can be used to do this, however we recommend using the Dailog Smartbond Flash Programmer. Click on the appropriate link below to download and install the Flash Programmer.

Once installation is complete, connect the DA14531 Development Kit to your PC and then start the Flash Programmer.

_images/codeless_flash_prog_1.png

Fig. 47SmartBond Flash Programmer

Next, download the CodeLess binary file from the Dialog Website. To do this, click theOnline Resourcesbutton and select theCodeLess DA14531 Standalone Set Two Hexfile, then pressDownload.

_images/codeless_flash_prog_2.png

Fig. 48CodeLess File Download

Note

The PC on which the Flash Programmer is running must have Internet access to be able to download the binary file.

Finally, program the downloaded binary file into the DA14531 Development Kit. To do this, click on the check box next to the JTAG serial number of your board and then press theProgrambutton.

_images/codeless_flash_prog_3.png

Fig. 49CodeLess Programming

When programming is complete, you will see a message statingStarting application on chipin the Log window.

_images/codeless_flash_prog_4.png

Fig. 50CodeLess Programming Complete

Note

Due to the limited amount of memory available on the DA14531, not all of the available CodeLess AT Commands can be supported by a single binary file. For this reason three different binary files are available; Datapump, Standalone and Standalone Set Two. A list of the commands supported by each of these files can be foundhere.

17.3.Terminal Emulator Configuration

Now that the DA14531 Development Kit has been configured, and programmed with the CodeLess binary file, the final step is to setup the Terminal Emulator that will be used to send AT commands to the board. In the following section we will use a free terminal emulator, Tera Term. Tera Term can be downloaded fromhttps://osdn.net/projects/ttssh2/releases/, but you can use any terminal emulator that you are comfortable with (PuTTY, RealTerm etc.).

  • First, start Tera Term, select the appropriate Serial Port as shown below, then click ‘OK’:

_images/codeless_teraterm_port.png

Fig. 51TeraTerm Port Selection

  • Now open the port configuration window by selectingSetup->Serial Portas shown below:

_images/codeless_teraterm_setup_1.png

Fig. 52TeraTerm Port Configuration Window

  • Finally, configure the serial port to use the following settings, and then click ‘OK’:

_images/codeless_teraterm_setup_2.png

Fig. 53TeraTerm Port Settings

17.4.Sending AT Commands

You are now ready to send AT commands to the DA14531 Development Kit Board. To test the interface is working, type the commandATI终端模拟器窗口,你就会看到a response giving the version number of CodeLess that the DA14531 is running:

_images/codeless_ati.png

Fig. 54CodeLess ATI Command Response

You now have the CodeLess AT command platform running on your DA14531 Development Kit. The next step is to explore the supported commands and to try out some examples. See the following links for a full list of all the supported commands and some CodeLess examples:

Note

For this demonstration we programmed the DA14531 with the CodeLess Standalone SET-TWO binary file. The source code for this, and the other, CodeLess AT Command Set binary files is available within the CodeLess SDK. This can be downloaded using the link provided in theSoftware Resourcessection of theCodeLess Product Page.