GPIO inputs

Inversed – By default, the firmware interprets the LOW state on the input pin as a pressed state of a button. If this option is enabled, the HIGH state means the pressed button.

Link – The input immediately controls the state of the corresponding output (e.g. Input 1 – Output 1). The device sends the on/off state of the output to a coordinator. Otherwise, the input is independent.

Long – The firmware detects and reports to the coordinator a long click (2000 ms).

Double – The firmware detects and reports a double click (max 500 ms between clicks).

Triple – The firmware detects and reports a triple-click (max 500 ms between clicks).

Switch – an input works as a switch. Only ON (pushed) / OFF (released) states.

Zigbee cluster: ZCL_CLUSTER_ID_GEN_MULTISTATE_INPUT_BASIC
Zigbee attribute: ATTRID_IOV_BASIC_PRESENT_VALUE
Data type: UINT8 (1 – single click, 2 – double click, 3 – tripple click, 4 – long press (more than 1500 ms))

GPIO outputs

Inversed – By default, the firmware sets the output pin to HIGH when a logical state is ON. You may invert that logic using this option.

Remember state – The firmware saves the output state to NVRAM and restores it after power off/on. Also, this option works for some sensors (counter, PWM)

Zigbee cluster: ZCL_CLUSTER_ID_GEN_ON_OFF
Zigbee attribute: ATTRID_ON_OFF.

Analog inputs (ADC)

You may define up to 8 analog inputs in the configuration. You must connect analog inputs to pins P00 .. P07.

The firmware reads analog values when it sends a periodic report to a host. When the periodic report is disabled you should send the “read” request for the configured endpoint.

Analog input, accurate (max 1.15V) – the pin uses internal reference voltage that is more precise than a source voltage.

Analog input, (max 3.3V) – less accurate, but it can measure higher voltage.

Source voltage – reports source power voltage. It can be used to monitor a battery level. You may assign this sensor to any unused pin.

Internal temperature – reports the temperature of the CC2530 chips. You may assign this sensor to any unused pin.

Zigbee cluster: ZCL_CLUSTER_ID_GEN_ANALOG_INPUT_BASIC
Zigbee attributes:
ATTRID_IOV_BASIC_PRESENT_VALUE – the sensor value (single precision float).
ATTRID_IOV_BASIC_DESCRIPTION – the value units (V – voltage, C – temperature).

UART

The UART interface is designed to send text or hex commands between an external device (e.g. Arduino) and a host.

The maximum command size is 127 bytes. Every command line may terminate with a special configurable byte: CR (0x0D), LF (0x0A) or 0x03 (ETX). The firmware also adds the ending signature to each of the commands that the device receives from a host and outputs to UART. If the end signature is not defined, the firmware waits 300 ms and outputs the whole buffer to a host.

UART uses P02 and P03 pins (3.3V). You should enable UART on P02 on an output pin in the configuration.

You can also select a baud rate for the UART interface in the firmware configuration.

UART configuration. P02 is required. P03 is optional.

Zigbee cluster: ZCL_CLUSTER_ID_GEN_MULTISTATE_VALUE_BASIC
Zigbee attributes: ATTRID_IOV_BASIC_STATE_TEXT – UART data. You should use the “ZCL_DATATYPE_OCTET_STR” (0x41) or “ZCL_DATATYPE_CHAR_STR” (0x42) data types for this attribute.

External sensors

The firmware supports up to 8 external sensors of different types. Keep in mind, that CC253x has limited performance. You cannot attach 8 sensors, 4 inputs, UART and get a good result. Some sensors cannot co-exist with each other.

Common Zigbee information for all external infomation:
Zigbee cluster: ZCL_CLUSTER_ID_GEN_ANALOG_INPUT_BASIC
Zigbee attributes:
ATTRID_IOV_BASIC_PRESENT_VALUE – the sensor value (single precision float).
ATTRID_IOV_BASIC_DESCRIPTION – the value units (V – voltage, C – temperature, % – humidity, m – altitude, ppm – air quality).
Zigbee commands: read

I2C sensors

You should define a pin for a sensor first. It is the SDA pin. Then you should define the SCL pin. For example, output 4 – BME280, and output 5 – I2C SCL.

I2C configuration for a sensor

Zigbee: Accepts the “read” commands on the endpoint for the first pin.

DS18B20

The firmware supports up to 4 sensors on one line. If you didn’t specify the sensor ID in the settings, the firmware sends all values to one endpoint but with a different description like “C,00-00-00-00-00” (unit, comma, device ID).

You may specify the same pin number, sensor type, and sensor ID on different endpoints. In this case, the firmware will send the sensor value to the corresponding endpoint.

Pulse generator

You may use this generator to wake-up Atmega-based external sensor. The external sensor should measure value and output it to a UART port.

Pulse counter

It is 32 bit counter with the 10 milliseconds debounce interval. Therefore it cannot be used for high-frequency signals. If an interval is defined, the counter automatically resets after that interval and reports the counted values to a coordinator.
Zigbee commands: read, write

MHZ19, Senseair S8

These sensors work in the UART mode and you should connect sensors to UART pins. Therefore you cannot use the UART interface in the same configuration. (CC2530 P0.2 -> MH-Z19 RX, CC2530 P0.3 -> MH-Z19 TX).

Bistable relay

You should define the ON pin first. For example, output 7 – Bistable relay ON, and output 8 – Bistable relay OFF.

Bistable relay configuration

Zigbee: Same as a GPIO output. Accepts the “read” commands on the endpoint for the first pin.

PWM

Software, 1 kHz – the firmware can generate the PWM signal on any pin. The frequency is about 1 kHz. The PWM duty cycle has 256 states (8 bits). You may configure up to 2 PWM outputs in the configuration.

Hardware, 1 MHz – the firmware uses the hardware PWM generator on the chip. The PWM duty cycle has 256 states (8 bits).

PWM #1 pins: P13, P14, P16, P17
PWM #2 pins: P10, P11, P20, P23

If a PWM output is linked to a corresponding input (e.g. Input 2 – Output 2) , the input can control the PWM value (10 steps, cyclic).

Zigbee cluster: ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL
Zigbee attributes: ATTRID_LEVEL_CURRENT_LEVEL (uint8)
Zigbee cluster: ZCL_CLUSTER_ID_GEN_ANALOG_INPUT_BASIC
Zigbee attributes: ATTRID_IOV_BASIC_PRESENT_VALUE (float, range: 0-255)
Zigbee commands: read, write


Comments
Harvey Specter
Posted at 07:38 May 25, 2020
Andreas
Reply
Author

Leave a Reply