Showing posts with label hardware. Show all posts
Showing posts with label hardware. Show all posts

Tuesday, 5 January 2021

Montana: Arduino Nano33 IoT selected for Granite project

In order to develop the Montana Granite project, ie, a Litem based on Bluetooth Low Energy communication, a state-of-the-art in technology have been done. Through all the available modules in the market, two seemed the more promising:

Though the first one offered more flash to a lower price, the second one has been chosen by evaluating positively the stability and support of the Arduino products. Moreover, the Nano 33 is slightly smaller than the Expressif board.

A Nano 33 IoT board has been bought, the Arduino IDE has been installed and support to Microchip SAMD based boards has been added as explained here (specifically, the Nano 33 IoT board is based on a Microchip SAMD 21 SoC). 

The board pinout is similar to the previous Nano boards as can be checked here. A good getting-started project, based on the ArduinoBLE library, can be checked here. Lastly, though the BLE UUIDs should be defined as private, the list of assigned UUIDs can be checked here.

Tuesday, 11 February 2020

Setting the MAC address on a Texas Instrumens CC26x2

The MAC address of the TI CC2652 can be set as factory configuration or as customer configuration.

In the first case, and as stated in the CC26xx memory map, the address value is stored in the Factory Configuration Area (FCFG1), specifically in the registers MAC_15_4_0 and MAC_15_4_1, corresponding to the addresses  0x500012F0 (address offset 0x02F0) and 0x500012F4 (address offset 0x02F4).

In the second case (address set as customer configuration) the values are stored in the Customer Configuration Area (CCFG), specifically in the registers IEEE_MAC_0 and IEEE_MAC_1, corresponding to the addreses 0x50004FC8 (address offset 0x1FC8) and 0x50004FCC (address offset 0x1FCC).

Though in both cases the values stored in these addresses are read-only at runtime, the values stored in the Customer Configuration Area can be set in the firmware source code. By default, the CCFG IEEE_MAC_0 and IEEE_MAC_1 address values are defined in the Core SDK driverlib startup_files/ccfg.c file, and therefore set for all the developed applications through the macros SET_CCFG_IEEE_MAC_0 and SET_CCFG_IEEE_MAC_1, both set by default to 0xFFFFFFFF.

As the CCFG documentation states, in case of being set to 0xFFFFFFFF, the IEEE_MAC_0 and IEEE_MAC_1 values must be considered invalid and the FCFG1 MAC_15_4_0 and MAC_15_4_1 values must be used. In practice that means that if the user is not setting an specific MAC address, the default, factory MAC address will be used. This behaviour is coded in the main.c of most (fi not all) SDK examples.

Then, how the user can set the MAC address to an specific, user value? To do that, the macros SET_CCFG_IEEE_MAC_0 and SET_CCFG_IEEE_MAC_1 must be re-defined in the application-specific ccfg.c file. This file is empty by default and its purpose is, specifically, redefining CCFG macros with custom-user values. Specifically, SET_CCFG_IEEE_MAC_0 contains bits 31 to 0 of the MAC, whereas SET_CCFG_IEEE_MAC_1 contains bits 63 to 32.

Have in mind that the CCFG area will be only flashed if, apart of stating specific values as previously explained, the debugger flash settings are set to rewrite (not to keep) it. To proceed in that way uncheck the CCFG protection as shown in the image below. Have in mind that, once the user address was writen in CCFG, it is not necessary rewriting it every time the program changes, unless the whole address changed.


Last but not least, it is very important to consider that, in case of defining a user-specific MAC address, it must be considered as local (not universal) and therefore the second-least-significant-bit of the first octet must be set to 1. That means that the least significat byte of SET_CCFG_IEEE_MAC_0 must have its second bit set to 1 (for instance being set to 0x00000002).

If a Texas Instruments reserved universal MAC address is being used (converting it to local according to that explained in the previous paragraph), a list of the TI vendor-specific three first octects can be checked here. Notice that, since they are universal and not local, all the shown values have the second bit of the least significant byte set to 0.

As an example, if the reserved 0xFC0F4B universal address prefix is being used, first it must be converted from universal to local by setting to 1 the second bit of the least significant byte. In that way, the prevouls value would be converted to 0xFE0F4B. Taking it as base, a valid, local MAC address would be FE:0F:4B:00:00:00:00:01. Therefore, the SET_CCFG_IEEE_MAC_0 macro would be set to 0x004B0FFE and SET_CCFG_IEEE_MAC_1 would be set to 0x01000000.

