32-Bit-Digital Signal Controller Texas Instruments Incorporated

Slides:



Advertisements
Similar presentations
Interrupts Chapter 8 – pp Chapter 10 – pp Appendix A – pp 537 &
Advertisements

A look at interrupts What are interrupts and why are they needed.
External Interrupt Module MTT EXTERNAL INTERRUPT REQUEST MODULE (IRQ)
8051 Core Specification.
I/O Unit.
Computer System Overview
Texas Instruments Incorporated Module 13 : C28x BOOT – ROM 32-Bit-Digital Signal Controller TMS320F2812.
CSCI 4717/5717 Computer Architecture
68HC11 Polling and Interrupts
ECE 372 – Microcontroller Design Parallel IO Ports - Interrupts
COMP3221: Microprocessors and Embedded Systems Lecture 15: Interrupts I Lecturer: Hui Wu Session 1, 2005.
A look at interrupts What are interrupts and why are they needed in an embedded system? Equally as important – how are these ideas handled on the Blackfin.
1 Computer System Overview OS-1 Course AA
A look at interrupts What are interrupts and why are they needed.
1 Interrupts INPUT/OUTPUT ORGANIZATION: Interrupts CS 147 JOKO SUTOMO.
Midterm Wednesday 11/19 Overview: 25% First Midterm material - Number/character representation and conversion, number arithmetic - DeMorgan’s Law, Combinational.
NS Training Hardware. System Controller Module.
Interrupts. What Are Interrupts? Interrupts alter a program’s flow of control  Behavior is similar to a procedure call »Some significant differences.
UNIT 8 Keypad Interface Contact Closure Counter Exceptions (Interrupts and Reset)
Ch. 9 Interrupt Programming and Real-Time Sysstems From Valvano’s Introduction to Embedded Systems.
V 0.91 Polled IO versus Interrupt Driven IO Polled Input/Output (IO) – processor continually checks IO device to see if it is ready for data transfer –Inefficient,
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Computer System Overview Chapter 1. Operating System Exploits the hardware resources of one or more processors Provides a set of services to system users.
MICROPROCESSOR INPUT/OUTPUT
Khaled A. Al-Utaibi  Interrupt-Driven I/O  Hardware Interrupts  Responding to Hardware Interrupts  INTR and NMI  Computing the.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This course provides an overview of the CPU architecture.
Interrupts and reset operations. Overview  Introduction to interrupts – What are they – How are they used  68HC11 interrupt mechanisms – Types of interrupts.
I/O Interfacing A lot of handshaking is required between the CPU and most I/O devices. All I/O devices operate asynchronously with respect to the CPU.
1. Registers Used in Timer/Counter  TH0, TL0, TH1, TL1  TMOD (Timer mode register)  TCON (Timer control register) 2.
Microprocessors 1 MCS-51 Interrupts.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction Purpose  This training course provides an overview of the CPU architecture.
Texas Instruments Incorporated Module 10 : Flash Programming C28x 32-Bit-Digital Signal Controller TMS320F2812.
Microprocessor. Interrupts The processor has 5 interrupts. CALL instruction (3 byte instruction). The processor calls the subroutine, address of which.
1 © Unitec New Zealand Interrupt Lecture 6 Date: - 20 Sept, 2011 Embedded Hardware ETEC 6416.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
1 - 1 Digital Signal Controller TMS320F2812 Module 1 : Architecture.
1 Interrupts, Resets Today: First Hour: Interrupts –Section 5.2 of Huang’s Textbook –In-class Activity #1 Second Hour: More Interrupts Section 5.2 of Huang’s.
6-1 Infineon 167 Interrupts The C167CS provides 56 separate interrupt sources that may be assigned to 16 priority levels. The C167CS uses a vectored interrupt.
© 2008, Renesas Technology America, Inc., All Rights Reserved 1 Course Introduction  Purpose:  This course provides an overview of the Direct Memory.
4 - 1 Texas Instruments Incorporated European Customer Training Center University of Applied Sciences Zwickau (FH) Module 4 : Interrupt System C28x 32-Bit-Digital.
EFLAG Register of The The only new flag bit is the AC alignment check, used to indicate that the microprocessor has accessed a word at an odd.
Interrupts  An interrupt is any service request that causes the CPU to stop its current execution stream and to execute an instruction stream that services.
System Integration Module MTT Motoola SYSTEM INTEGRATION MODULE (SIM)
Embedded Systems Design 1 Lecture Set 8 MCS-51 Interrupts.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
DSP C5000 Chapter 10 Understanding and Programming the Host Port Interface (EHPI) Copyright © 2003 Texas Instruments. All rights reserved.
Execution Architecture MTT CPU08 Core M CPU08 INTRODUCTION.
بسم الله الرحمن الرحيم MEMORY AND I/O.
Computer Operating Properly Module MTT COMPUTER OPERATING PROPERLY MODULE (COP)
The 8051 Microcontroller Chapter 6 INTERRUPTS. 2/29 Interrupt is the occurrence of a condition an event that causes a temporary suspension of a program.
George W. Woodruff School of Mechanical Engineering, Georgia Tech ME4447/6405 ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
Introduction to Exceptions 1 Introduction to Exceptions ARM Advanced RISC Machines.
Chapter 10 Interrupts. Basic Concepts in Interrupts  An interrupt is a communication process set up in a microprocessor or microcontroller in which:
Interrupts and signals
68HC11 Interrupts & Resets.
Microprocessor Systems Design I
Timer and Interrupts.
Interrupts In 8085 and 8086.
Computer System Overview
Interrupts Interrupt is a process where an external device can get the attention of the microprocessor. The process starts from the I/O device The process.
Chapter 10 Interrupts.
전자의료시스템 및 실습 System Configuration/Interrupt
Interrupts.
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Computer System Overview
COMP3221: Microprocessors and Embedded Systems
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
ME 4447/6405 Microprocessor Control of Manufacturing Systems and
Presentation transcript:

