S1C17 Family Port Nested Interrupt Application Notes

Similar documents
S1C17 Family EEPROM Emulation Library Manual

S1C17 Family Application Library S1C17 Series Steps Calculation Library

GNU17V3 Setup Guide. Rev.2.0

S1C31 Family PA File Creation Tool Manual

S1V3G340 External SPI-Flash Select Guide

S5U1C31D50T1 Manual (S1C31D50 Evaluation Board)

S1C17 Family Application Note S1C17 Series Boot Loader Sample Software

FSA. Library Link. Rev.1.0

For S1C63 Family Flash microcontroller Multiple-Programming ROM Writer Software (GW63)

S1C17 M01/W22/W23/W15 Self-Modifying Software (FLS) Manual

S1V30080 Series I2C Interface Sample Program Specifications

Connecting EPSON Display Controllers to Topway LCD Panels

S1C33 Family Application Note S1C33L26 Software Reference Manual

SG-8506CA-EVB Preliminary

Multi Programmer Ver.4.0 (S5U1C17000Y24) User Manual

CMOS 16-BIT SINGLE CHIP MICROCONTROLLER S5U1C17656T Manual (Software Evaluation Tool for S1C17656)

S5U1C88000P Manual (S1C88 Family Peripheral Circuit Board)

CMOS 16-BIT SINGLE CHIP MICROCONTROLLER S5U1C31D01T1 Manual (Software Evaluation Tool for S1C31D01)

IMU (Inertial Measurement Unit) IMU / USB Interface Board (M-G3xx, M-V3xx) Logger Software User s Guide

S1V3G340 Development Reference Guide

S1C17555/565/955/965

S5U1C17000Y2 GangWriter Software Manual

S1C17W23 EL Lamp Application Notes

S1C31D01 Photoplethysmography (PPG) Demonstration Kit Software Manual

S5U1S65K01H4100 Camera Board Technical Manual

S2R72A54 Application Note

S1F77330 Series Technical Manual

S1R72U16 Development Support Manual

VCC_3.3V GND. USB Evaluation Cable (M-C30EV041) RTS CTS UART_RXD. Fig1. Block Diagram

Oscillation stop detection circuit included

S5U1C63000P Manual (S1C63 Family Peripheral Circuit Board)

32 khz (typ.) embedded oscillator Oscillation stop detection circuit included

RC90 Upgrade Procedures

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

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

CMOS 16-BIT SINGLE CHIP MICROCONTROLLER S5U1C17651T2 Manual (Software Evaluation Tool for S1C17651)

This product is under planning; the specifications may be changed in the release model.

YASKAWA AC Drive-J1000 Option. RS-232C Interface. Technical Manual Type SI-232/J, SI-232/JC RS-232C SI-232/J, SI-232/JC J1000

AVR1518: XMEGA-A1 Xplained Training - XMEGA Clock System. 8-bit Atmel Microcontrollers. Application Note. Prerequisites.

S1C33 Family In-Circuit Debugger S5U1C33001H1400

APPLICATION NOTE. R8C/LA8A Group. Abstract. Product. Timer RJ in Timer Mode. This document describes timer RJ in timer mode in the R8C/LA8A Group.

PCB Design Guidelines for S1R72V Series USB 2.0 High-Speed Devices

Renesas Starter Kit Sample Code for Cubesuite + Toolchain

LAN Magnetics Solution for 1000BASE-T Evaluation Board TDK Part number: ALT4532-EVA-01

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

APPLICATION NOTE. Atmel AT02260: Driving AT42QT1085. Atmel QTouch. Features. Description

MTIM Driver for the MC9S08GW64

Silicon Planar Zener Diode for Low Noise Application. Part No. Cathode Band Package Name Package Code HZ-L Series Navy blue DO-35 GRZZ0002ZB-A 7 B 2

S1C63 Family Application Note S1C6F016 Software Development Supplementary Document Target Products: S1C63016/008/004/003

