dspic Interrupts The Interrupt Control and Staus Registers are :- ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 1
|
|
- Cornelius Terry
- 6 years ago
- Views:
Transcription
1 dspic Interrupts The dspic30f4012 has 30 interrupt sources which 3 are external interrupts and 4 processor exception traps. There are 8 user selectable priority levels for each interrupt source. These interrupts are executed according to the priority level set for them. During an Interrupt, the CPU fetches the interrupt address from the Interrupt Vector Table(IVT) and place it into the Program Counter. The Interrupt Vector table is placed at the program memory 0x near the beginning. Here is the dspic30f4012 Interrupt Vector Table. Interrupt Vector Interrupt Source Number Number Highest Natural Order Priority 0 8 INT0 External Interrupt IC1 Input Capture OC1 Output Compare T1 Timer IC2 Input Capture OC2 Output Compare T2 Timer T3 Timer SPI U1RX UART1 Receiver U1TX UART1 Transmitter ADC ADC Convert Done NVM NVM Write Complete SI2C I2C Slave Interrupt MI2C I2C Master Interrupt Input Change Interrupt INT1 External Interrupt IC7 Input Capture IC8 Input Capture OC3 Output Compare OC4 Output Compare T4 Timer T5 Timer INT2 External Interrupt U2RX UART2 Receiver U2TX UART2 Transmitter C1 Combined IRQ for CAN PWM PWM Period Match QEI QEI Interrupt FLTA PWM Fault A The peripheral interrupts (i.e. ADC, timers, PWMs. UART and etc) and exceptions (i.e. traps) are activated by configuring appropriate special function registers. The Interrupt Control and Staus Registers are :- ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 1
2 INTCON1,INTCON2 global INTerrupt CONtrol Registers. INTCON1 conatains the interrupt NeSting DISable bit, as well as status flags for the processor trap sources. The INCON2 register controls the external interrupt request signal and the use of the alternative vector table. IFS0,IFS1,IFS2 Interrupt Flag Status Registers conatain all the interrupt request flags. Each source of interrupt has a status bit, which is set by it s respective peripherals or external signal and is cleared via software. IEC0,IEC1,IEC2 Interrupt Enable Control Registers contain all the interrupt enable bits. These bits are used to individually enable interrupts from the peripherals or external signals. IPC0 IPC11 Interrupt Priority Control Registers are used to set each user interrupt source to one of the eight priority levels. ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 2
3 SR The Status Register is NOT specifically part of the interrupt controller hardware, but if contains the IPL<2:0> status bits that indicates the current CPU priority level. The user may change the current CPU priority by to these IPL bits. CORCON CORe CONtrol register is NOT specifically part of the interrupt controller hardware, but if contains the IPL3 status bit which indicates the current CPU priority level. IPLs is a Read ONLY bit so that trap events can not be masked by the user software. Interrupt initialization 1. Set the NSTDIS (NeSTed DISabled) in INTCON1<15> if nested interrupts are not required. 2. Select the user assigned priority level for the interrupt source (if more than one interrupt is used and the priority of the interrupt events are essential) by writing the control bits in the appropriate IPCx Control register. 3. Clear the interrupt flag status bit associated with the peripheral in the associated IFSx Stauts register. 4. Enable the interrupt source by setting the interrupt enable control bit associated with the source in the appropriate IECx Control register. Interrupt enable bits in IEC0,IEC1,IEC2 registers are set to enable appropriate interrupt. The dspic30f keeps all interrupt vectors in Interrupt Vector Table (IVT) ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 3
4 MPLAB XC16 compiler automatically associates interrupt vectors with special user defined C functions as long as : They do not return any value (use type void). No parameter can be passed to the function (use parameter void). They cannot be called directly by other functions. The following example illustrates the syntax that could be used to associate a function to the Timer1 interrupt vector: void attribute (( interrupt)) _T1Interrupt ( void) { // interrupt service routine code here... } // InterruptVector In practice, to avoid the verbose syntax attribute (( interrupt)), it is more convenient to use the predefined macro _ISR as in the following example: void _ISR _T1Interrupt (void) { // interrupt service routine code here... } // InterruptVector ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 4
5 /* File: newmainxc16.c * Author: parchizh * * Created on 02 March 2015, 13:28 */ #include "p30f4012.h" // // Macros for Configuration Fuse Registers _FOSC(CSW_FSCM_OFF & XT_PLL16); /* Set up for Crystal */ _FWDT(WDT_OFF); /* Turn off the Watch-Dog Timer. */ /* Enable MCLR reset pin and turn off the power-up timers. */ _FBORPOR(PBOR_OFF & MCLR_EN); _FGS(CODE_PROT_OFF); /* Disable Code Protection */ /* Global Variables and Functions */ // #define _ISR attribute ((interrupt)) void main(void) { // setting up the Timer 1 TRISEbits.TRISE0 = 0; // Configure Port RE0 to be output PR1 = 15151; // set PR1 for 0.5 ms T1CONbits.TSIDL = 0; // off in idle mode T1CONbits.TCS = 0; // use internal clock Tcy T1CONbits.TCKPS = 0; // prescalar 1:1 T1CONbits.TGATE = 0; // no gated operation T1CONbits.TON = 1; // turn the timer ON // Setting up the Interrupt for the Timer 1 IFS0bits.T1IF = 0; // T1 interrupt flag cleared IEC0bits.T1IE = 1; // T1 interrupt enabled } while(1){ } void _ISR _T1Interrupt (void) {// interrupt service routine code here... PORTEbits.RE0 ^=1; // toggle the port pin IFS0bits.T1IF = 0; // clear timer1 flag } // _InterruptVector //************************************************************* //void attribute (( interrupt)) _T1Interrupt ( void) //{ // interrupt service routine code here... // PORTEbits.RE0 ^=1; // toggle the port pin // IFS0bits.T1IF = 0; // clear timer1 flag //} // _InterruptVector //*************************************************************/ /* * File: T12345_Interrupt_Pulse_mainXC16.c * Author: parchizh * * Created on 03 March 2015, 14:39 */ ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 5
6 #include "p30f4012.h" _FOSC(CSW_FSCM_OFF & XT_PLL16); /* Set up for Crystal */ _FWDT(WDT_OFF); /* Turn off the Watch-Dog Timer. */ /* Enable MCLR reset pin and turn off the power-up timers. */ _FBORPOR(PBOR_OFF & MCLR_EN); _FGS(CODE_PROT_OFF); /* Disable Code Protection */ /* Global Variables and Functions */ // #define _ISR attribute ((interrupt)) [ macro example ] void main(void) { TRISB = 0x0000; ADPCFG = 0xFFFF; //Port B is outputs //1st channel is sampled and coverted // Configure Timer1 to sample at 2KHz // Period1 = PR1 * prescaler * Tcy = * 1 * 33ns = ms (2KHz) PR1 = 15151; T1CON = 0b ; // Type A timer = timer 1 // 1X-XXXXXX---X--X TON 1 = timer1 ON // -X0XXXXXX---X--X TSIDL 0 = operate during idle // -X-XXXXXX0--X--X TGATE 0 = Gated Time accumulation disabled // -X-XXXXXX-00X--X TCKPS 00= Timer input prescale 1:1 // -X-XXXXXX---X0-X TSYNC 0 = Do not Sync External clock(when TCS = 1) // -X-XXXXXX---X-0X TCS 0 = Clock source 0=internal(fosc/4) // Configure Timer2 to sample at 4KHz // Period1 = PR2 * prescaler * Tcy = 7575 * 1 * 33ns = ms (4KHz) PR2 = 7575; T2CON = 0b ; // Type B timer = timer 2 // 1X-XXXXXX----X-X TON 1 = timer2 ON // -X0XXXXXX----X-X TSIDL 0 = operate during idle // -X-XXXXXX0---X-X TGATE 0 = Gated Time accumulation disabled // -X-XXXXXX-00-X-X TCKPS 00= Timer input prescale 1:1 // -X-XXXXXX---0X-X T32 0 = Timers 2/3 form separate 16-bit timers // -X-XXXXXX----X-X TCS 0 = Clock source 0=internal(fosc/4) // Configure Timer1 to sample at 8KHz // Period3 = PR3 * prescaler * Tcy = 3788 * 1 * 33ns = ms (8KHz) PR3 = 3788; T3CON = 0b ; // Type C timer = timer 3 // 1X-XXXXXX---XX-X TON 1 = timer3 ON // -X0XXXXXX---XX-X TSIDL 0 = operate during idle // -X-XXXXXX0--XX-X TGATE 0 = Gated Time accumulation disabled // -X-XXXXXX-00XX-X TCKPS 00= Timer input prescale 1:1 // -X-XXXXXX---XX0X TCS 0 = Clock source 0=internal(fosc/4) // Configure Timer2 to sample at 16KHz // Period4 = PR4 * prescaler * Tcy = 1894 * 1 * 33ns = ms (16KHz) PR4 = 1894; T4CON = 0b ; // Type B timer = timer 4 // 1X-XXXXXX----X-X TON 1 = timer4 ON // -X0XXXXXX----X-X TSIDL 0 = operate during idle // -X-XXXXXX0---X-X TGATE 0 = Gated Time accumulation disabled // -X-XXXXXX-00-X-X TCKPS 00= Timer input prescale 1:1 // -X-XXXXXX---0X-X T32 0 = Timers 4/5 form separate 16-bit timers // -X-XXXXXX----X-X TCS 0 = Clock source 0=internal(fosc/4) // Configure Timer1 to sample at 32KHz // Period5 = PR5 * prescaler * Tcy = 947 * 1 * 33ns = ms (32KHz) PR5 = 947; ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 6
7 T5CON = 0b ; // Type C timer = timer 5 // 1X-XXXXXX---XX-X TON 1 = timer3 ON // -X0XXXXXX---XX-X TSIDL 0 = operate during idle // -X-XXXXXX0--XX-X TGATE 0 = Gated Time accumulation disabled // -X-XXXXXX-00XX-X TCKPS 00= Timer input prescale 1:1 // -X-XXXXXX---XX0X TCS 0 = Clock source 0=internal(fosc/4) // Configure Interrupt Priority IPC0 = 0b ; //X001X---X---X--- timer 1 IP level 1 IPC1 = 0b ; // timer 3 IP level 1, timer 2 IP level 1 IPC5 = 0b ; // timer 5 IP level 1, timer 4 IP level 1 // Clear Interrupt Flags IFS0 = 0b ; // T3IF = 0, T2IF = 0 IFS1 = 0b ; // T5IF = 0, T4IF = 0 // Enable Interrupts IEC0 = 0b ; // T3IE = 1, T2IE = 1, T1IE = 1 IEC1 = 0b ; // T5IE = 1, T4IE = 1 } while(1) {} // Timer 1 interrupt service routine toggles RB0 void _ISR _T1Interrupt(void) { _LATB0 = ~_LATB0; _T1IF = 0; } // Timer 2 interrupt service routine toggles RB1 void _ISR _T2Interrupt(void){ _LATB1 = ~_LATB1; _T2IF = 0; } // Timer 3 interrupt service routine toggles RB2 void _ISR _T3Interrupt(void){ _LATB2 = ~_LATB2; _T3IF = 0; } // Timer 4 interrupt service routine toggles RB3 void _ISR _T4Interrupt(void){ _LATB3 = ~_LATB3; _T4IF = 0; } // Timer 5 interrupt service routine toggles RB4 void _ISR _T5Interrupt(void){ _LATB4 = ~_LATB4; _T5IF = 0; } // Timer 1 interrupt service routine toggles RB0 //void attribute ((interrupt)) _T1Interrupt(void){ // _LATB0 = ~_LATB0; // _T1IF = 0; //} ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 7
8 ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 8
9 ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 9
10 ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 10
11 ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 11
12 ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 12
13 ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 13
14 ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 14
15 errupt is generated. ENG721-S2 Mixed Signal Processing : Hassan Parchizadeh Page 15
Microprocessors B (17.384) Spring Lecture Outline
Microprocessors B (17.384) Spring 2013 Lecture Outline Class # 04 February 12, 2013 Dohn Bowden 1 Today s Lecture Administrative Microcontroller Hardware and/or Interface Programming/Software Lab Homework
More informationInterrupts. Embedded Systems Interfacing. 08 September 2011
08 September 2011 An iterrupt is an internal or external event that forces a hardware call to a specified function called an interrupt service routine Interrupt enable must be set (initialization) The
More informationSection 6. Interrupts
Section. Interrupts Interrupts HIGHLIGHTS This section of the manual contains the following topics:.1 Introduction... -2.2 Non-Maskable Traps... -7.3 Interrupt Processing Timing...-13.4 Interrupt Control
More informationSection 32. Interrupts (Part III)
HIGHLIGHTS Section 32. Interrupts (Part III) This section of the manual contains the following topics: 32 32.1 Introduction... 32-2 32.2 Non-Maskable Traps... 32-7 32.3 Interrupt Processing Timing... 32-13
More informationSection 28. Interrupts (Part 2)
Section 28. Interrupts (Part 2) HIGHLIGHTS This section of the manual contains the following topics: 28.1 Introduction... 28-2 28.2 Non-Maskable Traps... 28-6 28.3 Interrupt Processing Timing... 28-11
More informationUNCA CSCI 255 Exam 3 Fall 2011
UNCA CSCI 255 Exam 3 Fall 2011 This is a closed book and closed notes exam. Laptops, cell phones, and any other electronic storage or communication devices may not be used during this exam. Name: KEY If
More informationCapture Mode of Pic18F252
Capture Mode of Pic18F252 PIC18F253 has two Capture/Compare/Pulse Width Modulation modules. Some devices such as ADCs, Sensors (position, velocity, accelearstion, temperature [MAX6577 converts the ambient
More informationMicrocomputers. Polled IO versus Interrupt Driven IO
Microcomputers PIC24 Interrupts Lecture 6-1 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, processor
More informationBasic Embedded Software C Review Using MPLAB SIM. Loops. Embedded Systems Interfacing. 25 August 2011
25 August 2011 Basic Embedded Software Structure No Operating System to Return to Could Let Program Execute and Reset, But That s Not Efficient Main Function Initialization Code Endless Loop The while
More information11010 SBC 16-bit Architecture, C30 & Standard Peripherals Hand Out
11010 SBC 16-bit Architecture, C30 & Standard Peripherals Hand Out 2005 Microchip Technology Incorporated. All Rights Reserved Page 1 MPLAB Navigation Quick ways to find functions or variables in MPLAB
More informationEE4390 Microprocessors
EE4390 Microprocessors Lessons 23, 24 - Exceptions - Resets and Interrupts Revised: Aug 1, 2003 1 - Exceptions - Resets and Interrupts Polling vs. Interrupts Exceptions: Resets and Interrupts 68HC12 Exceptions
More informationSection 30. I/O Ports with Peripheral Pin Select
Section I/O Ports with Peripheral Pin Select HIGHLIGHTS This section contains the following major topics: 1 Introduction -2 2 I/O Port Control Registers -3 3 Peripheral Multiplexing -5 4 Peripheral Pin
More informationEE Embedded Systems Design. Lessons Exceptions - Resets and Interrupts
EE4800-03 Embedded Systems Design Lessons 7-10 - Exceptions - Resets and Interrupts 1 - Exceptions - Resets and Interrupts Polling vs. Interrupts Exceptions: Resets and Interrupts 68HC12 Exceptions Resets
More informationInterrupts on PIC18F252 Part 2. Interrupts Programming in C Language
Interrupts on PIC18F252 Part 2 Interrupts Programming in C Language Programming interrupts in C language using XC8 compiler is significantly simplified compared to C18 compiler. This note explains the
More informationdspic30f6010 Family Silicon Errata and Data Sheet Clarification (1) Revision ID for Silicon Revision (2)
dspic30f6010 Family Silicon Errata and Data Sheet Clarification The dspic30f6010 family devices that you have received conform functionally to the current Device Data Sheet (DS70119E), except for the anomalies
More informationUsing Timers of Microchip PIC18F Microcontrollers
Using Timers of Microchip PIC18F Microcontrollers ARSLAB - Autonomous and Robotic Systems Laboratory Dipartimento di Matematica e Informatica - Università di Catania, Italy santoro@dmi.unict.it L.A.P.
More informationCENG-336 Introduction to Embedded Systems Development. Timers
CENG-336 Introduction to Embedded Systems Development Timers Definitions A counter counts (possibly asynchronous) input pulses from an external signal A timer counts pulses of a fixed, known frequency
More informationREPORT MICROCHIP CONTROLLER UNITS AND DIGITAL TECHNICS PRACTICING. Student : Đỗ Thành Trung Student Number : Class : 14146CL2 CONTENT :
REPORT CONTENT : MICROCHIP CONTROLLER UNITS AND DIGITAL TECHNICS PRACTICING Lecturer : Student : Mst. Bùi Hà Đức Đỗ Thành Trung Student Number : 14146279 Class : 14146CL2 Ho Chi Minh city, 26 th October
More informationEE6008-Microcontroller Based System Design Department Of EEE/ DCE
UNIT- II INTERRUPTS AND TIMERS PART A 1. What are the interrupts available in PIC? (Jan 14) Interrupt Source Enabled by Completion Status External interrupt from INT INTE = 1 INTF = 1 TMR0 interrupt T0IE
More informationTimer0..Timer3. Interrupt Description Input Conditions Enable Flag
Timer0..Timer3 Timers are pretty useful: likewise, Microchip provides four different timers for you to use. Like all interrupts, you have to Enable the interrupt, Set the conditions of the interrupt, and
More informationM68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1
M68HC08 Microcontroller The MC68HC908GP32 Babak Kia Adjunct Professor Boston University College of Engineering Email: bkia -at- bu.edu ENG SC757 - Advanced Microprocessor Design General Description The
More informationBy the end of Class. Outline. Homework 5. C8051F020 Block Diagram (pg 18) Pseudo-code for Lab 1-2 due as part of prelab
By the end of Class Pseudo-code for Lab 1-2 due as part of prelab Homework #5 on website due before next class Outline Introduce Lab 1-2 Counting Timers on C8051 Interrupts Laboratory Worksheet #05 Copy
More informationINTERRUPTS in microprocessor systems
INTERRUPTS in microprocessor systems Microcontroller Power Supply clock fx (Central Proccesor Unit) CPU Reset Hardware Interrupts system IRQ Internal address bus Internal data bus Internal control bus
More informationME 6405 Introduction to Mechatronics
ME 6405 Introduction to Mechatronics Fall 2006 Instructor: Professor Charles Ume Microchip PIC Manufacturer Information: Company: Website: http://www.microchip.com Reasons for success: Became the hobbyist's
More informationMark Redekopp, All rights reserved. EE 357 Unit 10b. Interrupts Timers
EE 357 Unit 10b Interrupts Timers IPL bits Coldfire / M68K Interrupts Coldfire interrupt architecture is based on original M68K 3-bit input (IPL[2:0]) indicating interrupt requests/priorities 000 = No
More informationPIC32&Overview& E155&
PIC32&Overview& E155& Outline PIC 32 Architecture MIPS M4K Core PIC 32 Peripherals PIC 32 Basic Operations Clock 2 Microcontroller Approximately $16B of microcontrollers were sold in 2011, and the market
More informationEmbedded systems. Exercise session 3. Microcontroller Programming Lab Preparation
Embedded systems Exercise session 3 Microcontroller Programming Lab Preparation Communications Contact Mail : michael.fonder@ulg.ac.be Office : 1.82a, Montefiore Website for the exercise sessions and the
More informationInterrupt/Timer/DMA 1
Interrupt/Timer/DMA 1 Exception An exception is any condition that needs to halt normal execution of the instructions Examples - Reset - HWI - SWI 2 Interrupt Hardware interrupt Software interrupt Trap
More informationWhat happens when an HC12 gets in unmasked interrupt:
What happens when an HC12 gets in unmasked interrupt: 1. Completes current instruction 2. Clears instruction queue 3. Calculates return address 4. Stacks return address and contents of CPU registers 5.
More informationInterrupts on PIC18F252 Part 2
Interrupts on PIC18F252 Part 2 Following pages list Special Function Registers (SFRs) involved in interrupt configuration and operation on PIC18F252 microcontroller. (Copied from Microchip s PIC18Fxx2
More informationDepartment of Electronics and Instrumentation Engineering Question Bank
www.examquestionpaper.in Department of Electronics and Instrumentation Engineering Question Bank SUBJECT CODE / NAME: ET7102 / MICROCONTROLLER BASED SYSTEM DESIGN BRANCH : M.E. (C&I) YEAR / SEM : I / I
More informationoriginal M68K requests/priorities Interrupts to execute important code interrupts (n will always be I) I-bits bits in SR accomplish this
Coldfire / M68K Interrupts EE 5 Unit 1b Interrupts Timers Coldfire interrupt architecture is based on original M68K -bit input (IPL[2:]) indicating interrupt requests/priorities = No interrupt t 1-111
More informationSection 10. Watchdog Timer and Power Saving Modes
Section 10. Watchdog Timer and Power Saving Modes HIGHLIGHTS This section of the manual contains the following topics: 10.1 Introduction... 10-2 10.2 Power Saving Modes... 10-2 10.3 Sleep Mode...10-2 10.4
More informationARM Embedded Systems: ARM Design philosophy, Embedded System Hardware, Embedded System Software
Department of Technical Education DIPLOMA COURSE IN ELECTRONICS AND COMMUNICATION ENGINEERING Sixth Semester ARM MICROCONTROLLER Contact Hours/Week : 04 Contact Hours/Semester : 64 CONTENTS Unit-I No.
More informationAVR XMEGA Product Line Introduction AVR XMEGA TM. Product Introduction.
AVR XMEGA TM Product Introduction 32-bit AVR UC3 AVR Flash Microcontrollers The highest performance AVR in the world 8/16-bit AVR XMEGA Peripheral Performance 8-bit megaavr The world s most successful
More informationEmbedded Systems. 3. Hardware Software Interface. Lothar Thiele. Computer Engineering and Networks Laboratory
Embedded Systems 3. Hardware Software Interface Lothar Thiele Computer Engineering and Networks Laboratory Do you Remember? 3 2 3 3 High Level Physical View 3 4 High Level Physical View 3 5 What you will
More informationdspic30f6011/ 6012/6013/6014
dspic30f6011/ 6012/6013/6014 dspic30f6011/6012/6013/6014 Rev. B2 Silicon Errata The dspic30f6011/6012/6013/6014 (Rev. B2) samples that you have received were found to conform to the specifications and
More informationSection 38. Direct Memory Access (DMA) (Part III)
Section 38. Direct Memory Access () (Part III) HIGHLIGHTS This section of the manual contains the following topics 38.1 Introduction... 38-2 38.2 Registers... 38-3 38.3 Block Diagram... 38-12 38.4 Data
More informationFredrick M. Cady. Assembly and С Programming forthefreescalehcs12 Microcontroller. шт.
SECOND шт. Assembly and С Programming forthefreescalehcs12 Microcontroller Fredrick M. Cady Department of Electrical and Computer Engineering Montana State University New York Oxford Oxford University
More informationSection 11. Timer0. Timer0 HIGHLIGHTS. This section of the manual contains the following major topics:
M 11 Section 11. HIGHLIGHTS This section of the manual contains the following major topics: 11.1 Introduction...11-2 11.2 Control Register...11-3 11.3 Operation...11-4 11.4 TMR0 Interrupt...11-5 11.5 Using
More informationThe University of Texas at Arlington Lecture 21_Review
The University of Texas at Arlington Lecture 21_Review CSE 5442/3442 Agenda Tuesday December 1st Hand back Homework 7,8 and 9. Go over questions and answers Exam 3 Review Note: There will be a take home
More information/*Algorithm: This code display a centrifuge with five variable speed RPM by increaseing */
/*Algorithm: This code display a centrifuge with five variable speed RPM by increaseing */ /*the speed the cell which are less dense can float and the cell that are denser can sink*/ /*the user has five
More informationUNIT - II PERIPHERAL INTERFACING WITH 8085
UNIT - II PERIPHERAL INTERFACING WITH 8085 Peripheral Interfacing is considered to be a main part of Microprocessor, as it is the only way to interact with the external world. The interfacing happens with
More informationChapter 9 Interrupt Controller
Chapter 9 Interrupt Controller This chapter describes the operation of the interrupt controller portion of the system integration module (SIM). It includes descriptions of the registers in the interrupt
More informationSignals, Instruments, and Systems W8. More on Embedded Systems. Embedded Software
Signals, Instruments, and Systems W8 More on Embedded Systems Mobile Robots and Embedded Software Outline General concepts in robotics: autonomy, controllers, control loop The e-puck miniature robot General
More informationUnderstanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices,
Understanding the basic building blocks of a microcontroller device in general. Knows the terminologies like embedded and external memory devices, CISC and RISC processors etc. Knows the architecture and
More informationTypes of Interrupts:
Interrupt structure Introduction Interrupt is signals send by an external device to the processor, to request the processor to perform a particular task or work. Mainly in the microprocessor based system
More informationDesign and Implementation Interrupt Mechanism
Design and Implementation Interrupt Mechanism 1 Module Overview Study processor interruption; Design and implement of an interrupt mechanism which responds to interrupts from timer and UART; Program interrupt
More informationAnalog Output with a Digital to Analog Converter
Analog Output with a Digital to Analog Converter Matthew Beckler beck0778@umn.edu EE2361 Lab 007 April 5, 2006 Abstract Without help, microcontrollers can have great trouble creating analog signals. Approximations
More informationSECTION 5 RESETS AND INTERRUPTS
SECTION RESETS AND INTERRUPTS Resets and interrupt operations load the program counter with a vector that points to a new location from which instructions are to be fetched. A reset immediately stops execution
More informationSection 20. Serial Peripheral Interface (SPI)
Section 20. Serial Peripheral Interface (SPI) HIGHLIGHTS This section of the manual contains the following major topics: 20.1 Introduction... 20-2 20.2 Status and Control Registers... 20-4 20.3 Modes of
More informationECE 372 Microcontroller Design Parallel IO Ports - Interrupts. ECE 372 Microcontroller Design Parallel IO Ports - Interrupts
Interrupts An interrupt can be compared with a phone call interrupting your task which you will resume when the call is finished You can mask an interrupt just as you can decide not to answer any phone
More informationAVR XMEGA TM. A New Reference for 8/16-bit Microcontrollers. Ingar Fredriksen AVR Product Marketing Director
AVR XMEGA TM A New Reference for 8/16-bit Microcontrollers Ingar Fredriksen AVR Product Marketing Director Kristian Saether AVR Product Marketing Manager Atmel AVR Success Through Innovation First Flash
More informationChapter 2. Overview of Architecture and Microcontroller-Resources
Chapter 2 Overview of Architecture and Microcontroller-Resources Lesson 4 Timers, Real Time Clock Interrupts and Watchdog Timer 2 Microcontroller-resources Port P1 Port P0 Port P2 PWM Timers Internal Program
More informationPIC Microcontroller Introduction
PIC Microcontroller Introduction The real name of this microcontroller is PICmicro (Peripheral Interface Controller), but it is better known as PIC. Its first ancestor was designed in 1975 by General Instruments.
More informationProduct Update. Errata to Z8 Encore! 8K Series Silicon. Z8 Encore! 8K Series Silicon with Date Codes 0402 and Later
Product Update Errata to Z8 Encore! 8K Series Silicon Z8 Encore! 8K Series Silicon with Date Codes 0402 and Later The errata listed in Table 1 are found in the Z8 Encore! 8K Series devices with date codes
More informationIntroduction to ARM LPC2148 Microcontroller
Introduction to ARM LPC2148 Microcontroller Dr.R.Sundaramurthy Department of EIE Pondicherry Engineering College Features of LPC2148 in a Nut Shell CPU = ARM 7 Core Word Length = 32 Bit ROM = 512 KB RAM
More informationSection 30. I/O Ports with Peripheral Pin Select (PPS)
Section 30 I/O Ports with Peripheral Pin Select (PPS) HIGHLIGHTS This section contains the following major topics: 301 Introduction 30-2 302 I/O Port Control Registers 30-3 303 Peripheral Multiplexing
More informationAVR42772: Data Logger Demo Application on XMEGA A1U Xplained Pro. Introduction. Features. AVR XMEGA Microcontrollers APPLICATION NOTE
AVR XMEGA Microcontrollers AVR42772: Data Logger Demo Application on XMEGA A1U Xplained Pro APPLICATION NOTE Introduction This application note covers some of the power saving features of the Atmel XMEGA
More informationChapter 6 PROGRAMMING THE TIMERS
Chapter 6 PROGRAMMING THE TIMERS Lesson 3 Real Time Clocked Interrupts and Software Timers 2 Real Time Clock Interrupt 3 Real Time interrupts Prescaling Pre-scaling by RT1-RT0 bits for 4 or 8 or 16 2 13
More informationUNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2013
Introduction Reading Concepts UNIVERSITY OF CALIFORNIA, SANTA CRUZ BOARD OF STUDIES IN COMPUTER ENGINEERING CMPE13/L: INTRODUCTION TO PROGRAMMING IN C SPRING 2013 Lab 2 Bouncing LEDs In this lab, you will
More informationacret Ameya Centre for Robotics & Embedded Technology Syllabus for Diploma in Embedded Systems (Total Eight Modules-4 Months -320 Hrs.
acret Ameya Centre for Robotics & Embedded Technology Syllabus for Diploma in Embedded Systems (Total Eight Modules-4 Months -320 Hrs.) Module 0 Introduction Introduction to Embedded Systems, Real Time
More informationInterrupt and Timer ISRs. Student's name & ID: Partner's name(s) & ID(s): Your Section number & TA's name
MPS Interrupt Lab Exercise Interrupt and Timer ISRs Student's name & ID: Partner's name(s) & ID(s): Your Section number & TA's name Notes: You must work on this assignment with your partner. Hand in a
More information2. List the five interrupt pins available in INTR, TRAP, RST 7.5, RST 6.5, RST 5.5.
DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EE6502- MICROPROCESSORS AND MICROCONTROLLERS UNIT I: 8085 PROCESSOR PART A 1. What is the need for ALE signal in
More informationMICROPROCESSOR BASED SYSTEM DESIGN
MICROPROCESSOR BASED SYSTEM DESIGN Lecture 5 Xmega 128 B1: Architecture MUHAMMAD AMIR YOUSAF VON NEUMAN ARCHITECTURE CPU Memory Execution unit ALU Registers Both data and instructions at the same system
More informationCN310 Microprocessor Systems Design
CN310 Microprocessor Systems Design Microcontroller Nawin Somyat Department of Electrical and Computer Engineering Thammasat University Outline Course Contents 1 Introduction 2 Simple Computer 3 Microprocessor
More informationSpeed Control of a DC Motor using Digital Control
Speed Control of a DC Motor using Digital Control The scope of this project is threefold. The first part of the project is to control an LCD display and use it as part of a digital tachometer. Secondly,
More informationThe MC9S12 Timer Input Capture Function
The MC9S12 Timer Input Capture Function o Capturing the time of an external event o The MC9S12 Input Capture Function o Registers used to enable the Input Capture Function o Using the MC9S12 Input Capture
More informationThe MC9S12 Timer Output Compare Function Making an event happen at specific time on the HC12 The MC9S12 Output Compare Function
The MC9S12 Timer Output Compare Function Making an event happen at specific time on the HC12 The MC9S12 Output Compare Function o Registers used to enable the output compare function o Using the MC9S12
More informationCapturing the Time of an External Event Input Capture Subsystem
Capturing the Time of an External Event Input Capture Subsystem One way to determine the time of an external event is to wait for the event to occur, the read the TCNT register: For example, to determine
More informationAVR Timers TIMER0. Based on:
AVR Timers TIMER0 Based on: http://maxembedded.wordpress.com/2011/06/24/avr-timers-timer0-2/ The basic concepts of AVR Timers. Let me summarize it: We have seen how timers are made up of registers, whose
More informationThe K Project. Interrupt and Exception Handling. LSE Team. May 14, 2018 EPITA. The K Project. LSE Team. Introduction. Interrupt Descriptor Table
and Exception Handling EPITA May 14, 2018 (EPITA) May 14, 2018 1 / 37 and Exception Handling Exception : Synchronous with program execution (e.g. division by zero, accessing an invalid address) : Asynchronous
More informationSYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET
1 SYLLABUS UNIT - I 8086/8088 ARCHITECTURE AND INSTRUCTION SET Intel 8086/8088 Architecture Segmented Memory, Minimum and Maximum Modes of Operation, Timing Diagram, Addressing Modes, Instruction Set,
More informationGrundlagen Microcontroller Interrupts. Günther Gridling Bettina Weiss
Grundlagen Microcontroller Interrupts Günther Gridling Bettina Weiss 1 Interrupts Lecture Overview Definition Sources ISR Priorities & Nesting 2 Definition Interrupt: reaction to (asynchronous) external
More informationMPLAB SIM. MPLAB IDE Software Simulation Engine Microchip Technology Incorporated MPLAB SIM Software Simulation Engine
MPLAB SIM MPLAB IDE Software Simulation Engine 2004 Microchip Technology Incorporated MPLAB SIM Software Simulation Engine Slide 1 Welcome to this web seminar on MPLAB SIM, the software simulator that
More informationPPG Function of F2MC-16LX MCU Series as PWM
PPG Function of F2MC-16LX MCU Series as PWM Introduction... 1 PPG Function... 1 Important Register Configuration... 2 Flow chart... 3 Program Code... 4 Fujitsu Microelectronics America, Inc. i PPG Function
More informationMicroprocessors & Interfacing
Lecture Overview Microprocessors & Interfacing Interrupts (I) Lecturer : Dr. Annie Guo Introduction to Interrupts Interrupt system specifications Multiple sources of interrupts Interrupt priorities Interrupts
More information8-bit Microcontroller. Application Note. AVR134: Real-Time Clock (RTC) using the Asynchronous Timer. Features. Theory of Operation.
AVR134: Real-Time Clock (RTC) using the Asynchronous Timer Features Real-Time Clock with Very Low Power Consumption (4µA @ 3.3V) Very Low Cost Solution Adjustable Prescaler to Adjust Precision Counts Time,
More information#include "p30f3011.h" #include "svm3011 v1.2.h"
//--------------------------------------------------------------------- // File: sinusoidal BLDC v1.2.c // // Written By: Jorge Zambada, Microchip Technology // // The following files should be included
More informationINTERRUPT, TIMER/COUNTER. KONKUK UNIV. VLSI Design Lab. LSI Design Lab
INTERRUPT, TIMER/COUNTER KONKUK UNIV. V. 1 INTERRUPT 의개요 외부의요구에의해서현재실행중인프로그램을일시중지하고보다시급한작업을먼저수행한후다시원래의프로그램으로복귀하는것. EX) 스타를하다가택배가오면스타를일시중지하고택배를받은후다시스타를진행함. Interrupt 방식 : 택배아저씨가초인종을눌러줌. Polling 방식 : 택배아저씨가오는지일정시간간격으로살펴봄.
More informationInterrupts (I) Lecturer: Sri Notes by Annie Guo. Week8 1
Interrupts (I) Lecturer: Sri Notes by Annie Guo Week8 1 Lecture overview Introduction to Interrupts Interrupt system specifications Multiple Sources of Interrupts Interrupt Priorities Interrupts in AVR
More informationSection 9. Watchdog Timer (WDT) and Power-Saving Modes
Section 9. Watchdog Timer (WDT) and Power-Saving Modes HIGHLIGHTS This section of the manual contains the following topics: 9.1 Introduction... 9-2 9.2 Power-Saving Modes... 9-2 9.3 Watchdog Timer (WDT)...
More informationInterrupts, timers and counters
Interrupts, timers and counters Posted on May 10, 2008, by Ibrahim KAMAL, in Micro-controllers, tagged Most microcontrollers come with a set of ADD-ONs called peripherals, to enhance the functioning of
More information8. Power Management and Sleep Modes
8. Power Management and Sleep Modes 8.1 Features Power management for adjusting power consumption and functions Five sleep modes Idle Power down Power save Standby Extended standby Power reduction register
More informationCPEG300 Embedded System Design. Lecture 6 Interrupt System
CPEG300 Embedded System Design Lecture 6 Interrupt System Hamad Bin Khalifa University, Spring 2018 Correction Lecture 3, page 18: Only direct addressing mode is allowed for pushing or popping the stack:
More informationMicrocontroller Overview
Microcontroller Overview Microprocessors/Microcontrollers/DSP Microcontroller components Bus Memory CPU Peripherals Programming Microcontrollers vs. µproc. and DSP Microprocessors High-speed information
More informationCPUs. Input and output. Supervisor mode, exceptions, traps. Co-processors. Computers as Components 4e 2016 Marilyn Wolf
CPUs Input and output. Supervisor mode, exceptions, traps. Co-processors. I/O devices Usually includes some non-digital component. Typical digital interface to CPU: CPU status reg data reg mechanism Application:
More informationCourse Introduction. Purpose: Objectives: Content: 27 pages 4 questions. Learning Time: 20 minutes
Course Introduction Purpose: This course provides an overview of the Direct Memory Access Controller and the Interrupt Controller on the SH-2 and SH-2A families of 32-bit RISC microcontrollers, which are
More informationTimer2 Interrupts. NDSU Timer2 Interrupts September 20, Background:
Background: Timer2 Interrupts The execution time for routines sometimes needs to be set. This chapter loops at several ways to set the sampling rate. Example: Write a routine which increments an 8-bit
More informationwhich means that writing to a port implies that the port pins are first read, then this value is modified and then written to the port data latch.
Introduction to microprocessors Feisal Mohammed 3rd January 2001 Additional features 1 Input/Output Ports One of the features that differentiates a microcontroller from a microprocessor is the presence
More informationDesign with Microprocessors
Design with Microprocessors Year III Computer Science 1-st Semester Lecture 11: I/O transfer with x86 I/O Transfer I/O Instructions We discussed IN, OUT, INS and OUTS as instructions for the transfer of
More informationEE 308 Spring A software delay
A software delay To enter a software delay, put in a nested loop, just like in assembly. Write a function delay(num) which will delay for num milliseconds void delay(unsigned int num) volatile unsigned
More informationIntroduction. Prerequisites: Procedure Steps. Step1: Downloading and Adding the MCC Plugin
Introduction This document has details of implementation of rgb_led demo on MPLAB X IDE using the MCC plugin. The rgb_led demo displays a colour on the RGB LED. The colour changes from RED->GREEN, GREEN->BLUE,
More informationHi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan
Interrupts and Resets Hi Hsiao-Lung Chan Dept Electrical Engineering Chang Gung University, Taiwan chanhl@mail.cgu.edu.twcgu Interrupts An event that will cause the CPU to stop the normal program execution
More informationVORAGO VA108x0 I 2 C programming application note
AN1208 VORAGO VA108x0 I 2 C programming application note MARCH 14, 2017 Version 1.1 VA10800/VA10820 Abstract There are hundreds of peripheral devices utilizing the I 2 C protocol. Most of these require
More informationModule Introduction. PURPOSE: The intent of this module is to explain MCU processing of reset and interrupt exception events.
Module Introduction PURPOSE: The intent of this module is to explain MCU processing of reset and interrupt exception events. OBJECTIVES: - Describe the difference between resets and interrupts. - Identify
More informationdspic LANGUAGE TOOLS GETTING STARTED
dspic LANGUAGE TOOLS GETTING STARTED 2003 Microchip Technology Inc. DS70094B Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained
More informationMicroprocessors and Microcontrollers (EE-231)
Microprocessors and Microcontrollers (EE-231) Objective Interrupts Programming in C In Proteus On 8051 development board Interrupt An interrupt is an external or internal event that interrupts the microcontroller
More informationCPEG300 Embedded System Design. Lecture 8 Timer
CPEG300 Embedded System Design Lecture 8 Timer Hamad Bin Khalifa University, Spring 2018 Review 8051 port and port schematic Internal read/write data path Serial communication vs. parallel communication
More informationHC12 Built-In Hardware
HC12 Built-In Hardware The HC12 has a number of useful pieces of hardware built into the chip. Different versions of the HC12 have slightly different pieces of hardware. We are using the MC68HC912B32 chip
More information