32-Bit-Digital Signal Controller Texas Instruments Incorporated Module 4 : Interrupt System C28x 32-Bit-Digital Signal Controller TMS320F2812 Texas Instruments Incorporated

Interrupts A request generated by external or internal hardware units that breaks the current program temporarily Asynchronous Priority Interrupt Handling Context Save Leave Main Program Execute ISR Return to Main Program Context Restore Interrupt Latency

Interrupt Handling When an interrupt is received from external or internal inputs: Check Global Interrupt Enable/Disable Check Specific Interrupt Enable/Disable Check Priority if Multiple Interrupts Locate Interrupt Starting Address (Interrupt Vector) Execute ISR

C28x Core Interrupt Lines RS NMI 2 non-maskable interrupts (RS, “selectable” NMI) 14 maskable interrupts (INT1 – INT14) INT1 INT2 INT3 INT4 C28x CORE INT5 INT6 INT7 INT8 Maskable  Enable/Disable INT9 INT10 INT11 INT12 INT13 INT14

C28x Reset Sources C28x Core Watchdog Timer RS RS pin active To RS pin

Register Bits Initialized at Reset Register bits defined by reset PC 0x3F FFC0 PC loaded with reset vector ACC 0x0000 0000 Accumulator cleared XAR0 - XAR7 0x0000 0000 Auxiliary Registers DP 0x0000 Data Page pointer points to page 0 P 0x0000 0000 P register cleared XT 0x0000 0000 XT register cleared SP 0x0400 Stack Pointer to address 0400 RPC 0x00 0000 Return Program Counter cleared IFR 0x0000 no pending interrupts IER 0x0000 maskable interrupts disabled DBGIER 0x0000 debug interrupts disabled

Control Bits Initialized at Reset Status Register 0 (ST0) SXM = 0 Sign extension off OVM = 0 Overflow mode off TC = 0 test/control flag C = 0 carry bit Z = 0 zero flag N = 0 negative flag V = 0 overflow bit PM = 000 set to left-shift-by-1 OVC = 00 0000 overflow counter Status Register 1 (ST1) INTM = 1 Disable all maskable interrupts - global DBGM = 1 Emulation access/events disabled PAGE0 = 0 Stack addressing mode enabled/Direct addressing disabled VMAP = 1 Interrupt vectors mapped to PM 0x3F FFC0 – 0x3F FFFF SPA = 0 stack pointer even address alignment status bit LOOP = 0 Loop instruction status bit EALLOW = 0 emulation access enable bit IDLESTAT = 0 Idle instruction status bit AMODE = 0 C27x/C28x addressing mode OBJMODE = 0 C27x object mode M0M1MAP = 1 mapping mode bit XF = 0 XF status bit ARP = 0 ARP points to AR0

