H8SX Family APPLICATION NOTE. Vector Table Address Switching. Introduction. Target Devices. Contents

Similar documents
RTE/L Return from Exception Handling with Data Restoration

In repeat transfer mode of DMAC, choose functions from those listed in Table 1. Operations of the checked items are described below.

M16C/60 Series and M16C/20 Series

This function allows the user to erase any Flash block within the MCU including the near area memory (below address 0xFFFF).

Multi-Bit Shift of 32-Bit Data (Arithmetic Right Shift)

Interrupt Level Setting and Modification by Interrupt Controller

M16C/62 APPLICATION NOTE. Programming the M16C/62 in Flash Parallel Mode. 1.0 Abstract. 2.0 Introduction. 3.0 Setting Up the PGM1000 Programmer

M16C/62 Group APPLICATION NOTE. Signed 32 Bit Multiplication Library. 1. Abstract. 2. Introduction

This application note describes the time measurement function of Timer S with the gate function.

This document describes how to set up and use the timer RA in timer mode on the R8C/25 Group device.

M16C/62 APPLICATION NOTE. Using the M16C/62 CRC. 1.0 Abstract. 2.0 Introduction. 3.0 A Lesson in CRC and the CCITT Polynomial

1. Specifications Functions Used Operation Software Flowcharts Program Listing... 13

1. Specifications Conditions for Application Description of Modules Used Description of Operation... 7

M16C/62 APPLICATION NOTE. Using the M16C/62 DMAC in Forward Source Mode. 1.0 Abstract. 2.0 Introduction

32176 Group APPLICATION NOTE. Application of the CAN Module (Remote Frame Transmission) 1. Overview. 2. Introduction

SH7080/SH7146/SH7125/SH7200 Series

SH7144/45 Group APPLICATION NOTE. 2-Phase Encoder Count. 1. Specifications

M16C R8C FoUSB/UART Debugger. User Manual REJ10J

M16C/26 APPLICATION NOTE. Using the DMAC with a Forward Source. 1.0 Abstract. 2.0 Introduction

This document describes how to set up and use the timer RB in programmable one-shot generation mode on the R8C/25 Group device.

M16C/26 APPLICATION NOTE. Using Timer B in Pulse Period/Width Measurement Mode. 1.0 Abstract. 2.0 Introduction

M16C/Tiny Series APPLICATION NOTE. Operation of Timer A. (2-Phase Pulse Signal Process in Event Counter Mode, Multiply-by-4 Mode) 1.

M16C APPLICATION NOTE. Target Setup for the In-Circuit Debugger. 1.0 Abstract. 2.0 Introduction

M16C R8C FoUSB/UART Debugger. User s Manual REJ10J

M16C/26 APPLICATION NOTE. Using the M16C/26 Timer in Event Counter Mode. 1.0 Abstract. 2.0 Introduction

1. Specifications Operational Overview of Functions Used Principles of Operation Description of Software...

M16C/26 APPLICATION NOTE. Measuring Computation Time of a Function Call. 1.0 Abstract. 2.0 Introduction. 3.0 Number of Function Call Returns

The following article describes how to use the M16C/62 timers A s as square wave generators (Pulse Output Mode).

M16C APPLICATION NOTE. Firmware Requirements for In-Circuit Debugger. 1.0 Abstract. 2.0 Introduction

APPLICATION NOTE R8C, M16C, M32C

M32C/84 Group APPLICATION NOTE. Operation of Key-Input Interrupt. 1. Abstract. 2. Introduction

Renesas LIN Overview. White paper REU05B Introduction

Regarding the change of names mentioned in the document, such as Hitachi Electric and Hitachi XX, to Renesas Technology Corp.

M32C/84 Group APPLICATION NOTE. Operation of timer A (2-phase pulse signal process in event counter mode, normal mode selected) 1.

Silicon Epitaxial Planar Zener Diode for Stabilized Power Supply. Type No. Mark Package Code HZS Series Type No. MHD B 7

The following article introduces and shows an example of how to set up and use the watchdog timer on the M16C/26 microcontroller (MCU).

Old Company Name in Catalogs and Other Documents

Regarding the change of names mentioned in the document, such as Hitachi Electric and Hitachi XX, to Renesas Technology Corp.