Unit: mm Max Max Max Min 5.06 Max Min ± ± 0.10

S5U1C63005P Manual (Peripheral Circuit Board for S1C63256)

APPLICATION NOTE. Atmel AVR1638: XMEGA RTC Calibration. 8-bit Atmel Microcontrollers. Features. Introduction

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

CMOS 16-BIT SINGLE CHIP MICROCOMPUTER. S5U1C17001H User Manual (ICD Mini Ver. 1.0)

SCI7654M0A/C0A. DC/DC Converter. Double/Triple/Quadruple Boosting 95% Excellent Power Conversion Efficiency Built-in Voltage Regulator DESCRIPTION

S5U13781R00C10M User Manual

The S1F77330 series is the bus switch suitable for USB applications. The adopted CMOS process technology characterizes

E1 Emulator Additional Document for User s Manual (Notes on Connection for RL78)

Application Note MB Power/Duty Cycle Trade-off. Power-up using external voltage reference. Glitch-free analog output after power-up

HSM88WK. Proof against high voltage. MPAK package is suitable for high density surface mounting and high speed assembly.

Design Kit (for ANSOFT Designer TM / Nexxim TM ) User s Manual

S5U1C63002P Manual (Peripheral Circuit Board for S1C63158/63358)

CMOS 8-BIT SINGLE CHIP MICROCOMPUTER S5U1C88000H5 Manual. (S1C88 Family In-Circuit Emulator)

S5U13781R01C100 Shield TFT Board for Arduino Due Users Manual

SCI Driver for the MC9S08GW64

APPLICATION NOTE. AT03324: Atmel REB212BSMA-EK Quick Start Guide. Atmel MCU Wireless. Introduction

IIC Driver for the MC9S08GW64

DUAL REVERSIBLE MOTOR DRIVER MB3863

RL78 Family Flash Self-Programming Library Type01 Ver.2.21 for the CC-RL compiler

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

Dot Matrix LCD Controller Driver

1SS106. Silicon Schottky Barrier Diode for Various Detector, High Speed Switching

Setting Oscillation Stabilization Wait Time of the main clock (CLKMO) and sub clock (CLKSO)

APPLICATION NOTE. Atmel AT03304: SAM D20 I 2 C Slave Bootloader SAM D20. Description. Features

AVR1503: Xplain training - XMEGA Programmable Multi Interrupt Controller 8-bit Microcontrollers Application Note Prerequisites

1S2075(K) Silicon Epitaxial Planar Diode for High Speed Switching. ADE A (Z) Rev. 1 Aug Features. Ordering Information.

HSM107S. Silicon Schottky Barrier Diode for System Protection. ADE F(Z) Rev 6 Sep Features. Ordering Information.

1. Installation Creating the Project Workspace Adding Sample Code into DS Adding GNU Toolchain Support for DS-5...

HD74HC09. Quad. 2-input AND Gates (with open drain outputs) Features. Pin Arrangement

MC56F825x/MC56F824x (2M53V) Chip Errata

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

PDB Driver for the MC9S08GW64

APPLICATION NOTE. Atmel AVR3009: Driving QTouch Device with I 2 C Interface. Atmel QTouch. Introduction

SEIKO EPSON CORPORATION

APPLICATION NOTE. Atmel AT03782: Using Low Power Modes in SAM4N Microcontroller. Atmel 32-bit Microcontroller. Features.

Audio digital potentiometers

AVR4018: Inertial Two (ATAVRSBIN2) Hardware User's Guide. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

Interrupts in Decoupled Parallel Mode for MPC5675K Configuration and Usage

APPLICATION NOTE. Atmel AVR536: Migration from ATmega644 to ATmega644A. 8-bit Atmel Microcontrollers. Introduction

Using the Kinetis Family Enhanced EEPROM Functionality

Techniques to Disable Global Interrupts