Reset – Bootloader Reset Reset vector fetched from XINTF zone 7 Reset vector fetched from boot ROM 0x3F FFC0 XMPNMC=1 (microprocessor mode) Reset OBJMODE=0 AMODE=0 ENPIE=0 VMAP=1 M0M1MAP=1 Reset vector fetched from XINTF zone 7 0x3F FFC0 XMPNMC=0 (microcomputer mode) Boot determined by state of GPIO pins Execution Bootloading Entry Point Routines FLASH SPI H0 SARAM SCI-A OTP Parallel load Notes: F2810 XMPNMC tied low internal to device XMPNMC refers to input signal MP/MC is status bit in XINTFCNF2 register XMPNMC only sampled at reset

Bootloader Options GPIO pins F4 F12 F3 F2 1 x x x jump to FLASH address 0x3F 7FF6 * 0 0 1 0 jump to H0 SARAM address 0x3F 8000 * 0 0 0 1 jump to OTP address 0x3D 7800 * 0 1 x x bootload external EEPROM to on-chip memory via SPI port 0 0 1 1 bootload code to on-chip memory via SCI-A port 0 0 0 0 bootload code to on-chip memory via GPIO port B (parallel) * Boot ROM software configures the device for C28x mode before jump

Reset Code Flow - Summary 0x3D 7800 OTP (2K) 0x3D 8000 FLASH (128K) 0x3F 7FF6 0x3F 8000 H0 SARAM (8K) Execution Entry Point Determined By GPIO Pins 0x3F F000 Boot ROM (4K) Boot Code 0x3F FC00     BROM vector (32) RESET 0x3F FFC0 0x3F FC00 Bootloading Routines (SPI, SCI-A, Parallel Load)

Maskable Interrupt Processing Conceptual Core Overview 1 (IFR) “Latch” INT1 INT2 INT14 Core Interrupt C28x Core (INTM) “Global Switch” (IER) “Switch” A valid signal on a specific interrupt line causes the latch to display a “1” in the appropriate bit If the individual and global switches are turned “on” the interrupt reaches the core

Setting a bit’s value (Masking) ? If you want to set b7 to 1 ? 1 OR R = R | 0080h If you want to set b10 to 0 ? 1 AND R = R & FBFFh

Determining a bit’s value ? If you determine if b2 is 1 or 0 ? 1 x AND R = R & 0004h If R = 0000h, then b2 was 0 If R ǂ 0000h, then b2 was 1

Interrupt Flag Register (IFR) RTOSINT DLOGINT INT14 INT13 INT12 INT11 INT10 INT9 8 9 10 11 12 13 14 15 INT8 INT7 INT6 INT5 INT4 INT3 INT2 INT1 1 2 3 4 5 6 7 Pending : IFR Bit = 1 Absent : IFR Bit = 0 /*** Manual setting/clearing IFR ***/ extern cregister volatile unsigned int IFR; IFR |= 0x0008; //set INT4 in IFR IFR &= 0xFFF7; //clear INT4 in IFR Compiler generates atomic instructions (non-interruptible) for setting/clearing IFR If interrupt occurs when writing IFR, interrupt has priority IFR(bit) cleared when interrupt is acknowledged by CPU Register cleared on reset

Interrupt Enable Register (IER) RTOSINT DLOGINT INT14 INT13 INT12 INT11 INT10 INT9 8 9 10 11 12 13 14 15 INT8 INT7 INT6 INT5 INT4 INT3 INT2 INT1 1 2 3 4 5 6 7 Enable: Set IER Bit = 1 Disable: Clear IER Bit = 0 /*** Interrupt Enable Register ***/ extern cregister volatile unsigned int IER; IER |= 0x0008; //enable INT4 in IER IER &= 0xFFF7; //disable INT4 in IER Compiler generates atomic instructions (non-interruptible) for setting/clearing IER Register cleared on reset

Interrupt Global Mask Bit INTM ST1 Bit 0 INTM used to globally enable/disable interrupts: Enable: INTM = 0 Disable: INTM = 1 (reset value) INTM modified from assembly code only: /*** Global Interrupts ***/ asm(“ CLRC INTM”); //enable global interrupts asm(“ SETC INTM”); //disable global interrupts

Interrupt Sources Internal Sources C28x CORE External Sources TINT2 NMI C28x CORE INT1 INT13 INT2 INT3 INT12 INT14 RS • EV and Non-EV Peripherals (EV, ADC, SPI, SCI, McBSP, CAN) PIE (Peripheral Interrupt Expansion) External Sources XINT1 XINT2 PDPINTx RS XNMI_XINT13

