Design a Low-Power System in 2013

A few months ago, we listed the top design projects from the Renesas RL78 Green Energy Challenge. Today, we’re excited to announce that Circuit Cellar‘s upcoming 25th anniversary issue will include a mini-challenge featuring the RL78. In the issue, you’ll learn about a new opportunity to register for an RL78/G14 demonstration kit that you can use to build a low-power design.

Renesas RL78

The RL78/G14 demonstration kit (RDK) is a handy evaluation tool for the RL78/G14 microcontrollers. Several powerful compilers and sample projects will be offered either free-of-charge (e.g., the GNU compiler) or with a code-size-limited compiler evaluation license (e.g., IAR Systems).  Also featured will be user-friendly GUIs, including the Eclipse-based e2studio.

RL78G14 RDK KIT

  • 32-MHz RL78/G14 MCU board with integrated debugger and huge peripheral, including Wi-Fi, E Ink display, matrix LCD, audio ports, IR ports, motor control port, FET and isolated triac interfaces
  •  256-KB On-chip flash
  • USB Debugger cable
  • Four factory demos showcasing local and cloud connectivity through Wi-Fi

The CC25 anniversary issue is now available.

Electrostatic Cleaning Robot Project

How do you clean a clean-energy generating system? With a microcontroller (and a few other parts, of course). An excellent example is US designer Scott Potter’s award-winning, Renesas RL78 microcontroller-based Electrostatic Cleaning Robot system that cleans heliostats (i.e., solar-tracking mirrors) used in solar energy-harvesting systems. Renesas and Circuit Cellar magazine announced this week at DevCon 2012 in Garden Grove, CA, that Potter’s design won First Prize in the RL78 Green Energy Challenge.

This image depicts two Electrostatic Cleaning Robots set up on two heliostats. (Source: S. Potter)

The nearby image depicts two Electrostatic Cleaning Robots set up vertically in order to clean the two heliostats in a horizontal left-to-right (and vice versa) fashion.

The Electrostatic Cleaning Robot in place to clean

Potter’s design can quickly clean heliostats in Concentrating Solar Power (CSP) plants. The heliostats must be clean in order to maximize steam production, which generates power.

The robot cleaner prototype

Built around an RL78 microcontroller, the Electrostatic Cleaning Robot provides a reliable cleaning solution that’s powered entirely by photovoltaic cells. The robot traverses the surface of the mirror and uses a high-voltage AC electric field to sweep away dust and debris.

Parts and circuitry inside the robot cleaner

Object oriented C++ software, developed with the IAR Embedded Workbench and the RL78 Demonstration Kit, controls the device.

IAR Embedded Workbench IDE

The RL78 microcontroller uses the following for system control:

• 20 Digital I/Os used as system control lines

• 1 ADC monitors solar cell voltage

• 1 Interval timer provides controller time tick

• Timer array unit: 4 timers capture the width of sensor pulses

• Watchdog timer for system reliability

• Low voltage detection for reliable operation in intermittent solar conditions

• RTC used in diagnostic logs

• 1 UART used for diagnostics

• Flash memory for storing diagnostic logs

The complete project (description, schematics, diagrams, and code) is now available on the Challenge website.

 

DIY Green Energy Design Projects

Ready to start a low-power or energy-monitoring microcontroller-based design project? You’re in luck. We’re featuring eight award-winning, green energy-related designs that will help get your creative juices flowing.

The projects listed below placed at the top of Renesas’s RL78 Green Energy Challenge.

Electrostatic Cleaning Robot: Solar tracking mirrors, called heliostats, are an integral part of Concentrating Solar Power (CSP) plants. They must be kept clean to help maximize the production of steam, which generates power. Using an RL78, the innovative Electrostatic Cleaning Robot provides a reliable cleaning solution that’s powered entirely by photovoltaic cells. The robot traverses the surface of the mirror and uses a high voltage AC electric field to sweep away dust and debris.

Parts and circuitry inside the robot cleaner

Cloud Electrofusion Machine: Using approximately 400 times less energy than commercial electrofusion machines, the Cloud Electrofusion Machine is designed for welding 0.5″ to 2″ polyethylene fittings. The RL78-controlled machine is designed to read a barcode on the fitting which determines fusion parameters and traceability. Along with the barcode data, the system logs GPS location to an SD card, if present, and transmits the data for each fusion to a cloud database for tracking purposes and quality control.

Inside the electrofusion machine (Source: M. Hamilton)

The Sun Chaser: A GPS Reference Station: The Sun Chaser is a well-designed, solar-based energy harvesting system that automatically recalculates the direction of a solar panel to ensure it is always facing the sun. Mounted on a rotating disc, the solar panel’s orientation is calculated using the registered GPS position. With an external compass, the internal accelerometer, a DC motor and stepper motor, you can determine the solar panel’s exact position. The system uses the Renesas RDKRL78G13 evaluation board running the Micrium µC/OS-III real-time kernel.

[Video: ]

Water Heater by Solar Concentration: This solar water heater is powered by the RL78 evaluation board and designed to deflect concentrated amounts of sunlight onto a water pipe for continual heating. The deflector, armed with a counterweight for easy tilting, automatically adjusts the angle of reflection for maximum solar energy using the lowest power consumption possible.

RL78-based solar water heater (Source: P. Berquin)

Air Quality Mapper: Want to make sure the air along your daily walking path is clean? The Air Quality Mapper is a portable device designed to track levels of CO2 and CO gasses for constructing “Smog Maps” to determine the healthiest routes. Constructed with an RDKRL78G13, the Mapper receives location data from its GPS module, takes readings of the CO2 and CO concentrations along a specific route and stores the data in an SD card. Using a PC, you can parse the SD card data, plot it, and upload it automatically to an online MySQL database that presents the data in a Google map.

Air quality mapper design (Source: R. Alvarez Torrico)