Using the ColdFire+ Family Enhanced EEPROM Functionality Melissa Hunter Derrick Klotz

Old Company Name in Catalogs and Other Documents

CARD-E09A Evaluation Kit Software Manual (English) SEIKO EPSON CORPORATION

1SS286. Silicon Schottky Barrier Diode for Various Detector, High Speed Switching

S2R72A54 Evaluation Board Manual

HD74HC00. Quad. 2-input NAND Gates. Features. Pin Arrangement

S1R72U01 Technical Manual

2SB727(K) Silicon PNP Epitaxial. Medium speed and power switching complementary pair with 2SD768(K) Base 2. Collector (Flange) 3.

2SK439. Silicon N-Channel MOS FET. Application. Outline. VHF amplifier SPAK. 1. Gate 2. Source 3. Drain

Transcription:

S1C17 Family Port Nested Interrupt Application Notes Rev.1.0

Evaluation board/kit and Development tool important notice 1. This evaluation board/kit or development tool is designed for use for engineering evaluation, demonstration, or development purposes only. Do not use it for other purposes. It is not intended to meet the requirements of design for finished products. 2. This evaluation board/kit or development tool is intended for use by an electronics engineer and is not a consumer product. The user should use it properly and in a safe manner. Seiko Epson dose not assume any responsibility or liability of any kind of damage and/or fire coursed by the use of it. The user should cease to use it when any abnormal issue occurs even during proper and safe use. 3. The part used for this evaluation board/kit or development tool may be changed without any notice. NOTICE No part of this material may be reproduced or duplicated in any form or by any means without the written permission of Seiko Epson. Seiko Epson reserves the right to make changes to this material without notice. Seiko Epson does not assume any liability of any kind arising out of any inaccuracies contained in this material or due to its application or use in any product or circuit and, further, there is no representation that this material is applicable to products requiring high level reliability, such as, medical products. Moreover, no license to any intellectual property rights is granted by implication or otherwise, and there is no representation or warranty that anything made in accordance with this material will be free from any patent or copyright infringement of a third party. When exporting the products or technology described in this material, you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations. You are requested not to use, to resell, to export and/or to otherwise dispose of the products (and any technical information furnished, if any) for the development and/or manufacture of weapon of mass destruction or for other military purposes. All brands or product names mentioned herein are trademarks and/or registered trademarks of their respective companies. SEIKO EPSON CORPORATION 2017, All rights reserved.

Table of Contents 1. Overview...1 1.1 Functions... 1 1.2 Folder Configuration... 2 1.3 File Configuration... 2 2. Details of Sample Software Functions...3 2.1 Sample Software Specifications... 3 2.2 Processing Overview... 4 2.3 Using in Applications... 5 3. Function Specifications...7 4. Operating Time...8 Revision History...9 S1C17 Family Port Nested Interrupt Seiko Epson Corporation i

1. Overview 1. Overview The S1C17 Family microcontrollers have an interrupt vector table in which multiple interrupt sources for each peripheral circuit are combined into each interrupt vector. For the port input interrupt, the interrupt sources for all ports are assigned to one interrupt vector. Therefore, controlling only the interrupt controller does not allow nested interrupt handling with prioritized port interrupt sources. This application note provides the functions that manage port input interrupt priorities and handle nested interrupts. 1.1 Functions A function in this application note sets the interrupt level for each port group (P0X, P1X, P2X,...). The interrupt handler function in this application note handles port input interrupts. If a new interrupt having a higher priority occurs while the function is handling an interrupt, the function executes handling of the new interrupt. The interrupt handling being executed currently is temporarily suspended until the handling of new interrupt has finished. If the new interrupt has a lower or the same priority, it will be handled after the handling of the interrupt being executed has finished. The figure below shows an example of a port input interrupt handling sequence. Interrupt levels: P0X = 2 P1X = 3 P2X = 1 The P0X interrupt handling is being executed. 1. P0X interrupt The P1X interrupt handling is being executed. 2. P1X interrupt The P2X interrupt handling is being executed. 3. P2X interrupt The P2X interrupt handling starts after the P0X interrupt handling has finished. 1. A P0X interrupt occurs. The P0X interrupt handling is executed. 2. A P1X interrupt occurs while the P0X interrupt handling is being executed. Since the interrupt levels have been set as P0X < P1X, the P1X interrupt handling is executed. 3. A P2X interrupt occurs while the P1X interrupt handling is being executed. Since the interrupt levels have been set as P2X < P1X and P2X < P0X, the P2X interrupt handling is executed after the P0X interrupt handling has finished. S1C17 Family Port Nested Interrupt Seiko Epson Corporation 1

