Skip to main content

nPZero G1S Development Kit User Guide

Introduction

The nPZero G1S Development Kit (DevKit) includes hardware and firmware source code facilitating efficient prototyping and development of applications based on the nPZero G1S power-saving IC. This kit combines ultra-low power consumption with autonomous operation, making it perfect for devices where energy efficiency is critical.

The kit can autonomously power up sensor peripherals, read data and wake up the system as needed. It manages the system without an active MCU host by taking over the controller role, powering down the host and autonomously handling power-up, configuration and reading of peripheral data from up to 4 sensors. When required, it will power up the host and return control based on user-defined rules.

This allows the host to remain off for longer periods while the system continues to detect and respond to events, conserving energy. It significantly reduces power consumption both in active and sleep modes when managing peripherals.

A PDF version of this document can be downloaded here.

Key features of the nPZero G1S Development Kit:

  • Compatible with one I2C host MCU;
  • Supports up to four peripheral sensors;
  • I2C and SPI supported for peripheral communication;
  • Flexible I/O pins can be used as interrupt inputs or trigger outputs;
  • Autonomous sensor polling with threshold-based triggers;
  • Ultra-low power operation;
  • Crystal oscillator with programmable clock output;
  • ADC with two channels: one internally connected to VBAT, and one external input on pin ADC_IN;
  • 128-byte internal SRAM for initialization commands for the peripherals;
  • Operates in a supply voltage range from 1.7 V to 3.6 V;
  • Operating temperature range is from -20°C to +70°C;
  • Integrated power switches allow power gating of the host and peripherals.

Hardware description

This section provides a detailed overview of the hardware components essential for the nPZero G1S Development Kit. The following descriptions cover key features, specifications and connections of each component, offering a comprehensive understanding of the role of the various hardware blocks within the system.

The Development Kit supports up to four I2C or SPI sensor peripheral boards, external interrupts and internal SRAM for peripheral initialization commands, making it suitable for a wide range of applications. In addition, an internal crystal oscillator with a dedicated clock output is available for precise timekeeping. A two-channel ADC in its turn can be used to monitor battery voltage and external input.

Hardware overview

The DevKit images illustrate the nPZero G1S Development Board (DevBoard), the STM32 MCU host and the sensor peripheral boards as shown in Figures 1, 2, 3 and 4. The MCU host is located at the centre of the DevBoard. It can also be replaced with other radio and MCU boards that utilize the same Arduino Uno compatible connectors. The MCU host has a 10-pin JTAG connector labelled as J1 which allows programming the MCU directly. Additionally, the kit includes a PMOD interface connector (J17) allowing manual connection of any compatible MCU or radio chip.

The SPI sensor peripheral board shown in Figure 3 and the I2C sensor peripheral board illustrated in Figure 4 can be connected to the corresponding PMOD connectors on the DevBoard. The PMOD connectors (J1-J4) allow connections for up to four different sensor boards. Any I2C or SPI compatible sensor boards using PMOD connectors can be connected in addition to the two provided peripheral boards. Furthermore, a connector (J14) is available for connection of an analog sensor.

devboard-3d
Figure 1: nPZero G1S Development Board

Block Diagram

The following block diagram provides a high-level overview of the DevKit system architecture, illustrating key components and their interconnections. This diagram explains the overall layout and each part of the system.

dk-block-diagram
Figure 5: nPZero G1S Development Kit Block Diagram

Host I2C

Communication between the MCU (also referred as "host" in this document) and the nPZero IC is handled over the I2C interface. During normal operation the nPZero IC operates as an I2C slave device supporting the Standard mode with communication speeds of up to 100 kHz. In this mode, the MCU host can read from and write to the available registers as well as the SRAM memory space of the nPZero IC.

Host UART

The MCU's UART (Universal Asynchronous Receiver-Transmitter) is a serial communication protocol commonly used for sending and receiving log data, making it useful for printing messages to a terminal application.

Peripherals

The PMOD connectors (J1-J4) on the DevBoard allow connection of up to four peripheral sensor boards. Additionally, the connector J14 is available for manually connecting an analog sensor.

Stackable connectors