Tuesday, 26 February 2019

Colorado: Accessing to 802.15.4 networks from Raspberry Pi. Hardware

Rasberry Pi B+ connected to a Digi Xbee 802.15.4 module
This document describes the integration between a Raspberry Pi and a Digi Xbee 802.15.4 module from a hardware perspective. The document is completed with the notes about the needed operations from a software perspective available here.

The objective of the Colorado project is developing a STEAM concentrator based on Raspberry PI accessing to a 802.15.4 network by using a Digi XBee module. To do that, it is necessary to connect the Raspberry with the Xbee module using a RS232 link, since both devices integrate at least one 232 serial port.

This document takes as base a Raspberry Pi board with a 40 pin connector (specifically RPi B+) and a Digi Xbee Pro S1 802.15.4 module. The description is suitable to be applied to any Digi Xbee module (S1, S2x, S3, standard or PRO) whenever the module specific power requirements were taken into account (see Powe Supply notes)

Serial connection

The modules connection can be simple, ie just by connecting the Tx-Rx lines, or can be more complex by connecting the hardware synchronization lines (RTS and CTS). In the first case a serial hardware control flow will NOT be feasible. Both wiring methods are covered in the next scheme, in which these connections can be seen:
  • Raspberry Tx output (pin 8) is connected to the Xbee DIN input (pin 3)
  • Xbee DOUT output (pin 2) is connected to the Raspberry Rx input (pin 10)
  • In order to provide hardware flow control support:
    • Raspberry RTS output (pin 11) is connected to the Xbee CTS input (pin 12)
    • XBee RTS output (pin 16) is connected to the Raspberry CTS input (pin 36)
Raspberry Pi - Digi Xbee connection diagram

If the hardware flow control option is being implemented, it will be necessary to allow Raspberry Pi to use its pins as RTS/CTS (disabled by default). To do that, follow the instructions defined in the VMW Productions site.

Power supply

Apart of the serial connection, it will be necessary to power the Xbee module from a supply generating, in case of using a Xbee S1 module, a voltage in the range 2,8V-3,4V and a max. current that will depend on the S1 module used, but that ranges from 50 to 340 mA (see power requirements on page 13 of the Xbee S1 User Manual) .

The Raspberry Pi uses four of its pins as power outputs (check full Raspberry Pi pinout here):
  • Pins 1 and 17 outputs 3,3V with a max current of 50mA. Though the voltage is in the Xbee voltage input range, the current is in the higher limit of the smallest module, so using this option is not recommended. Note, however, that in case of using a Xbee S2C (the standard version, NOT the pro version) the max current would be between 33 and 45 mA and therefore taking the power supply from these pins would be feasible.
  • Pins 2 and 4 outputs 5V with a max current up to 1500mA (depending on the RPi power supply). This current is suitable to power the Xbee module, but requires a voltage regulation.
In order to perform a voltage regulation, a TI TPS7A4700 regulator configured to output 3,3V is used. As can be seen in the previous schematic, the Raspberry Pi pin 2 output (+5V) is connected to the TPS7A4700 input, and its output (+3,3V) is connected to the Xbee module pin 1. To know more about the TI TPS7A4700, click here.


Friday, 15 February 2019

Litems based on ESP32 processors

ESP32 evaluation board
ESP32 is a series of low-cost, low-power SoCs integrating Wi-Fi and dual-mode Bluetooth that have become the reference when talking about IoT (Internet of Things) devices, what means in a broad way low cost devices with Internet communication features.

The ESP32 devices offer better features than the famous Arduino (native Wi-Fi/Bluetooth dual communication, size, processor, memory, price) while using (among others) the same programming environment (Arduno IDE), putting together better performance and easy programming.

The ESP32 becomes a really interesting option for developing Litems:
  • using BLE both overcomes the Classic Bluetooth piconet size (max. 7 bluetooth slaves connected) and allows developing the concentrator as a software layer on a BLE enabled device (Raspberry Pi 3, any modern tablet or laptop), 
  • it offers enough processor power for developing virtually anything, 
  • its cost and size are reduced, 
  • being based on Arduino IDE, the programming learning curve is really short (there are thousands of examples and tutorials in Internet).

For a "Getting started" guide, visit Random Nerd Tutorials site.
For full information, visit the ESP 32 site.

