Thursday, 2 August 2018

Texas Instruments CC26x2 Launchpad

SimpleLink CC26x2R Wireless MCU Lauchpad Development Kit
UPDATE: Pre-production silicon versions earlier than Revision E (from Jan 2019 on) will only support CC26X2 SDK 2.30 and earlier (SDK available clicking here). Silicon revision E and later will only be compatible with CC26X2 SDK 2.40 and later. Production silicon is expected to be launched on early second quater 2019.

As defined in the project roadmap, in the first stage some technology will be developed in parallel to the definition of interfaces and protocols.

To do that it is necessary to choose a powerful yet flexible evaluation board that allowed developing and testing different devices (vehicle controller, discrete actuator,...)

Texas Instruments has recently launched a new SOC (System On Chip) called CC2652R with interesting features:
  • Supports wireless communications based on the protocol 802.15.4 (as Bluetooth Low Energy, Zigbee, Thread or raw 802.15.4)
  • Supports wired communications as RS-232, I2C or SPI
  • Supports a wide range of analog and digital IOs and sensors (as, for instance, PWM outputs)
  • Allows programming from a solid, free, environment (Code Composer Studio, or CCS) in C/C++ over real time operating systems (both Texas Instruments RTOS or FreeRTOS)
  • It has a small form factor (VQFN) and contained price (around 3$)
In order to "play" with this little wonder, Texas Instruments has launched too an evaluation board called Simplelink CC26x2R Launchpad (shown in the photo) that allows an optimal integration between the CC2652R MCU and the programming environment (Code Composer Studio) thanks to its included JTAG interface. As can be seen, the evaluation board allows access to most of the MCU IOs, specifically the mapping of these IOS is defined in this table:

GPIO Id Pin Type Description CC26x2 Launchpad mapping Launchpad usage User usage
DIO_0 5 Digital Sensor controller DIO0 - DIO
DIO_1 6 Digital Sensor controller DIO1_RFSW ? ?
DIO_2 7 Digital Sensor controller UART(0)_RX UART -
DIO_3 8 Digital Sensor controller UART(0)_TX UART -
DIO_4 9 Digital Sensor controller I2C_SCL I2C interface -
DIO_5 10 Digital Sensor controller, high drive I2C_SDA I2C interface -
DIO_6 11 Digital Sensor controller, high drive PIN_RLED, PWMPIN0 Launchpad red led, PWM0 DIO high drive (removing Launchpad led jumpers)
DIO_7 12 Digital Sensor controller, high drive PIN_GLED, PWMPIN1 Launchpad green led, PWM1 DIO high drive (removing Launchpad led jumpers)
DIO_8 14 Digital SPI0_MISO SPI -
DIO_9 15 Digital SPI0_MOSI SPI -
DIO_10 16 Digital SPI0_CLK SPI -
DIO_11 17 Digital - Not used / Not documented ?
DIO_12 18 Digital DIO12, LCD_EXTCOMIN Sharp LCD boosterPack -
DIO_13 19 Digital PIN_BTN1 Launchpad button 1 -
DIO_14 20 Digital PIN_BTN2 Launchpad button 2 -
DIO_15 21 Digital DIO15 - DIO
DIO_16 26 Digital JTAG_TDO, high drive DIO16_TDO - DIO high drive
DIO_17 27 Digital JTAG_TDI, high drive DIO17_TDI - DIO high drive
DIO_18 28 Digital UART(0)_RTS JTAG UART UART (removing JTAG Rx/Tx jumpers)
DIO_19 29 Digital UART(0)_CTS JTAG UART UART (removing JTAG Rx/Tx jumpers)
DIO_20 30 Digital SPI_FLASH_CS SPI -
DIO_21 31 Digital DIO_21 - DIO
DIO_22 32 Digital DIO_22, LCD_ENABLE Sharp CLD boosterPack -
DIO_23 36 Digital/Analog Sensor controller, analog DIO23_Analog, LCD_POWER Sharp CLD boosterPack -
DIO_24 37 Digital/Analog Sensor controller, analog DIO24_Analog, LCD_CS Sharp CLD boosterPack -
DIO_25 38 Digital/Analog Sensor controller, analog DIO25_Analog - Analog
DIO_26 39 Digital/Analog Sensor controller, analog DIO26_Analog - Analog
DIO_27 40 Digital/Analog Sensor controller, analog DIO27_Analog - Analog
DIO_28 41 Digital/Analog Sensor controller, analog DIO28_Analog - Analog
DIO_29 42 Digital/Analog Sensor controller, analog DIO29_Analog - Analog
DIO_30 43 Digital/Analog Sensor controller, analog DIO30_Analog - Analog