Peripheral Interrupt Expansion - PIE Peripheral Interrupts 12x8 = 96 IFR IER INTM 28x Core 28x Core Interrupt logic PIE module for 96 Interrupts INT1.x interrupt group INT2.x interrupt group INT3.x interrupt group INT4.x interrupt group INT5.x interrupt group INT6.x interrupt group INT7.x interrupt group INT8.x interrupt group INT9.x interrupt group INT10.x interrupt group INT11.x interrupt group INT12.x interrupt group INT1 – INT 12 12 Interrupts 96 INT1.1 INT1.2 INT1.8 1 • INT1 PIEIFR1 PIEIER1 Interrupt Group 1 INT13 (TINT1 / XINT13) INT14 (TINT2) NMI

PIE Registers PIEIFRx register (x = 1 to 12) INTx.2 INTx.3 INTx.4 INTx.5 INTx.6 INTx.7 INTx.8 INTx.1 1 2 3 4 5 6 7 15 - 8 reserved PIEIFRx register (x = 1 to 12) INTx.2 INTx.3 INTx.4 INTx.5 INTx.6 INTx.7 INTx.8 INTx.1 1 2 3 4 5 6 7 15 - 8 reserved PIEIERx register (x = 1 to 12) reserved PIEACKx PIE Interrupt Acknowledge Register (PIEACK) 1 2 4 3 5 6 7 8 9 10 11 15 - 12 ENPIE PIEVECT PIECTRL register 15 - 1 #include “DSP28_Device.h” PieCtrlRegs.PIEIFR1.bit.INTx4 = 1; //manually set IFR for XINT1 in PIE group 1 PieCtrlRegs.PIEIER3.bit.INTx5 = 1; //enable CAPINT1 in PIE group 3 PieCtrlRegs.PIEACK.all = 0x0004; //acknowledge the PIE group 3 PieCtrlRegs.PIECTRL.bit.ENPIE = 1; //enable the PIE

Default Interrupt Vector Table at Reset Prio Vector Offset 1 Reset 00 Default Vector Table Remapped when ENPIE = 1 Int 1 Int 2 Int 3 Int 4 Int 5 Int 6 Int 7 Int 8 Int 9 Int 10 Int 11 Int 12 Int 13 Int 14 02 04 06 08 0A 0C 0E 10 12 14 16 18 1A 1C 1E 20 22 24 26 28-3E 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 Memory PIE Vectors 256 W 0x00 0D00 BROM Vectors 64 W 0x3F FFC0 4 2 3 DlogInt RtosInt EmuInt NMI 0x3F FFFF PIE vector generated by config Tool Used to initialize PIE vectors - Illegal User 1-12

PIE Vector Mapping (ENPIE = 1) PIE vector address PIE vector Description Not used 0x00 0D00 Reset Vector Never Fetched Here Vector name INT1 0x00 0D02 INT1 re-mapped below …… …… …… re-mapped below INT12 0x00 0D18 INT12 re-mapped below INT13 0x00 0D1A XINT1 Interrupt Vector INT14 0x00 0D1C Timer2 – RTOS Vector Datalog 0x00 0D1D Data logging vector …… …… …… USER11 0x00 0D3E User defined TRAP INT1.1 0x00 0D40 PIEINT1.1 interrupt vector …… …… …… INT12.1 0x00 0DF0 PIEINT12.1 interrupt vector INT1.8 0x00 0D4E PIEINT1.8 interrupt vector INT12.8 0x00 0DFE PIEINT12.8 interrupt vector PIE vector space - 0x00 0D00 – 256 Word memory in Data space RESET and INT1-INT12 vector locations are Re-mapped CPU vectors are remapped to 0x00 0D00 in Data space

F2812/10 PIE Interrupt Assignment Table INTx.8 INTx.7 INTx.6 INTx.5 INTx.4 INTx.3 INTx.2 INTx.1 INT1 WAKEINT TINT0 ADCINT XINT2 XINT1 PDPINTB PDPINTA INT2 T1OFINT T1UFINT T1CINT T1PINT CMP3INT CMP2INT CMP1INT INT3 CAPINT3 CAPINT2 CAPINT1 T2OFINT T2UFINT T2CINT T2PINT INT4 T3OFINT T3UFINT T3CINT T3PINT CMP6INT CMP5INT CMP4INT INT5 CAPINT6 CAPINT5 CAPINT4 T4OFINT T4UFINT T4CINT T4PINT INT6 MXINT MRINT SPITXINTA SPIRXINTA INT7 INT8 INT9 SCITXINTB SCIRXINTB SCITXINTA SCIRXINTA ECAN1INT ECAN0INT INT10 INT11 INT12