1. Overview 1.2 Folder Configuration The folder configuration in this package is as follows: +c17_port_nested_interrupt +c17_port_nested_interrupt_gnu17v2 : Sample program for GNU17 Ver. 2.x +c17_port_nested_interrupt_gnu17v3 : Sample program for GNU17 Ver. 3.x -s1c17_port_nested_interrupt_j.pdf : Manual (Japanese) -s1c17_port_nested_interrupt_e.pdf : Manual (English) -License_e.txt : Software license agreement (English) -README.txt : README file 1.3 File Configuration The file configuration in this package is as follows: File name src/c17_port_nested_interrupt.c src/c17_port_nested_interrupt.h src/main.c src/boot.c src/c17_port_m30_m31_m32_m33_m34.c src/c17_port_m30_m31_m32_m33_m34.h src/c17_misc.c src/c17_misc.h src/c17_clg.c src/c17_clg.h src/c17_init_config.h src/crt0.h inc inc/reg Description Port nested interrupt handler function Port nested interrupt handler function header definition file Main function Startup module Sample port driver Sample port driver header definition file Sample MISC driver Sample MISC driver header definition file Sample CLG driver Sample CLG driver header definition file Peripheral circuit configuration header definition file Interrupt vectors and boot function header definition file CPU register definition file directory CPU peripheral circuit control register definition file directory 2 Seiko Epson Corporation S1C17 Family Port Nested Interrupt

2. Details of Sample Software Functions 2. Details of Sample Software Functions This chapter gives a detailed description of the sample software functions. 2.1 Sample Software Specifications This sample software is implemented for S1C17M33 to execute the following processing: Configures the specified ports as input ports that generate an interrupt when the input signal transits from a high level to a low level. When an interrupt occurs from an input port, the sample software configures the specified port as an output port that outputs a high level. Waits for the input port to be changed to a high level. Sets the output port to output a low level. The table below lists the configuration of the ports used in this sample software. Table 2.1.1 Port Configuration in Sample Software Port group P0X P1X P2X P3X Configuration Input interrupt port = P00 Output port = P07 Interrupt level = 2 Input interrupt port = P10 Output port = P17 Interrupt level = 3 Input interrupt port = P20 Output port = P27 Interrupt level = 2 Input interrupt port = P30 Output port = P37 Interrupt level = 1 S1C17 Family Port Nested Interrupt Seiko Epson Corporation 3

2. Details of Sample Software Functions 2.2 Processing Overview Main processing The main function initializes the ports as follows: - Sets the interrupt level for the P0X port group. - Enables the P00 port to generate an interrupt at the falling edge of the input signal. - Sets the P07 port to output a low level. - Sets the interrupt level for the P1X port group. - Enables the P10 port to generate an interrupt at the falling edge of the input signal. - Sets the P17 port to output a low level. - Sets the interrupt level for the P2X port group. - Enables the P20 port to generate an interrupt at the falling edge of the input signal. - Sets the P27 port to output a low level. - Sets the interrupt level for the P3X port group. - Enables the P30 port to generate an interrupt at the falling edge of the input signal. - Sets the P37 port to output a low level. Interrupt handling (P0X) The interrupt handler calls the port group interrupt function (intinputp0x) that performs the processing shown below. - Sets the P07 port to output a high level. - Waits for the P00 port to be changed to a high level. - Sets the P07 port to output a low level. The interrupt functions for other port groups (intinputp1x, intinputp2x,...) performs the same processing as above except for the port numbers. 4 Seiko Epson Corporation S1C17 Family Port Nested Interrupt