The evaluation board pricing is around 40$ and, together with the fantastic CC26X2 Software Development Kit (available for Windows, Linux and MacOS) and Texas Instrument online developer tools allows start developing code in a record time.

This evaluation board together with all the defined software is chosen as technological resource for developing the LItems on the Elbert project

Some detailed photos of the evaluation board can be seen below:

TI SimpleLink CC26x2R Wireless MCU LaunchPad
General evaluation board view, with CC2652R MCU on first plane
TI SimpleLink CC26x2R Wireless MCU LaunchPad
Detail of the CC2652R MCU, its small size can be appreciated by comparing it with the left jumpers
TI SimpleLink CC26x2R Wireless MCU LaunchPad
Detail of the CC2652R MCU. At right and left the pins giving access to the MCU IOs can be seen
TI SimpleLink CC26x2R Wireless MCU LaunchPad
JTAG interface, on first plane the microUSB connector and reset button. The CC2652R MCU can be fully isolated from the onboard JTAG by removing all the jumpers on the photo, allowing both using external JTAG or using the onboard JTAG with other MCUs

Thursday, 26 July 2018

Upgrading a Digi Connectport X2 from Zigbee to 802.15.4 coordinator

Digi ConnectPort X2 coordinator
In order to create a star topology XBee/802.15.4 network, a coordinator is necessary. That coordinator will be the responsible of managing some aspects of the network and, optionally, acting as gateway to other networks.

I own an old Digi Connectport X2 with ZB firmware, therefore suitable to act as a coordinator of a Zigbee network. This device has an ethernet port that, properly configured, allows sending and receiving radio network packets to or from a TCP/UDP connection, what is really useful in order to make tests from any computer able to access to the ethernet gateway port.

Since I need to form not a Zigbee but a 802.15.4 network, some changes are necessary in order to convert the Connectport X2 Zigbee coordinator into a 802.15.4 coordinator. These are the steps to be done: Upgrading the X2 gateway and Xbee PRO radio module firmwares or, in the last case, replacing the radio module by a 802.15.4 compliant module.

Upgrading the X2 gateway firmware

In order to get the proper firmware, go to the Digi Support Page, "Firmware updates" section and search "Connectport X2 - 802.15.4 - Ethernet" (link here). In case that the installed version was older than the available versions, the best is updating first the POST firmware and then updating the Connectport X2D (that was the exact name of my gateway firmware) firmware. Both the POST and the gateway installed firmwares can be checked in the Gateway "Administration/System information" page. In this case I updated the firmwares to version 1.1.3 release 82002548_B for POST and version 2.17.1.2 release 82002549_G1 04/20/2017 for gateway firmware.

Upgrading the Xbee PRO radio module

After upgrading the gateway firmware, it is necessary upgrading the radio module. The way to do depends on the installed radio module:
  • If the gateway contains a Xbee Pro S2(B) module, it is not compatible with the 802.15.4 firmware and therefore it must be replaced by another, 802.15.4 compatible, radio module. The valid options are two:
    • Replacing it by a Xbee Pro S1 module: it is old, expensive and it will become deprecated on December 2018, so it is not a good option to buy one.
    • Replacing it by a Xbee Pro S2C module: better and cheaper than the S1 module, it is compatible with Connectport X2D from firmware version 2.17.1.1, so upgrading the gateway firmware to that version (or higher) is necessary.
  • If the gateway contains a Xbee Pro S2C module, just upgrade the firmware by downloading the latest from the Digi support page (go to the Digi Support Page, "Firmware updates" section and search "XBee / XBee-PRO S2C 802.15.4 Modules", link here). The usual firmware option should be that containing "TH" (through hole) in its name, that is addressed to the Xbee Pro through hole modules that usually are mounted in the X2 gateways. However, in case of trying to upgrade the module with a wrong firmware, the gateway will generate an error and the process will be aborted, so no risk in this step in case of choosing the wrong firmware.
In order to know the radio module used by the gateway, open a session via the gateway web interface and go to Configuration/Xbee Network/Gateway Firmware Update and check the radio type: If it is "Xbee-PRO XNet 2.5 / ZB / SE (0x1a47)" your gateway contains a Xbee Pro S2 radio module, being 0x1a47 the radio module hardware version. If not sure, the last option is just opening the gateway enclosure and checking the installed radio module.