The connectors J5A, J6A, J7A, and J8A are stackable connectors that follow the Arduino Uno R3 pinout standard. The connectors are located at the center of the DevBoard, through them the MCU host board is connected.

nPZero G1S IC

The nPZero G1S is a power-saving IC that can significantly decrease the power consumption of sensor applications where energy management is critical. Detailed information on technical specifications, structure and operation of the device can be found in the nPZero G1S datasheet.

Power sources

The DevBoard supports multiple power source options, providing flexibility to choose the most suitable power input.

  • Power Source Selection (Switch S1): Switch S1 is used to choose between three different power sources:

    • Top Position: Selects banana connectors J9 and J10 or pin header J11.
    • Middle Position: Selects USB connector J12.
    • Bottom Position: Selects coin cell battery J13.
  • Voltage Selection (Switch S2): This switch allows you to select the operating voltage for the system, either 1.8V or 3.3V.

Power switches

The switch S3 on the DevBoard enables manual selection and control of power distribution, as well as connection and disconnection of LEDs. It is configured with VBAT as the input voltage from the battery, SW_HP as the high-power switch output, and SW_LP [1-4] as the low-power switch outputs. The behavior of the power switch outputs (pins SW_LP [1-4]) can be set as a power output that can supply power directly to the peripheral or as a logic output (with configurable polarity) to control an external power switch. Additionally, each power switch includes output voltage detection, which can be enabled to ensure that peripheral communication only starts once the voltage at the switch output is close to the system supply.

Debug interface

The J15 debug connector on the DevBoard is a 10-pin connector used for debugging I2C and SPI interfaces. It is recommended to connect the Aardvark, Beagle, Cheetah or a similar debugger from Total Phase when using this interface for debugging. Through the switch S4 it is possible to select which SPI interface is currently being debugged.

Reset

The connector J16 is a 2-pin connector on the DevBoard that can be shorted with a jumper. When shorted, the MCU host can be used to reset the board. If there is a risk of current leakage into the MCU host when it is powered off, remove this jumper. Furthermore, switch S5 is a reset button on the DevBoard, used for resetting the entire board. The button S1 on the STM32 MCU host board can be used to reset the MCU exclusively.

LEDs

The LEDs on the DevBoard have a corresponding position on the switch S3 that can be toggled off to disconnect the LED. The LEDs on the sensor boards have a corresponding position on the switch S1 that can be toggled off to disconnect the LED to allow accurate measurements of system current consumption.

Development Kit contents

The nPZero G1S Development Kit (DevKit) provides the hardware necessary to evaluate and develop applications for the nPZero G1S chip, as well as access to software examples and documentation for the nPZero Driver API.

Hardware content

The DevKit contains the following hardware boards.

nPZero G1S Development Board

The DevKit includes the nPZero G1S Development Board (DevBoard) which features the nPZero G1S power-saving IC and can work with other boards in the kit.

devboard
Figure 6: nPZero G1S Development Board
MCU Host

The DevKit includes the STM32L053C8U6 MCU which can be easily connected to the carrier board via Arduino Uno compatible stackable connectors. This low-power MCU from STMicroelectronics can be used to test the benefits of the nPZero G1S power-saving IC. An onboard JTAG connector is used for programming the MCU.

stm-mcu
Figure 7: STM32L053C8U6 Host
Acceleration sensor

The DevKit includes the LIS2DW12 accelerometer from STMicroelectronics. This SPI sensor can be easily connected to the DevBoard through the Peripheral 1 or Peripheral 3 PMOD connectors.

spi-sensor
Figure 8: LIS2DW12 accelerometer
Temperature sensor

The DevKit includes the AS6212 temperature sensor from ams. This I2C sensor can be easily connected to the DevBoard through the Peripheral 2 or Peripheral 4 PMOD connectors.

i2c-sensor
Figure 9: AS6212 temperature sensor

Software content

The DevKit downloadable content includes access to example code for running the sensors bundled with the DevBoard on the STM32 host MCU. Additionally, it provides documentation for the nPZero Driver API. This driver offers an interface for the STM32 MCU host to control and manage the nPZero IC at the register level, allowing users to efficiently handle power-related functionalities in their applications. The downloadable content also includes a Hardware Abstraction Layer (HAL) for I2C operations, which can be modified by users to suit their specific hardware configurations. The nPZero Driver API can be downloaded from the Nanopower Semiconductor DevPortal here