Wireless Remote Solar-Powered “Meteo Sensor”: You can easily measure meteorological parameters with the “Meteo Sensor.” The RL78 MCU-based design takes cyclical measurements of temperature, humidity, atmospheric pressure, and supply voltage, and shares them using digital radio transceivers. Receivers are configured for listening of incoming data on the same radio channel. It simplifies the way weather data is gathered and eases construction of local measurement networks while being optimized for low energy usage and long battery life.

The design takes cyclical measurements of temperature, humidity, atmospheric pressure, and supply voltage, and shares them using digital radio transceivers. (Source: G. Kaczmarek)

Portable Power Quality Meter: Monitoring electrical usage is becoming increasingly popular in modern homes. The Portable Power Quality Meter uses an RL78 MCU to read power factor, total harmonic distortion, line frequency, voltage, and electrical consumption information and stores the data for analysis.

The portable power quality meter uses an RL78 MCU to read power factor, total harmonic distortion, line frequency, voltage, and electrical consumption information and stores the data for analysis. (Source: A. Barbosa)

High-Altitude Low-Cost Experimental Glider (HALO): The “HALO” experimental glider project consists of three main parts. A weather balloon is the carrier section. A glider (the payload of the balloon) is the return section. A ground base section is used for communication and display telemetry data (not part of the contest project). Using the REFLEX flight simulator for testing, the glider has its own micro-GPS receiver, sensors and low-power MCU unit. It can take off, climb to pre-programmed altitude and return to a given coordinate.

High-altitude low-cost experimental glider (Source: J. Altenburg)

AC Tester Schematic Update

An error was found in one of the AC tester schematics that ran in Kevin Gorga’s June 2012 article, “AC Tester” (Circuit Cellar 263). As a reader indicated, T2 is disconnected in the published version of the schematic. An edited schematic follows.

Edited version of Figure 2 in K. Gorga’s June 2012 article, “AC Tester” (Source: Paul Alciatore)

The correction is now available on Circuit Cellar‘s Errata, Corrections, & Updates page.

DIY, Microcontroller-Based Battery Monitor for RC Aircraft

I’ve had good cause to be reading and perusing a few old Circuit Cellar articles every day for the past several weeks. We’re preparing the upcoming 25th anniversary issue of Circuit Cellar, and part of the process is reviewing the company’s archives back to the first issue. As I read through Circuit Cellar 143 (2002) the other day I thought, why wait until the end of the year to expose our readers to such intriguing articles? Since joining Elektor International Media in 2009, thousands of engineers and students across the globe have become familiar with our magazine, and most of them are unfamiliar with the early articles. It was in those articles that engineers set the foundation for the development of today’s embedded technologies.

Over the next few months, I will highlight some past articles here on CircuitCellar.com as well as in our print magazine. I encourage long-time readers to revisit these articles and projects and reflect on their past and present use values. Newer readers should not regard them as simply historical documents detailing outdated technologies. Not only did the technologies covered lead to the high-level engineering you do today, many of those technologies are still in use.

The article below is about Thomas Black’s “BatMon” battery monitor for RC applications (Circuit Cellar 143, 2002). I am leading with it simply because it was one of the first I worked on.

For years, hobbyists have relied on voltmeters and guesswork to monitor the storage capacity of battery packs for RC models. Black’s precise high-tech battery monitor is small enough to be mounted in the cockpit of an RC model helicopter. Black writes:

I hate to see folks suffer with old-fashioned remedies. After three decades of such anguish, I decided that enough is enough. So what am I talking about? Well, my focus for today’s pain relief is related to monitoring the battery packs used in RC models. The cure comes as BatMon, the sophisticated battery monitoring accessory shown in Photo 1.

Photo 1: The BatMon is small enough to fit in most RC models. The three cables plug into the model’s RC system. A bright LED remotely warns the pilot of battery trouble. The single character display reports the remaining capacity of the battery.

Today, electric model hobbyists use the digital watt-meter devices, but they are designed to monitor the heavy currents consumed by electric motors. I wanted finer resolution so I could use it with my RC receiver and servos. With that in mind, a couple of years ago, I convinced my firm that we should tackle this challenge…My solution evolved into the BatMon, a standalone device that can mount in each model aircraft (see Figure 1).

Figure 1: Installation in an RC model is as simple as plugging in three cables. Multiple point measurements allow the system to detect battery-related trouble. Voltage detection at the RC receiver even helps detect stalled servos and electrical issues.

This is not your typical larger-than-life Gotham City solution. It’s only 1.3″ × 2.8″ and weighs one ounce. But the BatMon does have the typical dual persona expected of a super hero. For user simplicity, it reports battery capacity as a zero to nine (0% to 90%) level value. This is my favorite mode because it works just like a car’s gas gauge. However, for those of you who must see hard numbers, it also reports the actual remaining capacity—up to 2500 mAH—with 5% accuracy. In addition, it reports problems associated with battery pack failures, bad on/off switches, and defective servos. A super-bright LED indicator flashes if any trouble is detected. Even in moderate sunlight this visual indicator can be seen from a couple hundred feet away, which is perfect for fly-by checks. The BatMon is compatible with all of the popular battery sizes. Pack capacities from 100 mAH to 2500 mAH can be used. They can be either four-cell or five-cell of either NiCD or NiMH chemistries. The battery parameters are programmed by using a push button and simple menu interface. The battery gauging IC that I used is from Dallas Semiconductor (now Maxim). There are other firms that have similar parts (Unitrode, TI, etc.), but the Dallas DS2438 Smart Battery Monitor was a perfect choice for my RC application (see Figure 2).

Figure 2: A battery fuel gauging IC and a microcontroller are combined to accurately measure the current consumption of an RC system. The singlecharacter LCD is used to display battery data and status messages.

