15.11.2012 Views

FREE VB COURSE - Index of

FREE VB COURSE - Index of

FREE VB COURSE - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

HANDS-ON MICROCONTROLLERS<br />

38<br />

Figure 2. A LED blinker using the R8C/13 – no crystal necessary!<br />

specifically the R8C/13) in the coming issues <strong>of</strong> Elektor<br />

Electronics. We have planned articles on how to use<br />

the s<strong>of</strong>tware and some typical application examples.<br />

Naturally, a user competition also forms part <strong>of</strong> the picture.<br />

Here we’d like to whet your appetite a bit by<br />

describing the principal features <strong>of</strong> this small but elegant<br />

microcontroller.<br />

The core<br />

The CPU achieves a processing performance <strong>of</strong> 8 MIPS<br />

at a 20-MHz clock frequency and boasts 89 native<br />

instructions. Of that number, 20 are single-cycle instructions,<br />

and three quarters <strong>of</strong> the instructions execute in five<br />

clock cycles on average. Mathematical operations, such<br />

Figure 3. The model E8 hardware debugger (optionally available) has a true<br />

real-time mode.<br />

as a 16-bit by 16-bit multiplication, are completed in<br />

250 ns, and division <strong>of</strong> a 32-bit quotient with a 16-bit<br />

dividend takes 1248 µs. The instruction set includes an<br />

RMPA instruction (calculate sum <strong>of</strong> products), which can<br />

be used to compute digital filter algorithms.<br />

The instruction set has special space-saving instructions<br />

that allow short data words (with a length <strong>of</strong> 1, 2, 4 or<br />

8 bits) to be stored in one, two or three bytes along with<br />

the instruction opcode. The same capability is also available<br />

for addresses. The Compare function has been<br />

extended to enable MOV instructions to load data<br />

depending on flag states without requiring a prior comparison.<br />

The peripherals<br />

The R8C/13 has three 8-bit timers, one 16-bit timer, a<br />

watchdog timer, a very fast 10-bit A/D converter with<br />

twelve inputs and a conversion time <strong>of</strong> 3.3 µs, two UARTs<br />

(one <strong>of</strong> which can also be used synchronously), flash program<br />

memory, flash data memory in the form <strong>of</strong> a virtual<br />

EEPROM, SRAM, eight I/O lines with a rated current <strong>of</strong><br />

20 mA (for directly driving devices such as LEDs), an<br />

undervoltage detector, two integrated oscillators (calibratable<br />

125-kHz and 8-MHz ring oscillators), and a crystal<br />

oscillator. The reset peripheral is also integrated using a<br />

5-bit counter.<br />

As with other Renesas microcontrollers, the current consumption<br />

is very low. It is 7.9 mA at 5 V and 16 MHz,<br />

dropping to 4 mA at 5 V for operation using the 8-MHz<br />

ring oscillator or 470 µA at 5 V for operation using the<br />

124-kHz ring oscillator. In Stop mode the current consumption<br />

is only 0.7 µA.<br />

A particularly attractive feature for model builders is the<br />

IC’s ability to boot using the low-speed oscillator. As can<br />

be seen from Figure 2, all you need to implement a minimal<br />

application (such as a LED blinker) is a programmed<br />

R8C/13 and a resistor.<br />

The debug interface<br />

The R8C family has an integrated debug interface with<br />

asynchronous and synchronous serial interfaces for easy,<br />

inexpensive debugging. The asynchronous mode is especially<br />

easy to use, because all you have to add is an<br />

RS232 level converter. For debugging you will need the<br />

KD30 debugger program, which first flashes a monitor<br />

program into the R8C and then starts it automatically.<br />

The debug interface is also suitable for downloading a<br />

fully developed program in the flash ROM <strong>of</strong> the microcontroller.<br />

You can use the Flashstart or FDT program for<br />

this purpose.<br />

These programs, as well as all other s<strong>of</strong>tware mentioned<br />

here, are available free <strong>of</strong> charge from<br />

www.renesas.com or www.m16c.de. Naturally, the programs<br />

are also located on the s<strong>of</strong>tware CD-ROM available<br />

from Readers Services.<br />

The tools<br />

Renesas supports developing small, medium-sized and<br />

large projects using corresponding s<strong>of</strong>tware. In that<br />

regard, a distinction must be made between three levels,<br />

which differ in cost, scope and capability. At the first<br />

level, the potential user can manage entirely without purchased<br />

s<strong>of</strong>tware. There is even a GNU C compiler available<br />

now for the M16C family.<br />

elektor electronics - 1/2006

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!