Furthermore, a Graphical User Interface (GUI) tool called the nPZero Configurator is available to help you easily set up the device and its peripherals. This tool simplifies the configuration process by allowing you to adjust settings through an intuitive interface without manually writing the code. Once your setup is complete, the nPZero Configurator will automatically generate the necessary code for the API ensuring that everything is ready to be used. This makes the entire setup process faster, more efficient and user-friendly, especially for those who want to minimize manual coding efforts. The nPZero Configurator GUI can be accessed from the DevPortal here.

npz-config
Figure 10: nPZero Configurator GUI

Work requirements

Before proceeding to the next chapter, please ensure the required hardware and software prerequisites are available.

Hardware prerequisites

Assembling and flashing projects on the DevKit requires the following hardware:

  • nPZero G1S Development Kit;
  • Power source:
    • Coin cell battery, external power through USB-C or external power through banana connectors;
  • Segger J-LINK Debugger;
  • USB to UART adapter (e.g. FTDI TTL-232R-5V or FTDI TTL-232R-5V-WE).

Software prerequisites

Required hardware for developing and running projects on the DevKit includes:

  • STM32CubeIDE;
  • SEGGER J-Link Software;
  • nPZero Configurator;
  • nPZero Driver API;
  • Terminal application (e.g. PuTTY).

Example Code

The host MCU comes pre-flashed with example code out of the box, and it is recommended to test the pre-flashed example before building and flashing any other examples in order to ensure everything is set up correctly. To test the pre-flashed example, please go through the steps below:

Connecting the hardware

  1. Unpack the DevKit.

  2. Connect the host MCU to the DevBoard via the Arduino Uno compatible stackable connectors illustrated in Figure 12.

  3. Connect the J-LINK debugger to the JTAG connector on the host MCU indicated in Figure 12.

  4. Plug in a USB cable between the PC and the JTAG probe.

  5. Connect the FTDI cable to the MCU UART connector (J19) on the DevBoard, the pinout of the J19 connector is provided in Figure 11.

  6. Attach the USB side of the FTDI cable to the PC.

  7. Connect the J20 jumper to enable operation of D1-D6 LEDs on the DevBoard. Please note that LEDs D1-D6 indicate the connection of the following:

    • D1 - Power supply;
    • D2 - Host power switch;
    • D3 - Peripheral 1 power switch;
    • D4 - Peripheral 2 power switch;
    • D5 - Peripheral 3 power switch;
    • D6 - Peripheral 4 power switch.
  8. Verify that the J18 jumper is connected, providing power to the host MCU.

  9. To power up the board, you can choose one of the following options, as shown in Figure 12.

    • Connect a USB-C cable through the USB-C connector;
    • Connect an external power supply through the banana connectors;
    • Insert a coin cell battery.

Depending on which power option you chose, slide the power switch S1 to the corresponding option (1 is for banana connectors, 2 -- for USB-C, 3 -- for a battery), as presented in Figure 12.

devboard-j19-pinout
Figure 11: MCU UART connector J19 pinout
devboard-pinout
Figure 12: DevBoard and MCU host board pinout diagram

Assembly

After setting up the DevKit hardware, please follow the steps below to connect the accelerometer and temperature sensor, which are both required to run the standard example:

  1. Connect the accelerometer to the DevBoard using the PMOD 3 SPI connector as shown in Figure 13.

  2. Connect the temperature sensor to the DevBoard using the PMOD 4 I2C connector as shown in Figure 13.

db-w-acc-and-tmp-con
Figure 13: DevBoard with the accelerometer and temperature sensor connected

Displaying logs through a terminal emulator

The log output from the host MCU can be displayed in a terminal emulator such as PuTTY. Start the terminal emulator software and connect to the COM port being used with the following UART settings:

  • Baud rate: 115200;
  • 8 data bits;
  • 1 stop bit;
  • No parity;
  • No flow control.