2. Details of Sample Software Functions 2.3 Using in Applications This section describes how to import the sample software into your application project. 1. Add header file to project Add c17_port_nested_interrupt.c/c17_port_nested_interrupt.h to the project. 2. Declare header file to be included Add the #include declaration shown below in the source file that refers to the sample functions. #include "c17_port_nested_interrupt.h" 3. Register to vector table When GNU17 Ver. 2.x is used Register the interrupt function c17portnestedinterruptportinput as the PORT interrupt vector. boot.c #include "c17_port_nested_interrupt.h" /** vector table */ func *const vector[] = { // No Base+ Name /* ----- Non-Maskable Interrupts ----- */ VECTOR(boot), // 0 00 Reset VECTOR(intAddrErr), // 1 04 Address misaligned VECTOR(intReserved), // 2 08 NMI VECTOR(emu_copro_process), // 3 0C Co-processor emulation /* ----- Maskable Interrupts ----- */ VECTOR(c17intSvd), // 4 10 SVD3 interrupt VECTOR(c17portNestedInterruptPortInput), // 5 14 PORT interrupt When GNU17 Ver. 3.x is used When using the sample port driver, comment out the vector handler definition shown below. c17_port_m30_m31_m32_m33_m34.c /* --- interrupt handler (GNU17v3 Only) --- */ #ifdef CRT0_LINKED //C17_INTERRUPT_HANDLER(_vector05_handler, c17intportinput); // comment out #endif /* CRT0_LINKED */ S1C17 Family Port Nested Interrupt Seiko Epson Corporation 5

