Bluetooth connectivity is becoming so widely available that it almost seems like a basic requirement for any consumer-facing electronic device. The proliferation of Bluetooth has made integrated modules much more affordable, simplifying hardware integration, but programming Bluetooth, especially Bluetooth Smart (aka Bluetooth Low Energy) which often sits on resource-constrained systems, has remained quite challenging.

Whereas PC or smartphone programmers have the benefit of high level programming languages and APIs for Bluetooth Integration, embedded designers have had to program in Bluetooth connectivity with low level, hardware specific C.

It doesn’t have to be this hard.

SmartBASIC

Almost any programmer of any age has fond memories of BASIC. This simple programming language, embedded in early Apple and PC systems, was easy enough for children to learn, yet could create surprisingly sophisticated programs.

Mimicking the simplicity of BASIC, but also addressing its weaknesses as a programming language for embedded systems, Laird Technology has introduced SmartBASIC for Bluetooth programming on its BL600 BLE and BT900 Dual-mode Bluetooth modules.

SmartBASIC shares the easy to learn syntax and interpretive nature of BASIC but adds an event-based programming model, as well as an API to make it easy to interface with the Bluetooth Classic/BLE module without requiring extensive knowledge of the hardware.

Whereas traditional BASIC or procedural programming has the program flow sequentially from start to finish, SmartBASIC is event-driven. Program flow is determined by events such as button presses, or a change in value (for instance from a sensor). For most sensor-driven, embedded applications, this makes the code much shorter, simpler, and simultaneously makes it easy for the device to maximise time spent in low-power sleep mode.

To ease the Bluetooth learning curve, SmartBASIC has subroutines and functions which make it easier to create Bluetooth programs. It also provides an API into the hardware peripherals on the BL600 and BT900 series modules making it easy to configure the Bluetooth radio, or read GPIO pins.

Bluetooth Device on a Module

The Laird BL600 and BT900 modules using SmartBASIC are not only radio modules, but have an SoC design with a Cortex M3 processor. This allows Bluetooth Smart or Classic applications to be run completely on the modules themselves without requiring an external MCU. With access to GPIO and serial pins, SmartBASIC can also be used to easily read and manipulate sensor value using arithmetic or string functions.

For legacy devices which use a wired communications link such as a modem, a SmartBASIC module can also be used to easily add Bluetooth connectivity by emulating the original communications interface for a quick time-to-market solution that requires little to no modification of the original device firmware.

Getting Started with SmartBASIC

Laird’s SmartBASIC modules are not only easily programmable but easy to develop for. Several breakout boards, as well as a full featured dev kit, are available for a variety of development options.

Fig 1. Combined with SmartBASIC, the BA600 with USB to UART adapter, BC600 with Coin cell adapter, and BB600 with through-holes for easy breadboarding make developing and prototyping Bluetooth Smart devices easy

The BB600 board has through holes for breadboarding for easy hardware prototyping. The BC600 adds a mounted coin cell adapter for designing battery powered devices. The BA600 includes both the coin cell adapter as well a USB to UART adapter for additional power options and easy PC-based testing and programming.

For a more full-featured development kit, the DVK-BL600 offers extensive on-board equipment including programmable LEDs, voltage measurement, temperature sensor, and pushbuttons, to help you design for almost any application.

Since the Bx600 and BT900 modules are pre-certified Bluetooth End products, devices which integrate Bluetooth connectivity with them are pre-qualified and don’t require the time and expense of re-certification.