con-com-putty
Figure 14: Connecting the COM port in the PuTTY terminal emulator
note

Note that it might be necessary to reset the DevBoard by pressing the RESET (S5) button to restart the nPZero and host MCU to get the COM device to be displayed in the terminal window correctly.

db-rec-as-com4
Figure 15: DevBoard recognized as COM4 displayed in PuTTY

Testing the pre-programmed example

Once the DevKit is assembled and the UART terminal is configured as described in the previous sections, reset the DevBoard and verify that the example is running as expected:

  • After reset D2 should be lit, while the log output from the host MCU should be printed to the terminal as shown in Figure 14
  • After a couple of seconds the host MCU should be disconnected, and D2 turned off.
  • The two sensors should be polled repeatedly, indicated by D5 and D6 blinking.
  • After seconds to minutes the host MCU should be woken up again, repeating the process from the top.
  • If one of the sensors were triggered, the respective temperature or accelerometer readings should be printed to the log.

Building and flashing the example code

This section details how to download, compile and flash the example from scratch, allowing you to change the code if needed. This includes essential steps for developing software for the STM32 host MCU using the STM32CubeIDE, which is the Integrated Development Environment for the STM32 MCU. It is a comprehensive development platform that simplifies the MCU configuration and programming processes. Follow these steps to import the source code in the STM32CubeIDE:

  1. Download STM32CubeIDE from https://www.st.com/en/development-tools/stm32cubeide.html

  2. Open STM32CubeIDE.

  3. Log in to your myST account by going to Help > STM32Cube updates > Connection to myST

    enter-st-account
    Figure 16: Entering ST account
  4. Download the example code and nPZero Driver API from https://dev.nanopowersemi.com/nPZero_Driver_API.html

  5. Open the project file shown in Figure 17 by double clicking it.

    open-project
    Figure 17: Opening the project file
  6. To create a run configuration for an nPZero project, right-click on nPZero_STM32 project name in Project Explorer view and select Run As > STM32 C/C++ Application as indicated in Figure 18

    run-code-example-stm
    Figure 18: Run the code example in STM32
    • Edit Configuration dialog will be opened.
  7. Go to the Debugger tab and select SEGGER J-LINK as a debug probe as presented in Figure 19

    setup-jlink
    Figure 19: Setting up J-Link as debug probe
    note

    Note that the host MCU needs to be powered when the STM32CUBE application is being flashed into the host, as indicated by the MCU LED indicator D2 on the DevBoard .

  8. To ensure the host MCU is enabled, connect the I2C_SCL (pin 3) and I2C_SDA (pin 4) lines of the PMOD MCU connector (J17) to disrupt the I2C communication between the nPZero and the host and prevent the host from being disabled by the nPZero.

  9. Just before flashing press the RESET (S5) button on the DevBoard to restart the nPZero and the host.

  10. After ensuring that both the D1 and D2 indicators on the DevBoard are on, as shown in Figure 20, the flashing can be executed.

  11. When the flash operation is completed, remove the connection between I2C_SCL and I2C_SDA to allow the host to communicate with the nPZero IC.

    enable-host-mcu-during-flash
    Figure 20: Enabling host MCU during flashing

Custom Project

To create a new custom project from scratch, please go through the steps described below. This chapter can also be used as a guide for adapting an existing project for use with the nPZero. In this case, simply skip the steps in Part 1. Project Setup and start instead at Part 2. Configure I2C.