2. Details of Sample Software Functions 4. Add user interrupt processing Add user processing routines to the interrupt functions (intinputp0x, intinputp1x, intinputp2x,...) written in the c17_port_nested_interrupt.c file. void intinputp0x(void) { unsigned short interruptflag; interruptflag = pxintf_get[c17_port_group_p0x]; //Obtain interrupt source storage variable pxintf_get[c17_port_group_p0x] = 0; //Clear interrupt source storage variable asm("ei"); //Enable nested interrupts if(interruptflag & 0x01){ /** * @todo add interrupt function of P00 //Add user processing routine */ } if(interruptflag & 0x02){ /** * @todo add interrupt function of P01 //Add user processing routine */ } ; 5. Set interrupt level for each port group Use the c17portnestedinterruptsetinterruptlevel function to set the interrupt level for the port group (P0X, P1X, P2X,...) of which input interrupt is used. c17portnestedinterruptsetinterruptlevel(c17_port_group_p0x, 2); c17enableintp0x(0, C17_PORT_INT_EDGE_FALLING); c17portnestedinterruptsetinterruptlevel(c17_port_group_p1x, 3); c17enableintp1x(0, C17_PORT_INT_EDGE_FALLING); c17portnestedinterruptsetinterruptlevel(c17_port_group_p2x, 2); c17enableintp2x(0, C17_PORT_INT_EDGE_FALLING); c17portnestedinterruptsetinterruptlevel(c17_port_group_p3x, 1); c17enableintp3x(0, C17_PORT_INT_EDGE_FALLING); 6 Seiko Epson Corporation S1C17 Family Port Nested Interrupt

3. Function Specifications 3. Function Specifications This chapter describes the functions in this sample software. Port group interrupt level setting function Function name c17portnestedinterruptsetinterruptlevel Arguments unsigned short portgr Port group (P0X = 0, P1X = 1,...) unsigned short portintlevel Interrupt level from 1 to 4 Return value unsigned short EXIT_SUCCESS: Successful EXIT_FAILURE: Failed Description This function sets the interrupt level for the port group specified with the argument. Remarks The effective range of the interrupt level is between 1 to 4. Port interrupt handler function Function name Argument Return value Description Remarks c17portnestedinterruptportinput None None This function is the port interrupt handler that calls an interrupt function (intinputp0x, intinputp1x, intinputp2x,...) according to the port group that generates an interrupt. When GNU17 Ver. 2.x is used, register this function as the PORT interrupt vector. Port group interrupt functions Function names intinputp0x, intinputp1x, intinputp2x,... Argument Return value Description Remarks None None These functions are called from the port interrupt handler function and perform the following processing: 1. Obtains the interrupt source from the interrupt source storage variable. 2. Clears the interrupt source storage variable. 3. Enables nested port interrupts. 4. Executes the processing for the port that generates an interrupt (user defined routine). The processing routine for each port should be described by the user. S1C17 Family Port Nested Interrupt Seiko Epson Corporation 7

4. Operating Time 4. Operating Time The time shown below will be taken after a hardware interrupt occurs from an input port until the port interrupt function (intinputpxx) is called. Time: 228 µs Reference Normal S1C17M33 sample software Time: 208 µs Conditions Operating clock: Access wait cycle: Input interrupt port: P10 IOSC = 700 khz FLASHCWAIT.RDWAIT[1:0] bits = 0x0 (no wait) 8 Seiko Epson Corporation S1C17 Family Port Nested Interrupt

Revision History Revision History Rev. No. Date Page Category Contents Rev 1.0 2017/07/24 All New New establishment Attachment-1 S1C17 Family Port Nested Interrupt Seiko Epson Corporation 9

International Sales Operations AMERICA EPSON ELECTRONICS AMERICA, INC. 214 Devcon Drive, San Jose, CA 95112, USA Phone: +1-800-228-3964 FAX: +1-408-922-0238 EUROPE EPSON EUROPE ELECTRONICS GmbH Riesstrasse 15, 80992 Munich, GERMANY Phone: +49-89-14005-0 FAX: +49-89-14005-110 ASIA EPSON (CHINA) CO., LTD. 4th Floor, Tower 1 of China Central Place, 81 Jianguo Road, Chaoyang District, Beijing 100025 China Phone: +86-10-8522-1199 FAX: +86-10-8522-1120 SHANGHAI BRANCH Room 1701 & 1704, 17 Floor, Greenland Center II, 562 Dong An Road, Xu Hui District, Shanghai, CHINA Phone: +86-21-5330-4888 FAX: +86-21-5423-4677 SHENZHEN BRANCH Room 804-805, 8 Floor, Tower 2, Ali Center,No.3331 Keyuan South RD(Shenzhen bay), Nanshan District, Shenzhen 518054, CHINA Phone: +86-10-3299-0588 FAX: +86-10-3299-0560 EPSON TAIWAN TECHNOLOGY & TRADING LTD. 14F, No. 7, Song Ren Road, Taipei 110, TAIWAN Phone: +886-2-8786-6688 FAX: +886-2-8786-6660 EPSON SINGAPORE PTE., LTD. 1 HarbourFront Place, #03-02 HarbourFront Tower One, Singapore 098633 Phone: +65-6586-5500 FAX: +65-6271-3182 SEIKO EPSON CORP. KOREA OFFICE 19F, KLI 63 Bldg., 60 Yoido-dong, Youngdeungpo-Ku, Seoul 150-763, KOREA Phone: +82-2-784-6027 FAX: +82-2-767-3677 SEIKO EPSON CORP. SALES & MARKETING DIVISION Device Sales & Marketing Department 421-8, Hino, Hino-shi, Tokyo 191-8501, JAPAN Phone: +81-42-587-5816 FAX: +81-42-587-5116 Document Code: 413541800 Issue August 2017 in JAPAN L