M16C/62 APPLICATION NOTE. Using the Expanded Memory Mode with the M16C/ Abstract. 2.0 Introduction. 3.0 Memory Expansion Mode

Single Power Supply F-ZTAT On-Board Programming

VLA HYBRID IC ISOLATED TYPE DC-DC CONVERTER DESCRIPTION OUTLINE DRAWING FEATURES APPLICATIONS BLOCK DIAGRAM. +Vo +V IN.

M16C/26 APPLICATION NOTE. Implementing Real Time Clock and WAIT Mode. 1.0 Abstract. 2.0 Introduction. 3.0 Real-Time Clock Setup and Implementation

M32C/84, 85, 86, 87, 88 Group

Regarding the change of names mentioned in the document, such as Hitachi Electric and Hitachi XX, to Renesas Technology Corp.

VLA A HYBRID IC ISOLATED TYPE DC-DC CONVERTER DESCRIPTION FEATURES BLOCK DIAGRAM

Application Note [AN-006] Liquid Crystal Display (LCD) Construction Methods

Old Company Name in Catalogs and Other Documents

M16C/26 APPLICATION NOTE. Interfacing with 1-Wire Devices. 1.0 Abstract. 2.0 Introduction Wire Interface. 3.1 Hardware

1. Specifications Applicable Conditions Operational Overview of Functions Used Principles of Operation...

M32C/84, 85, 86, 87, 88 Group

This document describes a program for timer RA in pulse period measurement mode.

Old Company Name in Catalogs and Other Documents

This document describes a program for timer RF in pulse width measurement mode.

Operation of Timer A (2-phase pulse signal process in event counter mode, multiply-by-4 processing operation)

OUTLINE DRAWING. ABSOLUTE MAXIMUM RATINGS (Tc=25 C UNLESS OTHERWISE NOTED)

Data Transfer between On-chip RAM Areas with DMAC (Burst Mode) 1. Introduction Description of Sample Application... 3

1. Specification Applicable Conditions Description of Modules Used Principles of Operation... 9

F-ZTAT Microcomputer On-Board Programming

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents

M37544 StarterKit. User s Manual REJ10J Z. RENESAS SINGLE-CHIP MICROCOMPUTER 740 Family 740 Series. Rev.1.00 Revision Date : Nov 26, 2004

In timer mode, choose functions from those listed in Table 1. Operations of the circled items are described below.

Old Company Name in Catalogs and Other Documents

Example of Setting the SCIF for Clocked Synchronous Serial Communication (Full-Duplex Communication)

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents

Regarding the change of names mentioned in the document, such as Hitachi Electric and Hitachi XX, to Renesas Technology Corp.

< Silicon RF Power MOS FET (Discrete) > RD04LUS2

SCIF Asynchronous Serial Data Transfer Function Using the DTC. 1. Specifications Operational Overview of Functions Used...

Renesas E8 On-Chip Debugging Emulator

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents

( 2 / 26 ) * TR4943, R4945 and R4945A are trademarks of Advantest Corporation.

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents

RL78 Family. User s Manual. Flash Self-Programming Library Type Bit Single-Chip Microcontrollers. Rev.1.04 Dec 2016.

Old Company Name in Catalogs and Other Documents

SuperH RISC engine C/C++ Compiler Package

M16C/62 APPLICATION NOTE. Using the M16C/62 Power Saving Modes. 1.0 Abstract. 2.0 Introduction. 3.0 Power Conservation: Introduction

Renesas E10A-USB Emulator

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents

The C/C++ Compiler Package for the H8SX, H8S, and H8 MCU Families Revised to V.7.00 Release 00

SPI Overview and Operation

Old Company Name in Catalogs and Other Documents

For one or more fully configured, functional example projects that use this user module go to

Old Company Name in Catalogs and Other Documents

Old Company Name in Catalogs and Other Documents

Flash Self-programming Library

DATA SHEET ZENER DIODES 1.0 W PLANAR TYPE 2-PIN SMALL POWER MINI MOLD. Parameter Symbol Ratings Unit Remarks

M3H Group(2) Application Note Asynchronous Serial Communication Circuit (UART-C)

