Close

Porting Arduino language to the Z-Wave chip

A project log for Z-Uno

Z-Wave IoT Development Board

Poltorak SergueiPoltorak Serguei 08/19/2017 at 13:200 Comments

Z-Uno is based on the Z-Wave ZM5101 chip (manufactured by Sigma Designs). ZM5101 belongs to 8051 family and there are only few good compilers for that platform. All Z-Wave devices uses a very powerful, but complex and expensive Keil compiler. This makes development of Z-Wave IoT devices pretty hard.

To allow using Arduino IDE for your development we had to provide an alternative free compiler still making all the Z-Wave radio transmission job under the hood.

After a long investigation we have decided to pick up free and open source sdcc compiler and use it to compile user part of the code. At the same time all the Z-Wave magic is still done in our bootloader code that is compiler using Keil with Z-Wave SDK. This bootloader works with the internal RF module, handles Z-Wave network management, packet transmission and most of service communications. Your sketch is responsible for the peripherals (like in Arduino) and operation logic (what to turn on/off, where and when to send events from sensors).

And here the magic begins! We have two binary firmwares compiled using different compilers (even having different ABI) and executed on a single chip. That was a kind of funny trick to make them love each other. Think of if as a one process operating system: our bootloader code provides system calls to your sketch code.

For those who are interested in those tricks, we wrote a very descriptive article on the underhood magic: https://habrahabr.ru/post/313898/ (use google translate to read it in English).

Discussions