This eight-pin coulomb counting chip contains an A/D-based current accumulator, A/D voltage convertor, and a slew of other features that are needed to get the job done. The famous Dallas one-wire I/O method provides an efficient interface to a PIC16C63 microcontroller…In the BatMon, the one-wire bus begins at pin 6 (port RA4) of the PIC16C63 microcontroller and terminates at the DS2438’s DQ I/O line (pin 8). Using bit-banging I/O, the PIC can read and write the necessary registers. The timing is critical, but the PIC is capable of handling the chore…The BatMon is not a good candidate for perfboard construction. A big issue is that RC models present a harsh operating environment. Vibration and less than pleasant landings demand that you use rugged electronic assembly techniques. My vote is that you design a circuit board for it. It is not a complicated circuit, so with the help of a freeware PCB program you should be on your way…The connections to the battery pack and receiver are made with standard RC hobby servo connectors. They are available at most RC hobby shops. You will need a 22-AWG, two-conductor female cable for the battery (J1), a 22-AWG, two-conductor male for the RC switch (J2), and a three-conductor (any AWG) for the Aux In (J3) connector…The finished unit is mounted in the model’s cockpit using double-sided tape or held with rubber bands (see Photo 2).

Photo 2: Here's how the battery monitor looks installed in the RC model helicopter’s cockpit. You can use the BatMon on RC airplanes, cars, and boats too. Or, you could adapt the design for battery monitoring applications that aren’t RC-related.

Thomas Black designs and supports high-tech devices for the consumer and industrial markets. He is currently involved in telecom test products. During his free time, he can be found flying his RC models. Sometimes he attempts to improve his models by creating odd electronic designs, most of which are greeted by puzzled amusement from his flying pals.

The complete article is now available.

Q&A: Ayse Kivilcim Coskun (Engineer, BU)

Ayse Kivilcim Coskun’s research on 3-D stacked systems has gained notoriety in academia, and it could change the way electrical engineers and chip manufacturers think about energy efficiency for years to come. In a recent interview, the Boston University engineering professor briefed us on her work and explained how she came to focus on the topics of green computing and 3-D systems.

Boston University professor Ayse Kivilcim Coskun

The following is an excerpt from an interview that appears in Circuit Cellar 264 (July 2012), which is currently on newsstands.

NAN: When did you first become interested in computer engineering?

AYSE: I’ve been interested in electronics since high school and in science and physics since I was little. My undergraduate major was microelectronics engineering. I actually did not start studying computer engineering officially until graduate school at University of California, San Diego. However, during my undergraduate education, I started taking programming, operating systems, logic design, and computer architecture classes, which spiked my interest in the area.

NAN: Tell us about your teaching position at the Electrical and Computer Engineering Department at Boston University (BU).

AYSE: I have been an assistant professor at BU for almost three years. I teach Introduction to Software Engineering to undergraduates and Introduction to Embedded systems to graduate students. I enjoy that both courses develop computational thinking as well as hands-on implementation skills. It’s great to see the students learning to build systems and have fun while learning.

NAN: As an engineering professor, you have some insight into what excites future engineers. What “hot topics” currently interest your students?

AYSE: Programming and software design in general are certainly attracting a lot of interest. Our introductory software engineering class is attracting a growing number of students across the College of Engineering every year. DSP, image processing, and security are also hot topics among the students. Our engineering students are very keen on seeing a working system at the end of their class projects. Some project examples from my embedded systems class include embedded low-power gaming consoles, autonomous toy vehicles, and embedded systems focusing on healthcare or security applications …

NAN: How did you come to focus on energy efficiency and thermal challenges?

AYSE: Energy efficiency has been a hot topic for embedded systems for several decades, mainly due to battery-life restrictions. With the growth of computing sources at all levels—from embedded to large-scale computers, and following the move to data centers and the cloud—now energy efficiency is a major bottleneck for any computing system. The focus on energy efficiency and temperature management among the academic community was increasing when I started my PhD. I got especially interested in thermally induced problems as I also had some background on fault tolerance and reliability topics. I thought it would be interesting to leverage job scheduling to improve thermal behavior and my advisor liked the idea too. Temperature-aware job scheduling in multiprocessor systems was the first energy-efficiency related project I worked on.

NAN: In May 2011, you were awarded the A. Richard Newton Graduate Scholarship at the Design Automation Conference (DAC) for a joint project, “3-D Systems for Low-Power High-Performance Computing.” Tell us about the project and how you became involved.

AYSE: My vision is that 3-D stacked systems—where multiple dies are stacked together into a single chip—can provide significant benefits in energy efficiency. However, there are design, modeling, and management challenges that need to be addressed in order to simultaneously achieve energy efficiency and reliability. For example, stacking enables putting DRAM and processor cores together on a single 3-D chip. This means we can cut down the memory access latency, which is the main performance bottleneck for a lot of applications today. This gain in performance could be leveraged to run processors at a lower speed or use simpler cores, which would enable low-power, high-performance computing. Or we can use the reduction in memory latency to boost performance of single-chip multicore systems. Higher performance, however, means higher power and temperature. Thermal challenges are already pressing concerns for 3-D design, as cooling these systems is difficult. The project focuses on simultaneously analyzing performance, power, and temperature and using this analysis to design system management methods that maximize performance under power or thermal constraints.

I started researching 3-D systems during a summer internship at  the Swiss Federal Institute of Technology (EPFL) in the last year of my PhD. Now, the area is maturing and there are even some 3-D prototype systems being designed. I think it is an exciting time for 3-D research as we’ll start seeing a larger pool of commercial 3-D stacked chips in a few years. The A. Richard Newton scholarship enabled us to do the preliminary research and collect results. Following the scholarship, I also received a National Science Foundation (NSF) CAREER award for designing innovative strategies for modeling and management of 3-D stacked systems.

The entire interview appears in Circuit Cellar 264  (July 2012).

DesignSpark chipKIT Challenge 2012 Winners Named

The results for the DesignSpark chipKIT Challenge are now final. Dean Boman won First Prize for his chipKIT-based Energy Monitoring System, which provides users real-time home electrical usage data. A web server provides usage tracking on a circuit-by-circuit basis. It interfaces with a home automation system for long-term monitoring and data logging.