Silicon Errata. Mixed Signal MCU MD6603 Silicon Errata

One 32-bit counter that can be free running or generate periodic interrupts

S1C17 Family EEPROM Emulation Library Manual

A 24-hour clock (which is updated at 1-minute intervals) is created by using the 32K timer.

CS+ V User s Manual. Integrated Development Environment. User s Manual: Project Operation. Target Device RL78 Family RX Family RH850 Family

Old Company Name in Catalogs and Other Documents

Transcription:

APPLICATION NOTE H8SX Family Introduction This application note describes how to change the vector table address. Target Devices H8SX family Contents 1. Overview... 2 2. Applicable Conditions... 2 3. Configuration... 3 4. Sample Program... 5 REJ06B0621-0100/Rev.1.00 September 2006 Page 1 of 8

1. Overview H8SX Family The H8SX CPU used in H8SX-family products has a function to allocate the exception handling vector table at a desired address. With the earlier H8/300, H8/300H, and H8S CPUs, the vector table is fixed at address 0. The H8SX CPU provides the vector base register (VBR) to change the vector table address. This application note describes an example of VBR usage. 2. Applicable Conditions Table 1 Applicable Conditions Item Contents Development tool High-performance Embedded Workshop Version 4.00.03 C/C++ compiler H8S, H8/300 Series C/C++ Compiler Version 6.01.01 (from Renesas Technology Corp.) Assembler H8S, H8/300 Series Cross Assembler Version 6.01.01 (from Renesas Technology Corp.) H8S compiler options -cpu = h8sxa:24:md, -code = asmcode, -optimize = 1, -regparam = 3 -speed = (register,shift,struct,expression) Table 2 Section Settings Address Section Name Description H'001000 P Program area REJ06B0621-0100/Rev.1.00 September 2006 Page 2 of 8

3. Configuration H8SX Family VBR is a 32-bit register in which the upper 20 bits are valid. The lower 12 bits of this register are reserved and read as 0s. VBR 31 12 11 0 (Reserved) As the upper 20 bits of VBR are valid, the address of the exception handling vector table can be specified as a multiple of H'1000. Different vector table address offsets (H'0000 to H'03FF) are assigned to different exception sources, and the address of each exception handling vector in the vector table is calculated from VBR contents and the vector table address offset for the exception source. Note that the vector addresses for the reset and CPU address error are fixed regardless of the VBR value. Table 3 shows the calculation method for exception handling vector addresses. Table 3 Exception Source Reset CPU address error Others Calculation Method for Exception Handling Vector Addresses Instruction Length Vector address = Vector table address offset (fixed value: H'0000 to H'0003) Vector address = Vector table address offset (fixed value: H'0030 to H'0033) Vector address = VBR + vector table address offset The capability of vector table allocation at a desired address using VBR provides the following advantages. The user program can dynamically change the location of the exception handling vector table. (The user program can dynamically switch between different interrupt handling routines.) Allocating the exception handling vector table in the on-chip RAM area can accelerate the response to interrupts (high-speed operation can be achieved even with the MCU without on-chip ROM). Figure 1 shows an example of changing the address of the exception handling vector table through the VBR setting. REJ06B0621-0100/Rev.1.00 September 2006 Page 3 of 8

H8SX Family Memory map Interrupt generated Memory map H'000000 Vector table H'000000 Initial vector table User program VBR = H'FF6000 User program Interrupt handling Branch to the interrupt handling routine H'FF6000 Vector table Interrupt handling Interrupt generated Branch to the interrupt handling routine Figure 1 Example of VBR Setting REJ06B0621-0100/Rev.1.00 September 2006 Page 4 of 8

H8SX Family 4. Sample Program 4.1 Flowchart VBR should be accessed through assembly-language instructions because VBR cannot be directly accessed through the C programming language. This sample program is an example of writing assembly code within a C-language program. The VBR value should be modified while interrupts are disabled. If an interrupt occurs while VBR is being modified with interrupts enabled, the H8SX CPU does not operate correctly. The assembly code embedding function of the compiler allows assembly-language code to be written between #pragma asm and #pragma endasm. For details, refer to the H8S, H8/300 Series C/C++ Compiler, Assembler, Optimizing Linkage Editor User's Manual. changevbr I = 0 Disable interrupts. VBR ER0 In VBR, set the address (ER0) at which the exception handling vector table is allocated. I = 1 Enable interrupts. End REJ06B0621-0100/Rev.1.00 September 2006 Page 5 of 8