Device Vector Mapping - Summary RESET Reset Vector <0x3F FFCO> = Boot-ROM Code Flash Entry Point <0x3F 7FF6 > = LB _c_int00 User Code Start < _c_int00 > MPNMC = 0 (on-chip ROM memory) Reset Vector <0x3F FFCO> = _c_int00 User Code Start < _c_int00> MPNMC = 1 (external memory XINTF) _c_int00: . . . CALL main() Initialization ( ) { EALLOW Load PIE Vectors Enable the PIEIER Enable PIECTRL Enable Core IER Enable INTM EDIS } main() { initialization(); . . . } PIE Vector Table 256 Word RAM 0x00 0D00 – 0DFF

Interrupt Response - Hardware Sequence CPU Action Description Registers ® stack 14 Register words auto saved 0 ® IFR (bit) Clear corresponding IFR bit 0 ® IER (bit) Clear corresponding IER bit 1 ® INTM/DBGM Disable global ints/debug events Vector ® PC Loads PC with int vector address Clear other status bits Clear LOOP, EALLOW, IDLESTAT Note: some actions occur simultaneously, none are interruptible LOOP: Use in LOOPZ and LOOPNZ instructions. This bit is set when the instruction is still active. EALLOW: Emulation allow. This bit is set to allow retime debugger feature. IDLESTAT: Another bit use in emulation. T ST0 AH AL PH PL AR1 AR0 DP ST1 DBSTAT IER PC(msw) PC(lsw)

Interrupt Latency 2 4 3 3 1 3 Latency ext. interrupt occurs here Internal interrupt occurs here Assumes ISR in internal RAM cycles Sync ext. signal (ext. interrupt only) 2 Recognition delay (3) and SP alignment (1) 4 Get vector (3 reg. pairs saved) 3 PF1/PF2/D1 of ISR instruction (3 reg. pairs saved) 3 Save return address 1 D2/R1/R2 of ISR instruction 3 ISR instruction executed on next cycle Above is for PIE enabled or disabled Minimum latency (to when real work occurs in the ISR): Internal interrupts: 14 cycles External interrupts: 16 cycles Depends on wait states, ready, INTM, etc. Maximum latency:

C28x CPU Timers 16 - Bit divide down TDDRH:TDDR 32 - Bit period RESET Timer Reload 16 - Bit divide down TDDRH:TDDR 32 - Bit period PRDH:PRD SYSCLKOUT 16 - Bit prescaler PSCH:PSC 32 - Bit counter TIMH:TIM TCR.4 BORROW INT

C28x Timer Interrupt System PIE unit INT1.7 interrupt TINT0 IFR IER INTM 28x Core 28x Core Interrupt logic INT1 TINT1 / XINT13 INT13 INT14 TINT2

C28x Timer Registers Address Register Name 0x0000 0C00 TIMER0TIM Timer 0, Counter Register Low 0x0000 0C01 TIMER0TIMH Timer 0, Counter Register High 0x0000 0C02 TIMER0PRD Timer 0, Period Register Low 0x0000 0C03 TIMER0PRDH Timer 0, Period Register High 0x0000 0C04 TIMER0TCR Timer 0, Control Register 0x0000 0C06 TIMER0TPR Timer 0, Prescaler Register 0x0000 0C07 TIMER0TPRH Timer 0, Prescaler Register High 0x0000 0C08 TIMER1TIM Timer 1, Counter Register Low 0x0000 0C09 TIMER1TIMH Timer 1, Counter Register High 0x0000 0C0A TIMER1PRD Timer 1, Period Register Low 0x0000 0C0B TIMER1PRDH Timer 1, Period Register High 0x0000 0C0C TIMER1TCR Timer 1, Control Register 0x0000 0C0D TIMER1TPR Timer 1, Prescaler Register 0x0000 0C0F TIMER1TPRH Timer 1, Prescaler Register High 0x0000 0C10 to 0C17 Timer 2 Registers ; same layout as above

C28x Timer Control Registers TIMERxTCR Emulator Interaction 1x = run free reserved TRB 1 2 3 4 5 6 7 TSS TIE FREE 8 9 10 11 12 13 14 15 SOFT TIF Timer Stop Status 0 = start / 1 = stop Timer Reload Bit 1 = reload Timer Interrupt Flag Write 1 clear bit Timer Interrupt Enable Write 1 to enable INT