Dean Boman's Energy Monitoring System (Source: D. Boman)

Second prize went to Raul Alvarez for his Home Energy Gateway consumption monitor, which features an embedded gateway/web server that communicates with “smart” devices.

Raul Alvarezs Home Energy Gateway (Source: R. Alvarez)

Graig Pearen won Third Prize for his PV Array Tracker (Sun Seeker) project, which tracks, monitors, and adjusts PV arrays based on weather conditions.

Graig Pearen's PV Array Tracker (Source: G. Pearen)

Click HERE for a list of all the winners. You can review their project abstracts, documentation, schematics, diagrams, code, and more.

Participants in the competition were challenged develop innovative, energy-efficient designs with eco-friendly footprints. Entries were required to include an extension card developed using the DesignSpark PCB software tool and the Microchip Max32 chipKIT development board.

According to the documentation on the design challenge site:

The chipKIT™ Max32™ development platform is a 32-bit Arduino solution that enables hobbyists and academics to easily and inexpensively integrate electronics into their projects, even if they do not have an electronic-engineering background.

The platform consists of two PIC32-based development boards and open-source software that is compatible with the Arduino programming language and development environment. The chipKIT™ hardware is compatible with existing 3.3V Arduino shields and applications, and can be developed using a modified version of the Arduino IDE and existing Arduino resources, such as code examples, libraries, references and tutorials.