Update (01/21)

An interesting option regarding small footprint is the SiP (System in Package) ESP32-PICO-D4: it is really small and it keeps most of the features of the bigger ESP32 options.  It is available as kit starting from 5$ with a footprint of 52x21mm.

Compared with the Arduino Nano 33 BLE, the ESP32-PICO-D4 is considerably cheaper (starting from 5$, average 8$ vs 17',5€), it offers WiFi and more Flash (4Mb vs 1Mb), though the Nano 33 footprint is smaller (45x18mm).

Tuesday, 12 February 2019

Colorado: Voltage regulator for XBee Pro 802.15.4 module

TI TPS7A4700 voltage regulartor board
In order to access/manage the 802.15.4 network, a Digi XBee Pro module is being integrated with a Raspberry Pi, the device where the STEAM gateway will run.

This module has a typical voltage input of 3.3V, with a consumption that depends on many factors (versions, PRO features and running modes). In the case of the Xbee Pro S1 international version with RPSMA antenna connector (Digi part number XBP24-ASI-001J), the consumption when transmitting is 150mA, far from the 50mA that the Raspberry Pi GPIO-40 pin 1 outputs.

Is therefore necessary relying on a external power supply or taking the voltage from the Raspberry Pi GPIO-40 pins 2 or 4, that outputs 5V with currents up to 1,5A (depending on the Raspberry Pi PSU). In this last case, a voltage regulator is necessary.

For that purpose, a good option is using a versatile low noise TI TPS7A4700 that, depending on the pin configuration, can output different voltages with a wide input voltage range (3-36V) and a maximum output current of 1A.

The board shown in the photo supports that flexible output voltage configuration by shorting the numbered solder pads and adding to the default 1.4V the value shown in the pad. For instance, shorting the pads 0.4 and 3.2 you get 1.4 + 0.4 + 3.2 = 5V, or shorting the pads 0.1, 0.2 and 1.6 you get 1.4 + 0.1 + 0.2 + 1.6 = 3.3V. The maximum output voltage is 20V.

The shown board can be bought in the TekDevice online shop or eBay.

Monday, 11 February 2019

Colorado projects started

STEAM Colorado/Elbert projects
A new branch in the project repository addressed to develop two new subprojects has been created. The new subprojects are:
  • Litem (Mount) Elbert project, addressed to develop a set of Litems based on the Texas Instruments CC26x2 Lauchpad evaluation board (see evaluation board clicking here), using 802.15.4 as network protocol for communicating with the gateway. The code is localted in the subdirectory SteamProject/software/litems/802.15.4/ti-cc26x2-lp/elbert/ of the GitHub repository (direct access clicking here). Given that Elbert works will be developed on a evaluation board, all the results will be considered as experimental.
  • Gateway Colorado (river) project, addressed to develop a gateway running on Raspberry Pi (Raspbian OS) implementing 802.15.4 in the underlying network by integrating a Digi Xbee module as interface. The code is located in the subdirectory SteamProject/software/gateways/802.15.4/raspbian/colorado/ of the GitHub repository (direct access clicking here). Colorado source code will be developed in Java and the expected result will be potentially feasible to be put into production.
These two projects will run in parallel, since it is necessary their mutual integration to have a practical result (litem without gateway and viceversa is nonsense). However, even being closely related, it is important to state that the individual results will be compatible with the STEAM specification, ie, Elbert will be compatible with any STEAM 802.15.4 gateway and Colorado will be compatible with any STEAM 802.15.4 litem.

Since both the Colorado river and the mount Elbert have strong relationship with the Colorado state, the above icon is selected to represent graphically these two projects.

For detailed Elbert project information (description, planning and current status) click here. For detailed Colorado project information (description, planning and current status) click here.

Sunday, 10 February 2019

GitHub repository created

STEAM project GitHub repository
A repository for becoming the project cooperative sourcecode base has been created and is available on GitHub (link here).

A skeleton directory structure is being created as first step,  and the works on the wiki with the project documentation  are in progress.

The skeleton structure contains readme files in each level, indicating what is its purpose, ie, what is expected to be stored there.

A project naming methodology has been defined to allow multiple project coexistence while simplifying the selection of project names. In that way, the naming methodology states these rules:
  • Litem project will take the name of a world mountain.
  • Gateway projects will take the name of a world river.
  • Controller projects will take the name of a world lake.
  • Manager project will take the name of a world sea.

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