Maury Wright is an electronics engineer turned technology journalist and industry consultant with broad experience in technology areas ranging from microprocessors to digital media to wireless to power management. Wright worked at EDN Magazine for 22 years – serving as Editor-In-Chief and Editorial Director for five years. Wright also served as Editor of the EE Times' Digital Home and Power Management web sites.
It's my great pleasure to introduce you to the Doctor Micro blog that I'll be writing. I know you may be thinking, "not another blog." But give me a minute and let me explain how Doctor Micro will be different and how it will help you do your MCU-based design work. My plan is to provide a steady flow of information on the Renesas RX MCU family while spawning a community that's quick to share ideas and help one another solve tough design problems. Ultimately, this blog will focus as much on design problems and applications as it does an MCU family.
I'm Maury Wright – Doctor Micro in this venue. I'm an engineer that became infatuated with early microprocessors and MCUs. For the past quarter century or so I've worked as a technology journalist. That gig has provided me with a front row seat to closely follow developments in processor architectures, the evolution of software tools, and the incredible rush along Moore's Law to integration levels I wouldn't have imagined possible.
I'll be posting to Doctor Micro on a regular basis. The plan is multiple posts each week. Early on I'll be focused on the Renesas RX architecture because the MCUs are just coming to market. I hope to quickly add blog posts based on discussions with engineers that are working hands-on with the MCU family – with you. I want to bring your experience to Doctor Micro, and spur an interactive commentary among the readers.
For the sake of full disclosure, I will be compensated by Renesas for the work I do on Doctor Micro. But Renesas is not guiding the topics I choose for discussion nor are they editing my work. Moreover the Renesas Rulz site where Doctor Micro lives is already a vibrant community for developers to share information and it operates outside of the Renesas corporate web site.
Lately, I've primarily focused on the architectural details of the RX microcontroller (MCU) series that provide performance advantages to design teams. Today let's go back and look at the development-tool issue. Renesas has a new RX610 Starter Kit that packs a formidable set of capabilities into a $250 package. The Kit includes a development board, a Renesas E1 emulator, and the Renesas High-performance Embedded Workshop (HEW) Integrated Development Environment (IDE).
The block diagram pasted below best describes the capabilities of the development board. The design includes an LCD module that is supplied as a detachable daughter card. There is a potentiometer provided for use with the integrated analog-to-digital converters (ADCs). You get a variety of switches and LED indicators for use in evaluation of the architecture.
The kit includes a power supply and all of the cables required to connect the development board to a host PC. You get the option of a RS232 serial connection or linking via USB and the E1 emulator.
We should review a couple of the tools included in the Kit such as the emulator. Renesas offers several options of debuggers and an in-circuit emulator for the RX. The E1 is meant as a tool that's sufficiently affordable that every member of a design team can have their own emulator. The E1 has internal trace capabilities for 256 branches or instruction cycles. The emulator alone sells for $150.
The Kit also includes an evaluation version of the HEW and the Flash Development Toolkit that offer full functionality for 60 days. After the evaluation period the tools still function, but you are limited to the size of projects that can be developed.
In an early post I discussed the capabilities of the HEW and how it's used across Renesas' MCU families. The HEW makes it simple to migrate to the RX from other supported MCUs such as the H8 family. Moreover the IDE includes a complete set of tools such as compilers and a debugger. In addition, many third-party tools integrate seamlessly into the HEW.
I'd also be remiss if I didn't remind you once again that Renesas is still offering the RX-Stick Evaluation Platform for free while supplies last. The RX-Stick lacks the robust features found in the Starter Kit but still provides a chance to evaluate the MCU and the HEW. You can register and request and RX-Stick at the Renesas web site.
It's been a while since we discussed software development tools for the Renesas RX family of microcontrollers (MCUs). But I suspect that we'll see a lot of third party activity in development tools with the Renesas DevCon around the corner. IAR Systems, for instance, just announced that the IAR Embedded Workbench integrated development environment (IDE) now supports the Renesas RX Application Binary Interface (ABI).
IAR was among the first third parties to support the RX architecture as I chronicled in this post on the Embedded Workbench, IAR's compiler, and PowerPac real-time operating system. Embedded teams can even download the tools for a free 30-day evaluation.
The latest news is important because it means that compiled code developed with Renesas and IAR tools can be mixed and matched. Libraries, drivers, and other software developed with Renesas tools can be used seamlessly in the Embedded Workbench.
IAR is known for generating an extremely small code footprint and the Embedded Workbench is the IDE of choice for some embedded design teams. Now those developers have full access to software developed by Renesas or other third parties.
Having mentioned the Renesas DevCon, I may as well take this opportunity to link to a prior post focused at the developers' event. I highlighted a number of the RX-centric sessions that will be offered at the conference. In fact IAR will present at a session focused on their compiler and the Embedded Workbench.
I've written several times on the subject of interrupt response time and described how the Renesas RX microcontrollers (MCUs) respond to interrupts. It's also important to exit interrupt service routines (ISRs) quickly. A fast exit time allows the MCU to return quickly to the application at hand and also is important when the MCU must service nested interrupts. So today we will take a look at how the fast interrupt feature of the RX and the ability to dedicated registers to an ISR can speed exit times.
The example I'll use here will build on the scenario that I described in a recent post on response to nested interrupts. Renesas application engineers had developed a test in which a timer integrated on the MCU generated an interrupt. Subsequently, a higher-priority external interrupt forces the MCU to exit the timer ISR so that it can service the external interrupt.
The code for the nested interrupt also provided an opportunity to measure the relative advantage of the fast interrupt feature and the use of dedicated registers. I've written previously and described the savings in CPU cycles attributable to the fast-interrupt function and dedicated registers. The fast-interrupt function can be assigned to one high-priority interrupt. It relies on dedicated PC (program counter) and PSW (processor status word) backup registers that eliminate the need to store the RC and PSW to memory. And the dedicated registers eliminate PUSH and POP instructions in the ISR.
The test of how these features speed exit time relied on the use of a scope to measure the time that an I/O signal is in a low state. The timer ISR sets the signal low. And the external interrupt drives the signal back high. The measurement is relative because the timer ISR had to include a delay loop to insure that the external interrupt triggered before the exits from the timer ISR.
First the engineers measured the exit time without the use of the features described above. Next the engineers repeated the test with the timer ISR set to use the fast-interrupt function. The exit required 20.42 nsecs less time with the fast-interrupt function applied to the ISR.
Next the engineers repeated the test with registers R10-R13 dedicated to the timer ISR. That allows the timer ISR to exit without POP operations to restore register values. With both the fast-interrupt function and the dedicated registers applied, the test revealed 80.3 nsecs faster exit time relative to the first test.
Embedded designs often require deterministic and speedy response to interrupts. The RX provides an additional value in lettering design teams cut response times even further for key interrupts.
The Dhrystone benchmark is widely used by microprocessor and microcontroller (MCU) vendors to specify performance and design teams have few other ways to quickly compare processor performance. So today let's take a bit deeper look at how you can run your own Dhrystone benchmarks guided by a new application (app) note. Moreover we'll review some performance numbers from prior Doctor Micro blog posts covering the Renesas RX MCU.
One of the first Doctor Micro blog post on the RX zero-wait-state Flash memory discussed the Dhrystone benchmark and the DMIPs (Dhrystone MIPs) per MHz figure of merit. The RX is specified by Renesas to deliver 165 DMIPs when operating at 100 MHz or 1.65 DMIPs/MHz.
As you consider different MCUs for projects, you might want to run you own Dhrystone tests and evaluate processors in what you know to be an apples-to-apples comparison. The new application note "How to Setup and Run Dhrystone on a MCU" from Renesas' application engineers can guide you through the process. The note uses the RX MCU as the example target, but the techniques described can be easily applied to other MCUs.
The app note lists the files you need to run the benchmark along with identifying one place on the Internet where you can find the files. The notes takes you step by step through the process of modifying the files where required. For example, one of the files uses a TIME function call to actually measure the benchmark time. The OS used by the author lacked a TIME function so the authors commented out the references to that function and inserted code to toggle an output pin instead. They used a scope connected to that output pen to capture the test time.
The app note provides instruction on interpreting the results. The tests are run repeatedly to ensure a reliable result. In the app note, the test is run for 10,000 iterations. So the result must be averaged to get an accurate DMIPs/MHz score.
Engineers that have requested an RX-Stick development platform will also find help in terms of the Dhrystone benchmark. Renesas is offering the kits free for a limited time, and the kits are now shipping to those that have registered. The kit comes with Dhrystone code.
In a recent post, I linked to a video of Renesas applications engineer John Breitenbach working with the RX stick. The video included a Dhrystone run that actually yielded a measurement of 1.75 DMIPs/MHz.
I also described, in a prior post, some real-world applications that Renesas applications engineers used to test the RX against an ARM processor. Those results don't rely on Dhrystones but do show a performance advantage as great as 75% for the RX.
Let's wrap up our recent discussion of how to get accurate real-time measurements from a thermocouple or other sensor. I first discussed the problem and the fact that the relationship between temperature and voltage is nonlinear with a thermocouple, and described the polynomial that could deliver accurate results. I followed that post with a look at the brute-force approach to reading accurate temperatures with an ADC integrated on a microcontroller (MCU) such as the Renesas RX. A pre-calculated conversion table stored in memory may be a good choice in some applications. But for a minimum memory footprint, and therefore minimum system cost, your design must calculate the polynomial in real-time and a floating-point unit (FPU) can greatly accelerate that task.
You can certainly calculate a polynomial expression with a fixed-point MCU. The programmer must take care in coding the algorithm. First the constants or coefficients for each degree or order of the polynomial must be converted into a format conducive to integer math. Typically a portion of a 32-bit representation is the integer part of the constant and another portion is the fractional component. One such format would use a sign bit, 11 bits to represent the integer, and 20 bits to represent the fraction.
The algorithm would have to calculate each term of the polynomial. And each term would have be precisely shifted before the terms can be added. The integer approach can certainly work in some applications.
Alternatively, a programmer working with a fixed-point MCU could rely on a floating point library. The library handles the complex formatting and shifting operations. But the library approach won't likely yield compact code or optimal performance.
A programmer using a floating point MCU such as the RX has a relatively simple task. In the case of the RX MCU, floating point add instructions execute in four to five clock cycles and multiply instructions can take one cycle less.
Renesas application engineers performed some benchmarks to accurately project both the code size and execution time associated with the different approaches that we've discussed to deriving accurate temperature readings. The tests included both the pre-calculated table stored in memory, and the three approaches that we've discussed here today to calculate the polynomial in real time
The tests were based on evaluating a 5th order polynomial. And the test were run on an MCU operating at 32 MHz. The table below summarizes the results. The table-look-up approach is the fastest, but has a huge impact on code size. The library approach is clearly a poor choice. Fixed-point math could work in some applications, but the clear winner is using an FPU. The MCU with FPU handles the task in 7 µsecs using only 38 bytes of code.
©2003–2009 Renesas Technology Corp. All rights reserved. Using Our Website | Privacy
Contact us