H8SX Family 4.2 Program Listing /* Application Note */ #include <machine.h> /* RAM allocation */ #define VECTOR_ADDRESS 0xFF6000 /* Vector table address */ /* function prototype */ void main ( void ); void changevbr ( unsigned long vector_adrs ); /* Vector Address */ #pragma entry main(sp=0xffc000,vect=0) /* H'0000 : Reset */ #pragma section /* P */ /* Main Program */ void main ( void ) { changevbr( (unsigned long)vector_address ); } while(1); /* Change VBR */ void changevbr ( unsigned long vector_adrs ) { set_imask_ccr(1); /* Disable interrupts */ #pragma asm LDC.L ER0,VBR ; set VBR #pragma endasm set_imask_ccr(0); /* Enable interrupts */ } REJ06B0621-0100/Rev.1.00 September 2006 Page 6 of 8

H8SX Family Website and Support Renesas Technology Website http://www.renesas.com/ Inquiries http://www.renesas.com/inquiry csc@renesas.com Revision Record Description Rev. Date Page Summary 1.00 Sep.11.06 First edition issued REJ06B0621-0100/Rev.1.00 September 2006 Page 7 of 8

Keep safety first in your circuit designs! H8SX Family 1. Renesas Technology Corp. puts the maximum effort into making semiconductor products better and more reliable, but there is always the possibility that trouble may occur with them. Trouble with semiconductors may lead to personal injury, fire or property damage. Remember to give due consideration to safety when making your circuit designs, with appropriate measures such as (i) placement of substitutive, auxiliary circuits, (ii) use of nonflammable material or (iii) prevention against any malfunction or mishap. Notes regarding these materials 1. These materials are intended as a reference to assist our customers in the selection of the Renesas Technology Corp. product best suited to the customer's application; they do not convey any license under any intellectual property rights, or any other rights, belonging to Renesas Technology Corp. or a third party. 2. Renesas Technology Corp. assumes no responsibility for any damage, or infringement of any thirdparty's rights, originating in the use of any product data, diagrams, charts, programs, algorithms, or circuit application examples contained in these materials. 3. All information contained in these materials, including product data, diagrams, charts, programs and algorithms represents information on products at the time of publication of these materials, and are subject to change by Renesas Technology Corp. without notice due to product improvements or other reasons. It is therefore recommended that customers contact Renesas Technology Corp. or an authorized Renesas Technology Corp. product distributor for the latest product information before purchasing a product listed herein. The information described here may contain technical inaccuracies or typographical errors. Renesas Technology Corp. assumes no responsibility for any damage, liability, or other loss rising from these inaccuracies or errors. Please also pay attention to information published by Renesas Technology Corp. by various means, including the Renesas Technology Corp. Semiconductor home page (http://www.renesas.com). 4. When using any or all of the information contained in these materials, including product data, diagrams, charts, programs, and algorithms, please be sure to evaluate all information as a total system before making a final decision on the applicability of the information and products. Renesas Technology Corp. assumes no responsibility for any damage, liability or other loss resulting from the information contained herein. 5. Renesas Technology Corp. semiconductors are not designed or manufactured for use in a device or system that is used under circumstances in which human life is potentially at stake. Please contact Renesas Technology Corp. or an authorized Renesas Technology Corp. product distributor when considering the use of a product contained herein for any specific purposes, such as apparatus or systems for transportation, vehicular, medical, aerospace, nuclear, or undersea repeater use. 6. The prior written approval of Renesas Technology Corp. is necessary to reprint or reproduce in whole or in part these materials. 7. If these products or technologies are subject to the Japanese export control restrictions, they must be exported under a license from the Japanese government and cannot be imported into a country other than the approved destination. Any diversion or reexport contrary to the export control laws and regulations of Japan and/or the country of destination is prohibited. 8. Please contact Renesas Technology Corp. for further details on these materials or the products contained therein. REJ06B0621-0100/Rev.1.00 September 2006 Page 8 of 8