STM32 System settings

  1. Project Setup

    • To start a new project, go to File > New > STM32 project.
      create-new-stm-proj
      Figure 21: Creating a new STM32 project
    • Select the desired STM32 device or board. As demonstrated below, the selected board is STM32L053C8U6.
      target-selector
      Figure 22: Target selector in STRM32CubeIDE
    • Click Next.
    • Enter the project name to set up the project.
      proj-setup
      Figure 23: Project setup
    • Click Next to open Firmware Library Package Setup page.
      fw-lib-package-setup
      Figure 24: Firmware library package setup
    • Click Finish to create the project.
    • As a result, the following dialog is displayed. Click Yes.
      stm32-cube-mx-opening
      Figure 25: STM32CubeMX perspective opening
    • When the project is created, the following STM32CubeMX perspective is opened with a window for configuring the peripherals.
      stm32-cube-mx
      Figure 26: STM32CubeMX
  2. Configure I2C

    • Under the Connectivity, select I2C1.
    • Choose I2C in Mode drop-down list.
    • Set the I2C mode to I2C (Standard Mode) and configure the I2C frequency to 100 kHz in Parameter Settings as depicted in Figure 27
    • Choose PB6 for SCL and PB7 for SDA as the pins for I2C1 in GPIO Settings.
      config-i2c
      Figure 27: Configure I2C
  3. Configure UART

    • Under Connectivity, select USART2.
    • Set USART2 mode to Asynchronous mode.
    • Adjust the parameter settings as shown in Figure 28
    config-uart
    Figure 28: Configure UART
  4. Configure GPIO LED toggling

    • Select pin PA12 and configure it as GPIO_Output to control the LED.
      sel-pa12-pin
      Figure 29: Selecting PA12 pin
    • Under System Core, select GPIO.
    • Adjust the GPIO configuration for PA12 as shown in Figure 30.
      cfg-gpio-for-led
      Figure 30: Configure GPIO for LED toggling
  5. Press Ctrl+S to generate the project, and then click Yes.

    gen-src-code
    Figure 31: Generate source code
  6. As a result, the following dialog is displayed. Click Yes.

    open-c-perspective
    Figure 32: Open C/C++ perspective
  7. Include the nPZero Driver API in the project. If the Driver is already downloaded, follow these steps:

    • Go to File > Import > General > File System, as illustrated in Figure 33.
      import-npz-driver-api
      Figure 33: Import nPZero Driver API
    • Click Next.
    • Import the nPZeroDriver API resources from the local file system into the created project choosing Drivers folder in the project, as shown in Figure 34 and then click Finish.
    import-file-system
    Figure 34: Import file system
  8. Go to Window > Show View > Other > Project Explorer as shown in Figure 35 to see some of the project files and folders.

    proj-explorer-view
    Figure 35: Project Explorer view
  9. Now, the nPZero Driver API is present in Project Explorer, as shown in Figure 36.

    proj-explorer
    Figure 36: Project explorer

nPZero IC configuration

  1. Open the nPZero Configurator, in Global Configuration window set Host power switch mode to Logic output (High when host enabled) as shown in Figure 37.

    gui-gen-cfg
    Figure 37: General configuration
  2. Set configurations for the connected sensor in the appropriate peripheral section depending on the type of sensor.

    The accelerometer is configured as follows:
    • The accelerometer can be connected to the PMOD 1 or PMOD 3 SPI connector. So, for example, for Peripheral 3 configuration, go to **Load > LIS2DW > (SPI) Sample every second, wake on X axis

      OK** as depicted in Figure 38.

    • Set Polling period for a desired value, e.g. 1 second.
    gui-load-acc
    Figure 38: Loading Peripheral Preset for the accelerometer
    The temperature sensor is configured as follows:
    • In Global Configuration section set Internal I2C pull-ups as Auto (disabled in sleep).

    • The temperature sensor can be connected to the PMOD 2 or PMOD 4 I2C connector. So, for example, to configure Peripheral 4, go to Load > AS6212 > Periodic read with wakeup > OK as demonstrated in Figure 39.

    • Set Polling period for a desired value, e.g. 2 seconds.

    • Turn off switches 2 and 3 on the S1 DIP switch on the temperature sensor board.

      gui-load-temp
      Figure 39: Loading Peripheral Preset for the temperature sensor

    Applied configuration changes will be represented accordingly in the nPZero Registers and Generated code windows as demonstrated in Figure 40.

    cfg-per-con
    Figure 40: Configuring Peripheral connector for the accelerometer
    • For the API implementation, make sure that Template for the generated code is set as Default (STM).
    • Press Save as and choose the same folder where STM32IDE project is located (Project name > Core > Src), replace the existing main.c file as shown in Figure 41.
  3. After the saving main.c file, the custom project can be flashed in the same way as instructed in Building and flashing the example code.

    save-main-c
    Figure 41: Saving main.c file