The chipKIT™ Basic I/O Shield (part # TDGL005) is compatible with the chipKIT™ Max32™ board, and offers users simple push buttons, switches, LEDs, I2C™ EEPROM, I2C temperature sensor, and a 128 x 32 pixel organic LED graphic display.

 

Click HERE for a list of all the winners. You can review their project abstracts, documentation, schematics, diagrams, code, and more.

Circuit Cellar/Elektor Inc. is the Contest Administrator.

The Renesas RL78 for Low-Power Applications

Renesas Technology announced in late March he start of a design challenge for engineers around the world: develop an innovative, low-power application using the RL78 MCU and IAR Systems toolchain. To get started, you need to familiarize yourself with the RL78. Clemens Valens, Editor-in-Chief of Elektor online, introduces the RL78 in a comprehensive “The RL78 Microcontroller: An MCU Family for Low-Power Applications” (Circuit Cellar 261, 2012).

I’ve worked with Valens in various occasions, and had the pleasure of meeting him in 2011. He’s truly “an engineer’s engineer”: extremely embedded tech savvy, well-read, and inquisitive. Furthermore, I edited Circuit Cellar articles Valens wrote about diverse design projects, such as a virtual instrument interface and a scrolling LED message board. Thus, it’s clear to me that Valens understands the importance of designing high-quality, energy-efficient, systems—and doing so within budget. I trust you’ll find his introduction to the RL78 insightful and immediately applicable.

The RL78 Microcontroller: An MCU Family for Low-Power Applications

By Clemens Valens (Circuit Cellar 261, 2012)

The low-power 8/16-bit microcontroller (MCU) market is a bit of a warzone with several MCU manufacturers proposing “the industry’s lowest power solution.” In a YouTube video, Texas Instruments boasts a best active figure of 160 μA/MIPS for their MSP430 family. In application note AN1267, Microchip Technology claims 110 μA at “1 MHz Run” for their PIC16LF72X. And Renesas Electronics announced 70 μA at “1-MHz normal operation” on their RL78 product website.[1, 2, 3] The absence of justification on how exactly these figures were obtained makes comparing them rather useless. But then again, you don’t really have to because, as most low-power developers know from experience, if you don’t get the hardware and software design right, you will never attain the promised 20-year battery lifetime no matter how low the MCU’s active, sleep, or standby current may be. In this article, I will take a closer look at Renesas’s quickly expanding RL78 family to see what they offer that may help you create a low-power design.

Photo 1 - The Renesas RL78

THE RL78 FAMILY

The RL78 family of 16-bit MCUs currently has two branches, “generic” and “application specific,” but a third “display” branch is forthcoming. The generic branch contains the subfamilies G12, G13, and G1A, all based on the 78K core, and the G14, which is based on the R8C core. In the application-specific branch there is the 1A and F12. I am not sure about their core origins as these products are still very new and, at the time of writing, documentation is missing. It doesn’t really matter; from now on it is the new RL78 core for all. Since they share the same core, I will concentrate on the G13 for which I have a nice evaluation board (see Photo 1 and “The Renesas Demonstration Kit for RL78” sidebar).

Sidebar: Renesas Demonstration Kit

RL78/G13

This family comes in a large number of variants (I counted 182), with devices having from 20 up to 128 pins (see Figure 1). Note that the parts themselves are labelled R5F10xx. The differences between all these variants are, besides the package type, the amounts of flash memory (program and data) and RAM. Program flash memory starts at 16 KB and currently ends at 512 KB, data flash sizes can be 0, 4, or 8 KB and RAM is 2 KB for the small devices and up to 32 KB for the big ones.

Figure 1 - Diagram of 128-pin RL78/G13 devices

The CPU is 16-bit, but the internal memory architecture is 8 bit. Its 32 general-purpose registers are organized in four banks of eight and can be used as 8- or 16-bit registers. The memory-mapped special function registers (SFRs) that control the on-chip peripherals can be addressed per bit, per byte, or as 16-bit registers, depending on the register. A second set of SFRs, the extended or second SFRs, are available too, but they need longer instructions to be accessed.

For those who need to squeeze the maximum out of MCU performance, it may be interesting to know that the CPU offers a short addressing mode enabling you to access a page of 256 bytes with a minimum amount of code.

The maximum clock frequency of the processor is 32 MHz, but the hardware user’s manual, which is almost 1,100 pages, interestingly also boasts about the ultra-low-speed capabilities of the processor as it can run from a 32.768-kHz clock.

The RL78 core features 15 I/O ports, most of which are 8-bit wide. Port 13 is 2-bit wide and ports 10 and 15 are 7-bit wide. The port pins that are actually available depend on the device. Inputs and outputs are highly configurable. Inputs can be analog, CMOS, or TTL. Outputs can be CMOS or N-channel open drain. Pull-up resistors are available too. The exact configuration possibilities depend on the port pin, so consult the datasheet. Because of the many configuration options, it is possible to use the MCU in multi-voltage systems without level-shifting circuitry except for the occasional external pull-up resistor. The chip can be powered from 1.6 V to 5.5 V, the core itself runs from 1.8 V provided by an internal voltage regulator.

TIME MANAGEMENT

Several options are available for the MCU clock. When clock precision is not too important, the MCU can be run from its internal clock, up to 32 MHz, otherwise it is possible to connect an external crystal, resonator, or oscillator. An internal low-speed clock (15 kHz) is also available, but not for the CPU, only for the watchdog timer (WDT), the real-time clock (RTC), and the interval timer.

The timers of the RL78 are flexible and offer many functions. Depending on the pin size of the device, you can have up to 16 16-bit timers, grouped in two arrays of eight. Each timer (called a “channel”) can function as an interval timer, square-wave generator, event counter, frequency divider, pulse-interval timer, pulse-duration timer, and delay counter. For even more possibilities, timers can be combined to create monostable multivibrators or to do pulse-width modulation (PWM). This way, up to seven PWM signals can be generated from one master timer. If you need more timers but resolution is less important, you can split some 16-bit timers in two 8-bit timers (this is not possible with all timers). Timer 7 of array 0 is extra special as it features local interconnect network (LIN) network support (see below).

Aside from date and time keeping with alarms, the RTC also provides constant period interrupts at 2 Hz and 1 Hz and also every minute, hour, day, or month. A 1-Hz output is available on devices with 40 or more pins. For extra precision, the RTC offers a correction register for fine tuning the 32,768-kHz clock. Unsurprisingly, the RTC continues operation when the MCU is stopped.

Now that I mentioned Stop mode, a special interval timer peripheral enables wakeup from this mode at periodic intervals. This timer is also used for the analog-to-digital converter’s (ADC’s) Snooze mode. More on that later. With a clock frequency of 32,768 Hz, the lowest interval rate is 8 Hz (0.125 ms).

Yet another time-related peripheral on the RL78 is the buzzer controller (not available on 20-pin devices). This is a clock output destined at IR comms carrier generation, to clock other chips in a system or to produce sound from a buzzer. A gate bit enables modulation of this output in such a way that pulses always have the same width.

Finally, a WDT completes the timing peripherals. It has a special Window mode that limits the time frame during which you can reset the watchdog to a fraction of the watchdog interval (50%, 75%, or 100%). Resetting the watchdog counter outside the window results in a reset. The window is open in the second part of the interval. An interrupt can be generated when the WDT reaches 75% of its time-out value, (i.e., when the watchdog reset window is known to be open in all cases). Figure 2 illustrates the mechanism.

Figure 2 - Trying to reset the watchdog counter when the window is closed results in an internal reset signal

ADC

The ADC is of the 10-bit successive approximation type and can have up to 26 inputs. Several triggering options are provided, hardware and software, where hardware triggering means triggering by a timer module (timer channel 1 end of count or capture, interval timer, or RTC). The time it takes to do a conversion depends partly on the triggering mode. When input stabilization is not too much of an issue (i.e., when you don’t switch inputs) you can achieve conversion times of just over 2 μs.

Two registers enable comparing the ADC’s output to maximum and minimum values, producing an interrupt when the new value is either in or out of bounds. This function is also available in Snooze mode. In this mode, the processor itself is stopped and consumes very little power, but ADC conversions continue under control of the hardware trigger. When a conversion triggers an ADC interrupt, the processor can then wake up from Snooze mode and resume normal operation.

COMMUNICATIONS

The RL78 features multifunction serial units. The devices with 25 pins or less have one such unit, the others have two. Only serial unit 2 provides LIN bus support.

A serial unit can function in asynchronous UART mode, in synchronous CSI mode (three-wire bus with clock, data in and data out signals, master and slave mode supported), and in simplified (master-only) I²C mode. Again, depending on the device, you can have up to four UARTs or eight CSI and/or simplified I²C ports. Of course a mix is also possible. Full I²C is possible with the specialized I²C unit.

UART0 and UART2, CSI00 and CSI20 provide Snooze mode functionality similar to the ADC. In Snooze mode, these ports can be made to wake up on the arrival of incoming data without waking up the CPU. If the received data is interesting enough, it is also possible to wake up the CPU.

LIN communications are possible with UART2 together with Timer 7 of Array 0. The LIN bus is an inexpensive alternative to the CAN bus in automotive systems to control simple devices like switches, sensors, and actuators. LIN only uses one wire and is rather low speed (20 Kbps maximum). The timer takes care of the LIN synchronization issues and the UART performs the (de)serialisation of the data.

Full blown I²C communication is possible with the specialized I²C peripheral IICA. The 80-pin and more devices have two channels, the others only one. Communication speeds up to 20 MHz are permitted to enable I²C “fast mode” (3.5 MHz) and “fast mode plus” (10 MHz). This module is capable of waking up the CPU from Stop mode.

MATH ACCELERATORS

Of interest is the hardware multiplier and divider module intended for filtering and FFT functions. This module is capable of 16 × 16 bits signed and unsigned multiplications and divisions producing 32-bit results. It can also do 16 × 16 bit multiply-accumulate. We are talking about a module here, not an instruction, meaning that you have to load the operands yourself in special registers and get the result from yet another. The multiplication itself is done in one clock cycle, a division takes 16. The accumulate operation adds another cycle.

Another special math function is the binary-coded decimals (BCD) correction register that enables you to easily transform binary calculation results into BCD results.

DIRECT MEMORY ACCESS

To speed up data transport without loading the CPU, the RL78 core features direct memory access (DMA), up to four channels. DMA transfers up to 1,024 words of data (8 or 16 bit) to and from SFRs and RAM and they can be started by a range of interrupts (e.g., ADC, serial, timer). Although DMA transfers are done in parallel with normal CPU operation, it does slow down the CPU. For time-critical situations, it is possible to put a DMA transfer on hold for a number of clock cycles and let the CPU finish its job first.

INTERRUPTS

Interrupts are pretty standard on the RL78 and many sources are available. The “key interrupt” function on the other hand is less common. It provides up to eight (depending on the device, you guessed it) key or push button inputs that are ORed together to generate an interrupt on a key press (active low).

OPERATING MODES & SECURITY

Besides the aforementioned Stop and Snooze modes, the RL78 also provides a Halt mode. In this mode, the CPU is stopped but the clocks keep running, making a fast resume possible. In Stop mode, the clocks are stopped too reducing power consumption more than in Halt mode. Snooze mode is like Stop mode, but with one or more peripherals in a snoozing state, ready to wake up when something interesting happens. Interrupts can be used to wake up from Snooze, Stop, or Halt mode. A reset usually works too.

Reset, by the way, can have seven origins, three of which are related to safety functions: illegal instruction, RAM parity, and illegal memory access. Two others involve the power supply: power-on reset (POR) and low-voltage detection (LVD). All these reset options are needed to conform to the International Electrotechnical Commission (IEC) 60730-1 (“Automatic Electrical Controls for Household and Similar Use; Part 1: General Requirements”) and IEC 61508-SER (“Functional Safety of Electrical/Electronic/Programmable Electronic Safety-Related Systems”) safety standards. Since the RL78 is compliant, it also implements flash memory CRC checking, protections to prevent RAM and SFRs to be modified when the CPU stops functioning, an oscillator frequency-detection circuit, and an ADC self-test function.

The hardware used for the flash memory CRC check is also available as a general-purpose CRC module for user programs. It implements the standard CCITT CRC-16 polynomial (X^16 + X^12 + X^5 + 1).

The RAM guard function protects only up to 512 bytes, so be careful where you put your sensitive data.

FLASH & FUSES

Those familiar with the fuse bytes of PIC and AVR processors will be happy to know that the RL78 contains four of them, the option bytes that configure such things as the WDT, low-voltage detection, flash memory modes, clock frequencies, and debugging modes.

Flash memory is divided into two parts, program memory and data memory, and it can be programmed in-circuit over a serial interface. A boot partition is available too. This partition uses a kind of ping-pong mechanism called “boot swapping” to ensure that a valid bootloader is always programmed into the boot partition so that even power failures during bootloader programming will not harm the boot partition. A flash window function protects the memory against unintentionally reprogramming parts of it.

SOUNDING OFF

This concludes our voyage through the Renesas RL78 core. As you have seen, the RL78 offers many interesting peripherals all combined in a flexible low-power optimized design. Thanks to the integrated oscillator and other functions, an RL78 MCU can be used with very little external hardware, enabling inexpensive and compact designs. Once you master its Snooze mode and your low-power design skills, you can use this MCU family in battery-operated metering applications, for instance, but I am sure you can think of something more surprising.

Clemens Valens (c.valens@elektor.fr) is Editor-in-Chief of Elektor Online. He has more than 15 years of experience in embedded systems design. Clemens is currently interested in sound synthesis techniques, rapid prototyping, and the popularization of technology.

REFERENCES

[1] Texas Instruments, Inc., “Ultra-Low Power MSP430 – The World’s Lowest Power MCU,” 201.

[2] Microchip Technology, Inc., “AN1267: nanoWatt and nanoWatt XLP Technologies: An Introduction to Microchip’s Low-Power Devices,” 2009.

[3] Renesas Electronics Corp., “RL78 Family,” www.renesas.com/pr/mcu/rl78/index.html.

RESOURCES

International Electrotechnical Commission (IEC), “60730-1, Automatic Electrical Controls for Household and Similar Use; Part 1: General Requirements,” 2002.

———, “61508-SER, Functional Safety of Electrical/

Electronic/Programmable Electronic Safety-Related Systems,” 2010.

Renesas Electronics Corp., Renesas Rulz, “RL78/G13 Demonstration Kit,” www.renesasrulz.com/community/demoboards/rdkrl78g13.

For more information about the RL78 Family of microcontrollers, visit www.renesas.com.

For information about the 2012 Renesas RL78 Green Energy Challenge (in association with Elektor & Circuit Cellar), go to www.circuitcellar.com/RenesasRL78Challenge.

This article appears in Circuit Cellar 261 (April 2012).

 

 

Zero-Power Sensor (ZPS) Network

Recently, we featured two notable projects featuring Echelon’s Pyxos Pyxos technology: one about solid-state lighting solutions and one about a radiant floor heating zone controller. Here we present another innovative project: a zero-power sensor (ZPS) network on polymer.

The Zero Power Switch (Source: Wolfgang Richter, Faranak M.Zadeh)

The ZPS system—which was developed by Wolfgang Richter and Faranak M. Zadeh of Ident Technology AG— doesn’t require battery or RF energy for operation. The sensors, developed on polymer foils, are fed by an electrical alternating field with a 200-kHz frequency. A Pyxos network enables you to transmit of wireless sensor data to various devices.

In their documentation, Wolfgang Richter and Faranak M. Zadeh write:

“The developed wireless Zero power sensors (ZPS) do not need power, battery or radio frequency energy (RF) in order to operate. The system is realized on polymer foils in a printing process and/or additional silicon and is very eco-friendly in production and use. The sensors are fed by an electrical alternating field with the frequency of 200 KHz and up to 5m distance. The ZPS sensors can be mounted anywhere that they are needed, e.g. on the body, in a room, a machine or a car. One ZPS server can work for a number of ZPS-sensor clients and can be connected to any net to communicate with network intelligence and other servers. By modulating the electric field the ZPS-sensors can transmit a type of “sensor=o.k. signal” command. Also ZPS sensors can be carried by humans (or animals) for the vital signs monitoring. So they are ideal for wireless monitoring systems (e.g. “aging at home”). The ZPS system is wireless, powerless and cordless system and works simultaneously, so it is a self organized system …

The wireless Skinplex zero power sensor network is a very simply structured but surely functioning multiple sensor system that combines classical physics as taught by Kirchhoff with the latest advances in (smart) sensor technology. It works with a virtually unlimited number of sensor nodes in inertial space, without a protocol, and without batteries, cables and connectors. A chip not bigger than a particle of dust will be fabricated this year with the assistance of Cottbus University and Prof. Wegner. The system is ideal to communicate via PYXOS/Echelon to other instances and servers.

Pyxos networks helps to bring wireless ZPS sensor data over distances to external instances, nets and servers. With the advanced ECHELON technology even AC Power Line (PL) can be used.

As most of a ZPS server is realized in software it can be easily programmed into a Pyxos networks device, a very cost saving effect! Applications start from machine controls, smart office solutions, smart home up to Homes of elderly and medical facilities as everywhere else where Power line (PL) exists.”

Inside the ZPS project (Source: Wolfgang Richter, Faranak M.Zadeh)

For more information about Pyxos technology, visit www.echelon.com.

This project, as well as others, was promoted by Circuit Cellar based on a 2007 agreement with Echelon.

Living & Working Off the Grid

Interested in engineering your own solar panel system installation? If so, you’ve likely begun researching photovoltaic technology, construction materials, and test equipment on the Internet. Have you been satisfied with the information you’ve found? Probably not. There’s simply a scarcity of reliable electronics engineering advice out there about serious solar panel installation projects. Enter Circuit Cellar. Over the past several years, we’ve published articles by professional engineers about their own installations.

Three panels are wired in series and run into the MPPT controllers. Their capacity is 170 W each, 510 W total, to charge the batteries and put off running the generator. (Source: George Martin CC218)

So, before you get sidetracked with another 3-minute video or bullet-point tutorial, do yourself a favor and read columnist George Martin’s two-part article series “Living and Working Off the Grid.” Here’s an excerpt from Part 1:

“First, I’m an engineer—and an electrical one at that (except my degree is so old that it reads “DC ONLY!”). In addition, my neighbors in New Mexico already have systems up and running. Jeff and Pat live up the road in a handmade log home. Jeff is a former engineer for General Motors (Pontiac GTO, Avanti, and Saturn to his credit). That makes for some interesting discussions about how electronics will revolutionize the car industry, but I digress. He’s a mechanical engineer who doesn’t fully embrace all of this electrical stuff. He has a minimal system with four panels of about 150 W each. Another neighbor’s system has about 3 kW of panels. Armed with the idea that it could be done, I started to match up equipment with our requirements.

The equipment I selected falls into four main categories: solar panels, inverters, charge controllers, and batteries. In fact, you could consider each independently and not get too far off an ideal system. There are, however, some areas of concern when mating equipment from different manufactures, so I stayed with one manufacturer for the control devices.

SOLAR PANELS

Solar panels convert solar energy into electrical energy. Again, there is a lot of literature available about how this is accomplished. But what about some hard code conversion details? Standard test conditions require a temperature of 25°C and an irradiance of 1,000 W/m² with an air mass of 1.5 (AM1.5) spectrum. They correspond to the irradiance and spectrum of sunlight incident on a clear day on a sun-facing 37° tilted surface with the sun at an angle of 41.81° above the horizon. This condition approximately represents solar noon near the spring and autumn equinoxes in the continental U.S. with the surface of the cell aimed directly at the sun. Thus, under such conditions, a solar cell with a 12% efficiency and a 100 cm2 (0.01 m2) surface area can be expected to produce approximately 1.2 W of power.[1] This gives you an idea of what’s involved in rating and selecting solar panels. Look at the University of Western New Mexico’s weather site for solar radiation and you’ll get a feeling for the actual solar radiation for the area.

There is another consideration when selecting a panel, namely cost per watt. If you start looking, you will find panels of different wattages and different prices. In March 2004, I started a spreadsheet listing panels from 125 to 195. Note pricing from March 2004, purchased equipment in 2005, installed in 2006–2007, and operational in October 2007. Then, I added the costs different suppliers were charging for each panel and calculated a price/watt number.

My results range from $4.35 to $4.76 per watt. I estimated that I would need 3,000 W of panels, and came up with $13,320 for the cost of the BP Solar SX 170B.

More polysilicon is currently being used in solar panel manufacturing than all other usages combined, so this is big business. It also seems that the larger-power-rating panels command a higher price per watt. It is sort of like the CPU business where chips are speed graded and priced accordingly.

My cost estimates are a bit old, so you’ll need to run the numbers with today’s prices. Let me add that I found solar panels to be in tight supply, so when you begin your design, look to secure the panels at a good price early in the game.

The 3,000 W in my design was derived from the sun’s availability in the winter. Figure 2 represents the solar radiation for an actual cloudless winter day.

Figure 2: The actual solar radiation recorded by Western New Mexico University in Silver City about 30 miles to the west of the house site. (Source: George Martin CC 216)

The peak radiation is 600 W/m2. Let’s estimate that the shape of the curve is a sine function so that the area under the curve is its average value (2/pi, or 0.6366 times the peak value) multiplied by its width. So, that is 600 W/m2 × 0.6366 × 8 h (9 A.M. to 5 P.M.), or 3,055.7 Wh/m2. Therefore: Close to 10 kWh per day is good enough for the workshop, but not enough for the house when it’s built. And 3 kW of panels is what one neighbor is using.

We also need to account for cloudy days. The energy to run the workshop would need to come from the battery or backup generator. Another concern is hot summer days when the panel efficiency drops because of the heat. But the days are longer in the summer. Actually, it’s still a 24-hour day, but there is more available sunlight each day. I don’t have test results for summer generation (because I’m writing this in February 2008 after getting the system put together in October 2007), so stay tuned. The last point to watch out for in panel selection is cold weather open-circuit voltage going into the charge controller.

In the cold, with no current drawn, the open-circuit voltage of the solar panel will rise. If several panels are connected in series (for efficiency), this voltage may damage the input to the charge controller. This is a well-known situation and your equipment dealer will be able to guide you in this area.

INVERTERS

I must confess that I find inverters boring. They are not as exciting as solar panels, charge controllers, or even batteries. I thought I would not find much difference in available inverters and that probably was due to my lack of enthusiasm. I selected inverters from OutBack Power Systems. I wanted the inverter/charge controller combination to be from one manufacturer. As I looked at the literature, OutBack seemed to have covered all of the issues for my installation. I ended up with two OutBack VFX3648 inverters (see Photo 2).

Photo 2: The placement of the Outback System next to the feed into the normal house distribution panel. (Source: George Martin CC216)

They are 3.6 kW (continuous) with connections for a 48-V battery and vented. You will find vented and sealed inverters. I selected vented because they typically have a larger power rating and I’m not in a harsh environment.

Also, the inverters are located in an area that is protected from the elements. Another option is a fan on the inverter. The fan also gives you more capacity, but what will you do when the fan fails, and you know it will? Our system is a normal 220-V home application. So, there are two inverters, one for each phase. OutBack has a neat option that includes a transformer to supply the second phase so the second inverter can remain in a low-power operating mode. When the power requirements become large enough, the main inverter will signal the second (slave) inverter to start up and handle the increased load. This is a good setup for our application. We can install a normal commercial heating/cooling system and power up only the second inverter when the load is calling for it.

Click here to read the entire article series.

 

Radiant Floor Heating Zone Controller Project

Even if you aren’t interested in designing a radiant floor zoned heating system, you can study this innovative project and apply what you learn to any number of building control and automation applications. Dalibor Zaric’s Radiant Floor Heating Zone Controller is built around an NXP Semiconductors LPC2134 ARM processor that’s connected to an Echelon Pyxos chip. The project won Second Place in Echelon’s 2007 “Control Without Limits” design competition.

The heat zone controller system (Source: Echelon & Dalibor Zaric)

Zaric provides the following details in his project documentation:

“• Power supply to unit is 24VAC and controller has switching power supply to provide 24VDC for Pyxos network as well 5V for logic, there is 3.3V linear regulator as well.

• There are four relay with 24VAC output to power up thermoelectric zone valve on radiant floor heating manifold. These outputs are protected with 1.85A self resetting fuse to prevent overloading. This block has as well 24VAC/DC dry contact to provide a call for heat to boiler or optional zones pump.

• Pyxos power supply filter and Pyxos chip provides Pyxos network connection for future sensors and thermostats. Pyxos thermostat will be more cost effective than regular LONWorks sensors/thermostats.

• RS-485 driver will provide future Modbus connection for local touch screens or smart home systems with Modbus connections. There is end of line resistors enabled with the dip switches beside connector.

• 3150 Neuron board with 64K flash provides LONWorks connection to the controller.”

 

The heat zone controller diagram (Source: Echelon & Dalibor Zaric)

For more information about Pyxos technology, visit www.echelon.com.

This winning project, as well as others, was promoted by Circuit Cellar based on a 2007 agreement with Echelon.

 

Solid-State Lighting Solutions Project

Electronics system control, “green design,” and energy efficiency are important topics in industry and academia. Here we look at a project from San Jose-based Echelon Corp.’s 2007 “Control Without Limits” design competition. Designers were challenged to implement Pyxos technology in innovative systems that reduced energy consumption. Daryl Soderman and Dale Stepps (of INTELTECH Corp.) took First Prize for their Solid State Lighting Solutions project.

The Pyxos chip is on the board (Source: Echelon & Inteltech)

So, how does it work? Using the Pyxos FT network protocol, this alternative lighting project is a cost-effective, energy-efficient solution that’s well-suited for use in residential, commercial, or public buildings. You can easily embed the LED lighting and control system—which features SSL lighting, a user interface, motion detectors, and light sensors—in an existing network. In addition, you can control up to five zones in a building by using the system’s fully programmable ESB-proof touchpad.

Another view of the Pyxos chip is on the board (Source: Echelon & Inteltech)

 

For more information about Pyxos technology, visit www.echelon.com.

This winning project, as well as others, was promoted by Circuit Cellar based on a 2007 agreement with Echelon.

 

 

 

RFI Bypasssing

With GPS technology and audio radio interfaces on his personal fleet of bikes, Circuit Cellar columnist Ed Nisley’s family can communicate to each other while sending GPS location data via an automatic packet reporting system (APRS) network. In his February 2012 article, Ed describes a project for which he used a KG-UV3D radio interface rigged with SMD capacitors to suppress RF energy. He covers topics such as test-fixture measurements on isolated capacitors and bypassing beyond VHF.

Photo 2 from the Febuary article, "RFI Bypassing (Part 1)." A pair of axial-lead resistors isolate the tracking generator and spectrum analyzer from the components under test. The 47-Ω SMD resistor, standing upright just to the right of the resistor lead junction, forms an almost perfect terminator. (Source: Ed Nisley CC259)

Ed writes:

Repeatable and dependable measurements require a solid test fixture. Although the collection of parts in Photo 2 may look like a kludge, it’s an exemplar of the “ugly construction” technique that’s actually a good way to build RF circuits. “Some Thoughts on Breadboarding,” by Wes Hayword, W7ZOI, gives details and suggestions for constructing RF projects above a solid printed circuit board (PCB) ground plane.

You can read this article now in Circuit Cellar 259. If you aren’t a subscriber, you can purchase a copy of the issue here.