DOC PREVIEW
UNCC ECGR 4101 - Using the Expanded Memory Mode with the M16C/62

This preview shows page 1-2-3-4 out of 12 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 12 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

AbstractIntroductionMemory Expansion ModeUsing Expanded Memory with the PC4701 Emulation SystemImplementationReferenceSoftware CodeAPPLICATION NOTE M16C/62 Using the Expanded Memory Mode with the M16C/62 1.0 Abstract The following article introduces and shows an example of how to access external memory using the expanded memory mode of the M16C/62 series of microcontrollers. 2.0 Introduction The Renesas M16C/62 series of microcontrollers is a 16-bit family of MCUs, based on Renesas’ M16C CPU core. These parts provide high memory efficiency, power-saving ability, low noise emission, and improved noise immunity. The M16C/62 part series can be used in many applications such as office equipment, PC peripherals, portable devices, automotive, cameras, audio, and so on. This application note shows how to configure and use the expanded memory mode on the M16C/62 series of microcontrollers. 3.0 Memory Expansion Mode There are three processor modes used with the M16C/62 series of microcontrollers. For each processor mode, the memory map functions of some pins and external access space differ. The three processor modes are as follows: • Single-chip mode—Only internal memory space can be accessed. • Memory Expansion mode—External memory can be accessed in addition to all the internal memory. • Microprocessor mode—External memory along with internal SFR and RAM areas can be accessed. Internal ROM cannot be used. For this application note, memory expansion mode is demonstrated. This allows use of all the internal memory areas (SFR, RAM, ROM) and some external memory. In this mode, some of the pins need to function as the address bus, data bus, and control signals for accessing the external memory. The number of pins affected depends on the bus and register settings. Once expanded memory mode and the control settings are selected, the affected pins become dedicated to external memory and can no longer be used for other I/O functions. The desired processor mode is set by the processor mode bits in the processor mode register (PM0) and the CNVss pin. To select memory expansion mode, the CNVss pin is tied to Vss and the processor mode bits are set to “012”. When programming in C, the processor mode is set in the startup file (ncrt0.a30). Figure 1 is an example for setting the processor mode bits. REU05B0011-0100Z June 2003 Page 1 of 11M16C/62Using the Expanded Memory Mode with the M16C/62 Figure 1 Setting the Processor Mode Bits in ncrt0.a30 The bus settings and control signals can also be customized for different configurations. The external bus width can be set to either 8 bits or 16 bits by connecting the BYTE pin to Vcc or Vss respectively. This does not affect the internal bus, which is always fixed to 16 bits. The read/write signal configurations are set in the processor mode register (PM0). There are two combinations of R/W signals. For a 16-bit data bus, select between the RD, WR, and BHE signals or the RD, WRL, and WRH signals. When using an 8-bit bus, always use the RD, WR, and BHE signals. The chip select area used for the external memory must be enabled in the chip select register (CSR). The chip select register determines if pins P44 to P47 output the chip select or if they are used as GPIO. The chip select register also has bits that determine if a wait state should to be added to each individual chip select area. See the specification for each specific microcontroller for exact chip select memory ranges. Figure 2 is an example of a memory map for an M16C/62 microcontroller in expanded memory mode. 00000160040016FFFFF16D0000160800016Internal RAM area(15K bytes)External areaInternal ROM area(192K bytes)CS3(16K bytes)CS2(128K bytes)CS1(32K bytes)CS0Memory expansion mode: 640K bytes280001630000160400016SFR area(1K bytes)CFFFF16Memory expansion mode Figure 2 Example Memory Map with Chip Selects for Expanded Memory Mode REU05B0011-0100Z June 2003 Page 2 of 11M16C/62Using the Expanded Memory Mode with the M16C/62 Other control signals used are the RDY and HOLD signals. The RDY signal is used for any external device that requires a long access time. The HOLD signal is used to transfer the bus privileges from the CPU to an external device. Note: If the RDY and/or HOLD signals are not used, they must be connected to Vcc or the MCU could be permanently stuck in a wait state. More detailed information on expanded memory, processor modes, and bus settings can be found in the M16C/62 specification and user’s manual. 4.0 Using Expanded Memory with the PC4701 Emulation System Some special considerations are required when using expanded memory with the PC4701 emulator. To access any external memory with the emulator, the external memory area must first be mapped using the emulator/debugger software PD30. When PD30 is first started, all memory except for the SFR area is mapped as internal memory. First, determine the external memory range that will be used according to the chip select that is being used. This external memory area must be mapped to external. Open a script window in PD30 and use the map command to change the memory range that is being used to “External” (example: “map 8000, 9000, ext”). This maps the memory range 8000h to 9000h as external memory. To check that the changes have been set, type “map” in the command line and a list of the current memory map is displayed. There is one precaution to observe when using the emulator and the CS2 memory space. The memory addresses, 0FFFCh to 0FFFFh, are used by the emulator as a stack area. These addresses must remain mapped as internal memory or the program will not reset properly. See the Emulation System manual for more information on this precaution. shows an example of mapping the CS2 memory area around the emulator stack. Figure 3Figure 3 Mapping External Memory in PD30 REU05B0011-0100Z June 2003 Page 3 of 11M16C/62Using the Expanded Memory Mode with the M16C/62 5.0 Implementation A sample program is included to demonstrate the use of expanded memory mode. This program is written to run on Renesas’ MDECE0620 evaluation board. This board allows easy evaluation for any M16C/62 microcontroller. The example program samples the voltage of a potentiometer on the evaluation board and stores this data into the external SRAM on the board. The potentiometer is connected to channel 0 of the A/D converter on the M16C. When the push button S2 is pushed, the A/D value is sampled about every


View Full Document

UNCC ECGR 4101 - Using the Expanded Memory Mode with the M16C/62

Documents in this Course
Load more
Download Using the Expanded Memory Mode with the M16C/62
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Using the Expanded Memory Mode with the M16C/62 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Using the Expanded Memory Mode with the M16C/62 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?