Moddable Four is the new ultra-low power development board for Embedded JavaScript developers from Moddable. Moddable Four pairs the ultra-low power Nordic nRF52 microcontroller with integrated BLE and an ultra-low power Sharp memory display in a compact module that can operate for up to a year, with the display on, using a coin cell battery.
Moddable Four's unique hardware combined with the Moddable SDK's ease-of-development invites Embedded JavaScript developers to imagine innovative new products. The production-ready software in the Moddable SDK makes bringing these ideas to life possible.
Motivation
At Moddable, we're always looking for opportunities to expand Embedded JavaScript into new frontiers. We've long been fascinated by the potential of JavaScript to simplify the notoriously difficult development of software for ultra-low power devices, like those powered by a coin cell battery. The nRF52 microcontroller from Nordic is a natural choice, an extremely energy-efficient microcontroller with built-in BLE, lots of RAM, and a high-performance CPU.
We prefer development boards with a screen because it makes products much easier for customers to operate. A screen is also invaluable during development, as it can show far more debugging information than the usual blinking LED. Unfortunately, we couldn't find a small off-the-shelf nRF52 development board that incorporates an ultra-low power screen. So, we created Moddable Four.
Hardware Highlights
The hardware components in Moddable Four have been carefully selected to support a wide range of uses while keeping power consumption to an absolute minimum.
The Nordic nRF52 microcontroller is well known for its energy efficiency. Moddable Four hardware has been carefully tested to ensure that its energy use matches the nRF52 specifications. The 64 MHz Cortex-M4 CPU delivers remarkable JavaScript performance, and the generous 256 KB of RAM means most projects won't encounter memory limitations. The built-in BLE radio supports both client and server (central and peripheral) roles.
Moddable Four contains a Sharp memory display. It requires very little energy to display an image (about 1 µA), but unlike ePaper displays, the Moddable Four display can animate at up to 60 FPS to support smoothly animated, highly responsive user interfaces.
For user interactions, Moddable Four incorporates a classic Jog Dial, once widely used by Sony. This compact user input device supports fast one-handed operation and uses almost no energy. While a touchscreen would be nice, the power consumption is generally prohibitive for an ultra-low power product.
Moddable Four includes an accelerometer, not primarily to determine the display's orientation, but for sophisticated power management. Because the accelerometer detects motion, it can tell whether Moddable Four is being held or is resting idle on a surface. Projects can use this information to automatically enter and exit energy saving modes.
For expandability, Moddable Four has 12 IO pins along the right side. Use these to connect sensors, displays, real-time clocks, buttons, LEDs, and other peripherals.
Software Highlights
We created the Moddable Four hardware for software developers to explore the possibilities of Embedded JavaScript on an ultra-low power microcontroller. The software that powers Moddable Four starts with the proven foundation of the Moddable SDK and adds new capabilities to support Moddable Four.
Our XS JavaScript engine is at the heart of Moddable Four's software, delivering the latest industry standard JavaScript programming language (ES2023) with a host of optimizations for memory use, code size, and performance. You can also develop in TypeScript and implement critical functions in native C.
Moddable Four supports the ECMA-419 standard for Embedded JavaScript APIs. This allows developers to use the same highly optimized APIs for IO on the nRF52 powered Moddable Four as they do on products powered by ESP32, ESP8266, and Raspberry Pi Pico. ECMA-419 support allows the Moddable SDK's suite of ECMA-419 sensor drivers to be used on Moddable Four. It also makes Moddable Four compatible with Node-RED MCU Edition.
We've created new JavaScript APIs for Power Management so projects can use the nRF52's energy saving features. For example, there are APIs to enter the lowest energy-use sleep modes and trigger wake-up using timers, digital inputs, and analog inputs. Projects can store data in persistent RAM while sleeping and power-down unused RAM banks. Using these JavaScript Power Management APIs, projects have the control needed to achieve optimal energy use.
The display in Moddable Four motivated major updates. Our Sharp display driver takes advantage of the generous memory of the nRF52, to support the optional frame buffer mode for faster, more energy efficient rendering. It also implements optional real-time dithering to allow grayscale images to be displayed using only black and white pixels. The display driver integrates with Piu, our powerful user interface framework. Piu has been optimized to reduce energy use with improvements to the animation scheduler.
Creating fonts that look readable and smooth on a monochrome display is difficult. A unique feature of the Moddable SDK's tools is the ability to optimize any OpenType or TrueType font for the Moddable Four's display. This is done automatically when building a project and supports most languages including Japanese, Chinese, and Korean.
Putting It All Together
Compelling IoT products are more than simply the combination of hardware components and software modules. Thoughtful design and careful engineering allow hardware and software to seamlessly work together to achieve the user's goals.
We created Moddable Four's First Run application to show just how much is possible when design brings together the hardware and software. First Run has an animated user experience built using dozens of software modules that exercises all the major hardware components on Moddable Four.
We wanted the experience of interacting with the First Run application to feel light and responsive. Because the display in Moddable Four is not that big, so we carefully designed the screens to feel big by minimizing the number of elements shown. We created a rotating menu system for the primary navigation to mirror the turning of the jog dial. The result looks great and responds so quickly it's easy to forget this is Embedded JavaScript running on a 64 MHz microcontroller.
The complete source code of First Run app is included in the Moddable SDK for you to learn from, enhance, and even use in your own projects.
Get Your Moddable Four!
Moddable Four is available now. The price of $26.99 is a great value. Other nRF52 development boards have a similar price but don't include an ultra-low power display, jog dial, accelerometer, and battery holder. We've kept the price low to make buying Moddable Four an easy decision for curious Embedded JavaScript developers.
When you receive your Moddable Four, you'll have immediate access to many resources to support you. You can use xs-dev to easily install the development tools, try out the many examples in the Moddable SDK, ask questions on our GitHub repository, refer to our extensive documentation, and learn from our book.