
reu05b0051_m16cap| Application Note
APPLICATION NOTE
M16C/26
Using EW1 Mode for Flash Programming
1.0 Abstract
The following article introduces and shows how to use the EW1 mode of the CPU Rewrite feature on the M16C/26 (M30262) Flash microcontroller (MCU). The CPU Rewrite feature allows erasing and programming the on-chip (internal) user flash ROM area under control of a user's program. A short program written for the MSV30262-SKP demonstrates how to use this convenient feature.
2.0 Introduction
The Renesas M16C/26 is a 16-bit MCU, based on the M16C/60 CPU core, with up to 64KB of user flash and 4KB of Virtual EEPROM. The device has the ability to erase and program the internal user flash ROM area under control of a user's program with no external programming devices required. This feature is called "CPU Rewrite Mode". The CPU Rewrite feature can be used in applications where data, such as registers, configuration status/ parameters, data log, etc., needs to be stored in non-volatile memory (i.e. flash memory) for future access.
3.0 CPU Rewrite
The M16C/26 has three flash programming modes: Parallel I/O Mode, Standard Serial I/O Mode, and CPU Rewrite Mode. The first two modes are mainly for programming the application code into the flash so details are not in the scope of this document. In order to use CPU Rewrite Mode, the memory structure and control registers involved need to be identified. The internal flash memory map of the M16C/26, based on part number, is shown in Figure 1. Note that the flash is divided into blocks such that certain erase/programming functions are done on a per block basis.
0F000H 0F800H Block A: 2KB RESERVED F0000H Block 3: 32KB F8000H Block 2: 16KB FC000H FE000H Block 1: 8KB FFFFFH User ROM Area Boot ROM Area 8KB Block 1: 8KB Block B: 2KB Part No. M30262F3-GP M30262F4-GP M30262F6-GP M30262F8-GP Part No. M30262F3-GP M30262F4-GP M30262F6-GP M30262F8-GP Block 3 Size 0 KB 0 KB 16KB 32KB Block 2 Size 8KB 16KB 16KB 16KB Start Address N/A N/A F4000H F0000H Start Address FA000H F8000H F8000H F8000H
Figure 1 M16C/26 (M30262F8) Flash Memory
REU05B0051-0100Z
June 2003
Page 1 of 11
reu05b0051_m16cap Application Note renesas Download PDF
Add this permalink to your bookmarks for future download of reu05b0051_m16cap ApplicationNote
Permalink: http://application.emcelettronica.com/renesas/reu05b0051_m16cap