ECE251: Thursday September 27

Size: px
Start display at page:

Download "ECE251: Thursday September 27"

Transcription

1 ECE251: Thursday September 27 Exceptions: Interrupts and Resets Chapter in text and Lab #6. READ ALL this material! This will NOT be on the mid-term exam. Lab Practical Exam #1 Homework # due today at 4:00 Mid-term exam on October 4, next Thursday. Review Tues. Be ready with questions! Practical Exam #1 on week of October 8 in lab Lecture # 1

2 Previous Homework Question 1. Write an assembly language program that calls a subroutine which replaces all ASCII digits (0-9) of a string with the # symbol. Memory location of the string is passed on the top of the stack. The string is terminated with the null symbol, value =0. Str DCB Te5t Str1ng 0 and 1, #0 main LDR, =Str PUSH {} BL Digit_replace... Lecture # 2

3 New Topic: Exceptions & Interrupts Exception: A break in normal program flow execution is interrupted by some event, usually external to the CPU. Common Examples of Exceptions: Reset: Power up or warm start NMI: Non-maskable interrupt usually an external NMI signal Memory Management Fault: memory protection violation Usage Fault: undefined instruction, SVCall: Supervisory call SysTick: System Timer (we will cover this in lecture/lab) Interrupt (IRQ): Typically created by peripherals External I/O device (e.g. keyboard, printer) Internal event (e.g. op code fault, timer) See TM4C Data Sheet, Section 2.5 Lecture #

4 Fundamental Concepts of Interrupts What is an interrupt? A special event that requires the CPU to stop normal program execution and perform some action (service) related to the event. Examples of interrupts include I/O completion and real-time interrupt. Functions of Interrupts - Coordinates I/O activities and prevents CPU from being tied up checking on these activities (polling) - Reminds the CPU to perform routine tasks (real-time interrupt) - Provides a graceful way to exit from errors Interrupt Maskability - Interrupts that can be ignored by the CPU are called maskable interrupts. A maskable interrupt must be enabled before it can interrupt the CPU. An interrupt is enabled by setting an enable flag. - Interrupts that are never ignored by the CPU are called nonmaskable interrupts and include things like special NMI hardware Lecture # 4

5 Interrupts vs. Polling Polling: Monitoring, waiting for flag to set Program is tied up waiting for flag Inefficient use of processor Easily programmed Interrupt: Processor tells program when event has occurred Program can be executing other tasks Processor can perform activities real-time Analogy: Waiting for incoming phone call. See following slide Lecture # 5

6 Polling vs. Interrupt Polling: You pick up the phone every few seconds to check whether you are getting a call. Interrupt: Do whatever you need to do and pick up the phone when it rings (or vibrates or ). Lecture # 6

7 Interrupt Processing Hardware Busy Done Busy Main Thread Interrupt Thread Hardware needs service Saves execution state ISR provides service Restores execution state time Lecture # 7

8 Interrupt Conditions Five conditions must be true simultaneously for an interrupt to occur: Software 1. Arm: control bit for each possible source is set or armed 2. Enable NVIC: Set NVIC_E register bit appropriately. Enable: interrupts globally enabled (I=0 in PRIMASK) 4. Level: interrupt must be less than BASEPRI (priority higher) 5. Trigger: hardware action sets source-specific flag Interrupt remains pending if trigger is set but any other condition is not true Interrupt serviced once all conditions become true Need to acknowledge interrupt Clear trigger flag or will get endless interrupts! Lecture # 8

9 What To Do When an Interrupt Occurs? Interrupt Service Routine (ISR): The software routine (subroutine) executed by a processor in response to an interrupt. This is similar to a normal software subroutine with important differences: Method by which system enters the subroutine (interrupt vs BL) What s saved when the subroutine is entered Instructions which complete and exit the subroutine, including restoring what was saved above. Lecture # 9

10 Interrupt Service Activity A complete interrupt service action includes: 0. Interrupt occurs during an instruction. Instruction is allowed to complete. 1. Saving r0-r,r,lr,pc,psr in the stack. Why do that? 2. LR set to 0xFFFFFFF9 indicating interrupt being serviced. Identifying the cause of interrupt-sets IPSR to interrupt number 4. Determining the starting address of the corresponding Interrupt Service Routine (ISR), based on the interrupt cause and Interrupt Vector Table entry (we will discuss this). 5. Executing this ISR. 6. Finally, executing BX LR, restoring register entries from stack and continuing execution of the interrupted program, exactly where it was interrupted. Lecture # 10

11 Interrupt Service Responsibilities Processor finishes the current instruction. Processor stores certain register contents on stack. Processor transfers control to ISR associated with that specific interrupt. ISR takes appropriate action including clearing trigger flag When complete, ISR executes BX LR instruction LR has a special meaning here! BX restores register values above BX transfers control to where it left off (next instruction, as if nothing had happened) when the interrupt event occurred Lecture # 11

12 Stack Activity on ISR Start and Exit Old SP Stack descends In memory. New SP SP + 0x20 SP + 0x1C SP + 0x18 SP + 0x14 SP + 0x10 SP + 0x0C SP + 0x08 SP + 0x04 SP + 0x00 xxxxxxxx xpsp PC (r15) LR (r14) r r r2 r1 r0 The processor automatically pushes these eight registers into the main stack before an interrupt handler starts The processor automatically pops these eight register out of the main stack when an interrupt hander exits using BX LR Lecture #

13 How does the CPU find the ISR? Interrupt Vector Starting Address of the Interrupt Service Routine. Programmer must initialize this! Interrupt Vector Table A table (in read-only memory) where all interrupt vectors are stored. Method of Determining Interrupt Vectors 1. Fetching the vector from a predefined location in the Interrupt Vector Table. See next slides. Steps of Programming for an Interrupt Step 0. Interrupt vector table entry and ISR loaded into ROM by assembler/linker/loader at location supplied by programmer Step 1. Enable the specific interrupt Step 2. Set NVIC_E register appropriately Step. Enable global Interrupts (PRIMASK = 0) Lecture # 1

14 Lecture # 14 Interrupt Vector Table

15 Startup.s to Initialize Interrupt Vector Table EXPORT Vectors Vectors DCD StackMem + Stack ; Top of Stack DCD Reset_Handler ; Reset Handler DCD NMI_Handler ; NMI Handler DCD HardFault_Handler ; Hard Fault Handler DCD MemManage_Handler ; MPU Fault Handler DCD BusFault_Handler ; Bus Fault Handler DCD UsageFault_Handler ; Usage Fault Handler DCD 0,0,0,0 ; Reserved DCD SVC_Handler ; SVCall Handler DCD DebugMon_Handler ; Debug Monitor Handler DCD 0 ; Reserved DCD PendSV_Handler ; PendSV Handler DCD SysTick_Handler ; SysTick Handler DCD GPIOPortA_Handler ; GPIO Port A DCD GPIOPortB_Handler ; GPIO Port B DCD GPIOPortC_Handler ; GPIO Port C DCD GPIOPortD_Handler ; GPIO Port D DCD GPIOPortE_Handler ; GPIO Port E DCD UART0_Handler ; UART0 Rx and Tx DCD UART1_Handler ; UART1 Rx and Tx Lecture # 15

16 Interrupt Handling Sequence Lecture # 16

17 Interrupt Context Switch Assume GPIO Port C Interrupt (#18) I 0 IPSR 0 BASEPRI 0 Before interrupt I 0 RAM Context Switch Finish instruction IPSR 18 a) Push registers b) PC = {0x } BASEPRI 0 c) Set IPSR = 18 d) Set LR = 0xFFFFFFF9 Use as stack pointer Stack After interrupt old old old old old 2 old LR old PC old PSR Stack Vector address for GPIO Port C Interrupt Number 18 corresponds to GPIO Port C Lecture # 17

18 Overhead Time for Interrupts The interrupt itself causes the saving of 8 CPU registers then branching to the ISR. Plus the execution of the BX LR instruction restoring these same 8 registers and then branching back to the executing program. Plus the execution time of instructions of the interrupt service routine. SO: Keep ISR short if input/output responsiveness or performance is critical (and it often is). Lecture # 18

19 Stacking & Unstacking ISRs Interrupt Signal Interrupt Handler Interrupt Exit Unstacking User Program User Program Stacking Thread Mode Handler Mode Thread Mode Time Interrupt Handler User Program Lecture # 19

20 Stack Pointer Registers : Main Stack Pointer. We use only this one in ECE251 PSP: Process Stack Pointer Lecture # 20

21 Processor Mode: Handler Mode vs Thread Mode Handler mode for processing exceptions always use (Main Stack Pointer) Thread Mode for application software uses in our system so just forget about this! When the processor is reset, the default is the thread mode. The processor enters the handler mode when an interrupt occurs and returns to thread mode when ISR completes. Your program does not need to worry about this. It happens automatically. Not sure why text writers care so much about this. Lecture # 21

22 Register Values in an Interrupt Service Routine LR = 0xFFFFFFF9! See next slide! SP = ISR always in hander mode. Lecture # 22

23 Where does processing continue when exiting an interrupt? Link Register (LR) now has two usages! With Subroutine Call, LR = address of the instruction immediately after BL In ISR, LR indicates that the stack is used to restore register from when exiting an interrupt LR value generated by processor The processor sets LR to 0xFFFFFFFF on reset. The processor sets LR to 0xFFFFFFF9 on interrupt. Lecture # 2

24 EXAMPLE: Interrupt Stacking & Unstacking main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r, #1 ADD r4, #1 BX lr R4 2 (SP) 4(LR) 5(PC) x x xxxxxxxx 0x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 0x200001E8 0x200001E4 0x200001E0 0x200001DC 0x200001D8 0x200001D4 0x200001D0 0x200001CF Memory Lecture # 24

25 EXAMPLE: Interrupt Suppose SysTick Stacking interrupt & Unstacking occurs when PC = 0x main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r, #1 ADD r4, #1 BX lr R4 2 (SP) 4(LR) 5(PC) x x xxxxxxxx 0x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 0x200001E8 0x200001E4 0x200001E0 0x200001DC 0x200001D8 0x200001D4 0x200001D0 0x200001CF Memory Lecture # 25

26 EXAMPLE: Interrupt Stacking & Unstacking STACKING main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r, #1 ADD r4, #1 BX lr R4 2 (SP) 4(LR) 5(PC) xFFFFFFF9 0x C PC LR 2 xxxxxxxx 0x x x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 2 0x200001E8 1 0x200001E4 0 0x200001E0 0x200001DC 0x200001D8 0x200001E0 0x200001D4 0x200001D0 0x200001CF Memory Lecture # 26

27 EXAMPLE: Interrupt Stacking & Unstacking STACKING main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r, #1 ADD r4, #1 BX lr R4 2 (SP) 4(LR) 5(PC) xFFFFFFF9 0x C PC LR 2 xxxxxxxx 0x x x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 2 0x200001E8 1 0x200001E4 0 0x200001E0 0x200001DC 0x200001D8 LR = 0xFFFFFFF9 to indicate is used. 0x200001E0 Memory 0x200001D4 0x200001D0 0x200001CF Lecture # 27

28 Interrupt: Stacking & Unstacking main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r, #1 ADD r4, #1 BX lr R4 2 (SP) 4(LR) 5(PC) xFFFFFFF9 0x C PC LR 2 xxxxxxxx 0x x x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 2 0x200001E8 1 0x200001E4 0 0x200001E0 0x200001DC 0x200001D8 0x200001E0 0x200001D4 0x200001D0 0x200001CF Memory Lecture # 28

29 Interrupt: Stacking & Unstacking main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r, #1 ADD r4, #1 BX lr R4 2 (SP) 4(LR) 5(PC) xFFFFFFF9 0x PC LR 2 xxxxxxxx 0x x x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 2 0x200001E8 1 0x200001E4 0 0x200001E0 0x200001DC 0x200001D8 0x200001E0 0x200001D4 0x200001D0 0x200001CF Memory Lecture # 29

30 Interrupt: Stacking & Unstacking main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r, #1 ADD r4, #1 BX lr R4 2 (SP) 4(LR) 5(PC) xFFFFFFF9 0x PC LR 2 xxxxxxxx 0x x x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 2 0x200001E8 1 0x200001E4 0 0x200001E0 0x200001DC 0x200001D8 LR = 0xFFFFFFF9 to indicate is used. 0x200001E0 Memory 0x200001D4 0x200001D0 0x200001CF Lecture # 0

31 Interrupt: Stacking & Unstacking UNSTACKING main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r, #1 ADD r4, #1 BX lr R4 2 (SP) 4(LR) 5(PC) xFFFFFFF9 0x PC LR 2 xxxxxxxx 0x x x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 2 0x200001E8 1 0x200001E4 0 0x200001E0 0x200001DC 0x200001D8 LR = 0xFFFFFFF9 to indicate is used. 0x200001E0 Memory 0x200001D4 0x200001D0 0x200001CF Lecture # 1

32 Interrupt: Stacking & Unstacking main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r, #1 ADD r4, #1 BX lr R4 2 (SP) 4(LR) 5(PC) x x xxxxxxxx 0x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 0x200001E8 0x200001E4 0x200001E0 0x200001DC 0x200001D8 Note the new value of is lost!!! Memory 0x200001D4 0x200001D0 0x200001CF Lecture # 2

33 Interrupt: Stacking & Unstacking main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r, #1 ADD r4, #1 BX lr R4 2 (SP) 4(LR) 5(PC) x x xxxxxxxx 0x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 0x200001E8 0x200001E4 0x200001E0 0x200001DC 0x200001D8 The Main program resumes. Memory 0x200001D4 0x200001D0 0x200001CF Lecture #

34 Interrupt: Stacking & Unstacking main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r4, #1 BL sine BX lr R4 2 (SP) 4(LR) 5(PC) x x xxxxxxxx 0x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 0x200001E8 0x200001E4 0x200001E0 0x200001DC 0x200001D8 0x200001D4 0x200001D0 0x200001CF Memory Lecture # 4

35 Interrupt: Stacking & Unstacking STACKING main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r4, #1 BL sine BX lr R4 2 (SP) 4(LR) 5(PC) xFFFFFFF9 0x C PC SP LR xxxxxxxx 0x x x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 2 0x200001E8 1 0x200001E4 0 0x200001E0 0x200001DC 0x200001D8 LR = 0xFFFFFFF9 to indicate is used. 0x200001E0 Memory 0x200001D4 0x200001D0 0x200001CF Lecture # 5

36 Interrupt: Stacking & Unstacking STACKING main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r4, #1 BL sine BX lr R4 2 (SP) 4(LR) 5(PC) x080000F4 0x080000F0 PC SP LR xxxxxxxx 0x x x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 2 0x200001E8 1 0x200001E4 0 0x200001E0 0x200001DC 0x200001D8 BL sine Updates LR register 0x200001E0 Memory 0x200001D4 0x200001D0 0x200001CF Lecture # 6

37 Interrupt: Stacking & Unstacking STACKING main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r4, #1 BL sine BX lr R4 2 (SP) 4(LR) 5(PC) x080000F4 0x080000F0 PC SP LR xxxxxxxx 0x x x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 2 0x200001E8 1 0x200001E4 0 0x200001E0 0x200001DC 0x200001D8 BL sine Updates LR register 0x200001E0 Memory 0x200001D4 0x200001D0 0x200001CF Lecture # 7

38 Interrupt: Stacking & Unstacking UNSTACKING won t occur! main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler ADD r4, #1 BL sine BX lr R4 2 (SP) 4(LR) 5(PC) x080000F4 0x080000F0 PC SP LR xxxxxxxx 0x x x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 2 0x200001E8 1 0x200001E4 0 0x200001E0 0x200001DC 0x200001D8 BL sine Updates LR register 0x200001E0 Memory 0x200001D4 0x200001D0 0x200001CF Lecture # 8

39 Interrupt: Stacking & Unstacking main PROC addr = 0x MOV r,#0 addr = 0x C SysTick_Handler PROC EXPORT SysTick_Handler PUSH {lr} ADD r4, #1 BL sine POP {lr} BX lr R4 2 (SP) 4(LR) 5(PC) x080000F4 0x080000F0 0x200001E0 Fix the bug! PSP Save LR of course 0x PC SP LR xxxxxxxx 0x x x200001FC 0x200001F8 0x200001F4 0x200001F0 0x200001EC 2 0x200001E8 1 0x200001E4 0 0x200001E0 0x200001DC 0x200001D8 0x200001D4 0x200001D0 0x200001CF Memory Lecture # 9

40 Lab Practical #1 Some important things to note before you come for the practical. 1.The practical is closed book, open notes and access to the class website. 2.Make sure that you have access to all your code for all the labs you have done so far. The working code with its proper understanding will help you perform the practical properly..you will be given a simple problem to solve and you need to write a working program for that problem. The practical is worth 50 points (equivalent to all of the points you can receive for half of the lab experiments). 4.Make sure to go through the basics of writing the flow chart in Appendix E posted on the web site (follow the link Lab Assignments ). The flow chart for the program will be worth 10 points. The flow chart should be written in ENGLISH. If it contains any instructions specific to any software language, you will lose 2 points. If it does not contain proper shapes for the blocks, you will lose another 2 points. 5.The practical will have one easy section (worth 0 points) and one not so easy section (worth 40 points). If you choose to work with the easy section, you can score a maximum of 40 points. If you choose to work with the not so easy section, you can score the maximum of 50 points. Lecture # 40

41 Lab Practical #1-continued 6. You will work on the given problem for the first 90 minutes and the TA will check off your flow chart and working program after that. If you do not get your program checked off before the end of your session, you will not receive any credit for your work. 7. If the program is not working properly, you will receive partial credit on the basis of the working status of your program. 8. TA will not help you with the code; you need to work by yourself on the code and show the final results to the TA. 9. If you understand all the code for Labs 1 4 and if you have all the code with you, you should be able to perform the practical in no more than 50 minutes. 10. Do NOT discuss your practical with any other student until all practicals have been given (Friday noon). Not adhering to this could result in your failing the course. Lecture # 41

42 Lab Practical #1-Example Problem: Write a program that Uses the stored text above in memory. The end of text is marked by 0x04. (HINT: Which type of memory can be initialized?) Displays the original message on the screen. Copies the string to a new spot in memory starting at 0x20000B00 and changes every occurrence of certain letters in the message Waits for 5 seconds generated using a DELAY subroutine, Displays the new message store in memory Displays the (hexadecimal) number of occurrences a character change was made. Procedure: 1. Write a flow chart for the above problem (10 points). 2. Solve the Problem above (write a program) using one of the following methods:... Lecture # 42

43 Review Topics for Tuesday s Lecture What material would you like to review before mid-term exam? Lecture # 4

Design and Implementation Interrupt Mechanism

Design 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 information

The ARM Cortex-M0 Processor Architecture Part-1

The ARM Cortex-M0 Processor Architecture Part-1 The ARM Cortex-M0 Processor Architecture Part-1 1 Module Syllabus ARM Architectures and Processors What is ARM Architecture ARM Processors Families ARM Cortex-M Series Family Cortex-M0 Processor ARM Processor

More information

Interrupts. Why Interrupts

Interrupts. Why Interrupts Why Interrupts I/O operations Peripherals and external devices can let the processor know they are ready vs. the processor polling each device Routine tasks Updating the time Making sure the processor

More information

Lab 4 Interrupt-driven operations

Lab 4 Interrupt-driven operations Lab 4 Interrupt-driven operations Interrupt handling in Cortex-M CPUs Nested Vectored Interrupt Controller (NVIC) Externally-triggered interrupts via GPIO pins Software setup for interrupt-driven applications

More information

ARM Interrupts. EE383: Introduction to Embedded Systems University of Kentucky. James E. Lumpp

ARM Interrupts. EE383: Introduction to Embedded Systems University of Kentucky. James E. Lumpp ARM Interrupts EE383: Introduction to Embedded Systems University of Kentucky James E. Lumpp Includes material from: - Jonathan Valvano, Introduction to ARM Cortex-M Microcontrollers, Volume 1 Ebook, EE

More information

ECE251: Tuesday September 18

ECE251: Tuesday September 18 ECE251: Tuesday September 18 Subroutine Parameter Passing (Important) Allocating Memory in Subroutines (Important) Recursive Subroutines (Good to know) Debugging Hints Programming Hints Preview of I/O

More information

COEN-4720 Embedded Systems Design Lecture 4 Interrupts (Part 1) Cristinel Ababei Dept. of Electrical and Computer Engineering Marquette University

COEN-4720 Embedded Systems Design Lecture 4 Interrupts (Part 1) Cristinel Ababei Dept. of Electrical and Computer Engineering Marquette University COEN-4720 Embedded Systems Design Lecture 4 Interrupts (Part 1) Cristinel Ababei Dept. of Electrical and Computer Engineering Marquette University Outline Introduction NVIC and Interrupt Control Interrupt

More information

ECE251: Thursday September 13

ECE251: Thursday September 13 ECE251: Thursday September 13 Lab 9: Some Details Stack and Subroutines, continued--chapter 8 Stack Example SUBROUTINES More Details Initializing the Stack/Pointer Passing Parameters to Subroutines via

More information

ECE251: Tuesday September 11

ECE251: Tuesday September 11 ECE251: Tuesday September 11 Finish Branch related instructions Stack Subroutines Note: Lab 3 is a 2 week lab, starting this week and covers the Stack and Subroutines. Labs: Lab #2 is due this week. Lab

More information

ECE251: Tuesday September 12

ECE251: Tuesday September 12 ECE251: Tuesday September 12 Finish Branch related instructions Stack Subroutines Note: Lab 3 is a 2 week lab, starting this week and covers the Stack and Subroutines. Labs: Lab #2 is due this week. Lab

More information

EE251: Tuesday October 23

EE251: Tuesday October 23 EE251: Tuesday October 23 Higher Frequency Clock via Phase Locked Loop TIMER MODULE: SysTick-Basis of next week s lab Section 12.4 and 18 in text describes our SysTick Section 2.5 of Valvano s Real Time

More information

Interrupt-Driven Input/Output

Interrupt-Driven Input/Output Interrupt-Driven Input/Output Textbook: Chapter 11 (Interrupts) ARM Cortex-M4 User Guide (Interrupts, exceptions, NVIC) Sections 2.1.4, 2.3 Exceptions and interrupts Section 4.2 Nested Vectored Interrupt

More information

introduction to interrupts

introduction to interrupts introduction to interrupts Geoffrey Brown Chris Haynes Bryce Himebaugh C335 Fall 2013 Overview Why interrupts? Basic interrupt processing Sources of interrupts Handling interrupts Issues with interrupt

More information

Interrupts (Exceptions) (From LM3S1968) Gary J. Minden August 29, 2016

Interrupts (Exceptions) (From LM3S1968) Gary J. Minden August 29, 2016 Interrupts (Exceptions) (From LM3S1968) Gary J. Minden August 29, 2016 1 Interrupts Motivation Implementation Material from Stellaris LM3S1968 Micro-controller Datasheet Sections 2.5 and 2.6 2 Motivation

More information

Interrupts and Low Power Features

Interrupts and Low Power Features ARM University Program 1 Copyright ARM Ltd 2013 Interrupts and Low Power Features Module Syllabus Interrupts What are interrupts? Why use interrupts? Interrupts Entering an Exception Handler Exiting an

More information

Program SoC using C Language

Program SoC using C Language Program SoC using C Language 1 Module Overview General understanding of C, program compilation, program image, data storage, data type, and how to access peripherals using C language; Program SoC using

More information

Interrupts (Exceptions) Gary J. Minden September 11, 2014

Interrupts (Exceptions) Gary J. Minden September 11, 2014 Interrupts (Exceptions) Gary J. Minden September 11, 2014 1 Interrupts Motivation Implementation Material from Stellaris LM3S1968 Micro-controller Datasheet Sections 2.5 and 2.6 2 Motivation Our current

More information

EE4144: ARM Cortex-M Processor

EE4144: ARM Cortex-M Processor EE4144: ARM Cortex-M Processor EE4144 Fall 2014 EE4144 EE4144: ARM Cortex-M Processor Fall 2014 1 / 10 ARM Cortex-M 32-bit RISC processor Cortex-M4F Cortex-M3 + DSP instructions + floating point unit (FPU)

More information

Multitasking on Cortex-M(0) class MCU A deepdive into the Chromium-EC scheduler

Multitasking on Cortex-M(0) class MCU A deepdive into the Chromium-EC scheduler Multitasking on Cortex-M(0) class MCU A deepdive into the Chromium-EC scheduler $whoami Embedded Software Engineer at National Instruments We just finished our first product using Chromium-EC and future

More information

Exceptions and Interrupts ARM Cortex M3

Exceptions and Interrupts ARM Cortex M3 Exceptions and Interrupts ARM Cortex M3 ผศ.ดร. ส ร นทร ก ตต ธรก ล และ อ.สรย ทธ กลมกล อม 1 Introduction! Exception are events! They occur during the execution of the program! ARM exceptions! Exceptions

More information

ECE251: Intro to Microprocessors Name: Solutions Mid Term Exam October 4, 2018

ECE251: Intro to Microprocessors Name: Solutions Mid Term Exam October 4, 2018 ECE251: Intro to Microprocessors Name: Solutions Mid Term Exam October 4, 2018 (PRINT) Instructions: No calculators, books, or cell phones; do not communicate with any other student. One side of a single

More information

Embedded Systems. October 2, 2017

Embedded Systems. October 2, 2017 15-348 Embedded Systems October 2, 2017 Announcements Read pages 267 275 The Plan! Timers and Counter Interrupts A little review of timers How do we keep track of seconds using a timer? We have several

More information

ELC4438: Embedded System Design ARM Cortex-M Architecture II

ELC4438: Embedded System Design ARM Cortex-M Architecture II ELC4438: Embedded System Design ARM Cortex-M Architecture II Liang Dong Electrical and Computer Engineering Baylor University Memory system The memory systems in microcontrollers often contain two or more

More information

EE251: Tuesday September 5

EE251: Tuesday September 5 EE251: Tuesday September 5 Shift/Rotate Instructions Bitwise logic and Saturating Instructions A Few Math Programming Examples ARM Assembly Language and Assembler Assembly Process Assembly Structure Assembler

More information

Cortex-M4 Processor Overview. with ARM Processors and Architectures

Cortex-M4 Processor Overview. with ARM Processors and Architectures Cortex-M4 Processor Overview with ARM Processors and Architectures 1 Introduction 2 ARM ARM was developed at Acorn Computer Limited of Cambridge, UK (between 1983 & 1985) RISC concept introduced in 1980

More information

Computer Organization Laboratory. Class Notes. Instructor: Ken Q. Yang Dept. of ECE, URI

Computer Organization Laboratory. Class Notes. Instructor: Ken Q. Yang Dept. of ECE, URI Computer Organization Laboratory Class Notes Instructor: Ken Q. Yang Dept. of ECE, URI Section 0 Course Objectives, Plans, and Lab Tools Course Objectives: What to learn? Computer Architecture Concepts

More information

Application Note. Analyzing HardFaults on Cortex-M CPU

Application Note. Analyzing HardFaults on Cortex-M CPU Application Note Analyzing HardFaults on Cortex-M CPU Document: AN00016 Revision: 10 Date: January 23, 2017 A product of SEGGER Microcontroller GmbH & Co. KG www.segger.com 2 Disclaimer Specifications

More information

ECE254 Lab3 Tutorial. Introduction to Keil LPC1768 Hardware and Programmers Model. Irene Huang

ECE254 Lab3 Tutorial. Introduction to Keil LPC1768 Hardware and Programmers Model. Irene Huang ECE254 Lab3 Tutorial Introduction to Keil LPC1768 Hardware and Programmers Model Irene Huang Lab3 Part A Requirements (1) A function to obtain the task information OS_RESULT os_tsk_get(os_tid task_id,

More information

Embedded System Design

Embedded System Design ĐẠI HỌC QUỐC GIA TP.HỒ CHÍ MINH TRƯỜNG ĐẠI HỌC BÁCH KHOA KHOA ĐIỆN-ĐIỆN TỬ BỘ MÔN KỸ THUẬT ĐIỆN TỬ Embedded System Design Chapter 2: Microcontroller Series (Part 1) 1. Introduction to ARM processors 2.

More information

8086 Interrupts and Interrupt Responses:

8086 Interrupts and Interrupt Responses: UNIT-III PART -A INTERRUPTS AND PROGRAMMABLE INTERRUPT CONTROLLERS Contents at a glance: 8086 Interrupts and Interrupt Responses Introduction to DOS and BIOS interrupts 8259A Priority Interrupt Controller

More information

EE251: Tuesday December 4

EE251: Tuesday December 4 EE251: Tuesday December 4 Memory Subsystem continued Timing requirements Adding memory beyond 4 Gbyte Time Allowing: Begin Review for Final Exam Homework #9 due Thursday at beginning of class Friday is

More information

ARM Architecture and Assembly Programming Intro

ARM Architecture and Assembly Programming Intro ARM Architecture and Assembly Programming Intro Instructors: Dr. Phillip Jones http://class.ece.iastate.edu/cpre288 1 Announcements HW9: Due Sunday 11/5 (midnight) Lab 9: object detection lab Give TAs

More information

ARM architecture road map. NuMicro Overview of Cortex M. Cortex M Processor Family (2/3) All binary upwards compatible

ARM architecture road map. NuMicro Overview of Cortex M. Cortex M Processor Family (2/3) All binary upwards compatible ARM architecture road map NuMicro Overview of Cortex M NuMicro@nuvoton.com 1 2 Cortex M Processor Family (1/3) Cortex M0 Cortex M0+ Cortex M3 Cortex M4 Low cost, ultra low power deeply embedded applications

More information

ECE254 Lab3 Tutorial. Introduction to MCB1700 Hardware Programming. Irene Huang

ECE254 Lab3 Tutorial. Introduction to MCB1700 Hardware Programming. Irene Huang ECE254 Lab3 Tutorial Introduction to MCB1700 Hardware Programming Irene Huang Lab3 Requirements : API Dynamic Memory Management: void * os_mem_alloc (int size, unsigned char flag) Flag takes two values:

More information

EE251: Thursday November 30

EE251: Thursday November 30 EE251: Thursday November 30 Course Evaluation Forms-fill out Memory Subsystem continued Timing requirements Adding memory beyond 4 Gbyte Time Allowing: Begin Review for Final Exam Homework due next Tuesday,

More information

ARM Cortex core microcontrollers

ARM Cortex core microcontrollers ARM Cortex core microcontrollers 2 nd Cortex-M3 core Balázs Scherer Budapest University of Technology and Economics Department of Measurement and Information Systems BME-MIT 2016 The Cortex-M3 core BME-MIT

More information

LDR R0,=0x L: LDREX R1, [R0] ORR R1, #4 STR R1, [R0] (5) Part a) Why does the 9S12 code not have a critical section?

LDR R0,=0x L: LDREX R1, [R0] ORR R1, #4 STR R1, [R0] (5) Part a) Why does the 9S12 code not have a critical section? EE445M/EE380L Quiz 1 Spring 2017 Solution Page 1 of 5 First Name: Last Name: March 3, 2017, 10:00 to 10:50am Open book and open notes. No calculators or any electronic devices (turn cell phones off). Please

More information

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013 CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013 TOPICS TODAY I/O Architectures Interrupts Exceptions FETCH EXECUTE CYCLE 1.7 The von Neumann Model This is a general

More information

Real Time Operating Systems

Real Time Operating Systems Real Time Operating Systems Terminology uc/os-iii, The Real-Time Kernel, or a High Performance, Scalable, ROMable, Preemptive, Multitasking Kernel for Microprocessors, Microcontrollers & DSPs, Book & Board

More information

Grundlagen Microcontroller Interrupts. Günther Gridling Bettina Weiss

Grundlagen 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 information

Timers and Pulse Accumulator

Timers and Pulse Accumulator 7 7.1 Objectives: Tiva is equipped with six General Purpose Timer Modules named TIMERn. Additionally, each TIMERn consists of two 16 bit timers (A and B). Most GPIO pins can be assigned a TIMERn as an

More information

Stacks and Subroutines

Stacks and Subroutines Chapters 8 Stacks and Subroutines Embedded Systems with ARM Cortext-M Updated: Tuesday, March 6, 2018 Basic Idea llarge programs are hard to handle lwe can break them to smaller programs lthey are called

More information

ARM PROGRAMMING. When use assembly

ARM PROGRAMMING. When use assembly ARM PROGRAMMING Bùi Quốc Bảo When use assembly Functions that cannot be implemented in C, such as special register accesses and exclusive accesses Timing-critical routines Tight memory requirements, causing

More information

Migrating ARM7 Code to a Cortex-M3 MCU By Todd Hixon, Atmel

Migrating ARM7 Code to a Cortex-M3 MCU By Todd Hixon, Atmel Migrating ARM7 Code to a Cortex-M3 MCU By Todd Hixon, Atmel The ARM Cortex-M3 core has enhancements to its architecture that result in increased code execution speed, lower power consumption, and easier

More information

Lecture 10 Exceptions and Interrupts. How are exceptions generated?

Lecture 10 Exceptions and Interrupts. How are exceptions generated? Lecture 10 Exceptions and Interrupts The ARM processor can work in one of many operating modes. So far we have only considered user mode, which is the "normal" mode of operation. The processor can also

More information

EECS 373 Design of Microprocessor-Based Systems

EECS 373 Design of Microprocessor-Based Systems EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Lecture 6 & 7: Interrupts (please bring slides again on Wednesday) Sept. 24 th and 26 th Exceptions, Traps, Faults & ARM

More information

Interrupts and Exceptions

Interrupts and Exceptions Interrupts and Exceptions ECE 362 https://engineering.purdue.edu/ee362/ Rick Reading assignment: Reading Assignment STM32F0x1 Family Reference, Chapter 12, pages 217 228, "Interrupts and events" Your textbook,

More information

Course Introduction. Purpose: Objectives: Content: 27 pages 4 questions. Learning Time: 20 minutes

Course 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 information

ECE 598 Advanced Operating Systems Lecture 8

ECE 598 Advanced Operating Systems Lecture 8 ECE 598 Advanced Operating Systems Lecture 8 Vince Weaver http://www.eece.maine.edu/~vweaver vincent.weaver@maine.edu 11 February 2016 Homework #3 Due. Announcements Homework #4 Posted Soon 1 HW#3 Comments

More information

Developing a Generic Hard Fault handler for ARM Cortex-M3/Cortex-M4

Developing a Generic Hard Fault handler for ARM Cortex-M3/Cortex-M4 Developing a Generic Hard Fault handler for ARM Cortex-M3/Cortex-M4 Niall Cooling Feabhas Limited www.feabhas.com Place company logo here. Recommend a white transparent GIF logo which cannot be larger

More information

Introduction. ! Exception*are*events*! They*occur*during*the*execution*of*the*program! Type*of*ARM*exceptions*! Exceptions*that*result*by*a*command

Introduction. ! Exception*are*events*! They*occur*during*the*execution*of*the*program! Type*of*ARM*exceptions*! Exceptions*that*result*by*a*command Exceptions and Interrupts ARM Cortex M3 ผศ.ดร. ส ร นทร ก ตต ธรก ล และ อ.สรย ทธ กลมกล อม ภาคว ชาว ศวกรรมคอมพ วเตอร คณะว ศวกรรมศาสตร สถาบ นเทคโนโลย พระจอมเกล าเจ าค ณทหารลาดกระบ ง Introduction! Exception*are*events*!

More information

Subroutines and the Stack

Subroutines and the Stack 3 31 Objectives: A subroutine is a reusable program module A main program can call or jump to the subroutine one or more times The stack is used in several ways when subroutines are called In this lab

More information

The Definitive Guide to the ARM Cortex-M3

The Definitive Guide to the ARM Cortex-M3 The Definitive Guide to the ARM Cortex-M3 Joseph Yiu AMSTERDAM BOSTON HEIDELBERG LONDON NEW YORK OXFORD PARIS SAN DIEGO SAN FRANCISCO SINGAPORE SYDNEY TOKYO Newnes is an imprint of Elsevier Newnes Forewopd

More information

Lecture notes Lectures 1 through 5 (up through lecture 5 slide 63) Book Chapters 1-4

Lecture notes Lectures 1 through 5 (up through lecture 5 slide 63) Book Chapters 1-4 EE445M Midterm Study Guide (Spring 2017) (updated February 25, 2017): Instructions: Open book and open notes. No calculators or any electronic devices (turn cell phones off). Please be sure that your answers

More information

Implementing Secure Software Systems on ARMv8-M Microcontrollers

Implementing Secure Software Systems on ARMv8-M Microcontrollers Implementing Secure Software Systems on ARMv8-M Microcontrollers Chris Shore, ARM TrustZone: A comprehensive security foundation Non-trusted Trusted Security separation with TrustZone Isolate trusted resources

More information

M2351 TrustZone Program Development

M2351 TrustZone Program Development Application Note for 32-bit NuMicro Family AN0019 M2351 TrustZone Program Development Document Information Abstract Introduce TrustZone programing including how to partition security attribution and how

More information

ARM Cortex-M4 Architecture and Instruction Set 1: Architecture Overview

ARM Cortex-M4 Architecture and Instruction Set 1: Architecture Overview ARM Cortex-M4 Architecture and Instruction Set 1: Architecture Overview M J Brockway January 25, 2016 UM10562 All information provided in this document is subject to legal disclaimers. NXP B.V. 2014. All

More information

Input/Output Programming

Input/Output Programming Input/Output Programming Chapter 3: Section 3.1, 3.2 Input and output (I/O) programming Communicating with I/O devices Busy-wait I/O Interrupt-driven I/O I/O devices Devices may include digital and non-digital

More information

538 Lecture Notes Week 5

538 Lecture Notes Week 5 538 Lecture Notes Week 5 (October 4, 2017) 1/18 538 Lecture Notes Week 5 Announements Midterm: Tuesday, October 25 Answers to last week's questions 1. With the diagram shown for a port (single bit), what

More information

OUTLINE. STM32F0 Architecture Overview STM32F0 Core Motivation for RISC and Pipelining Cortex-M0 Programming Model Toolchain and Project Structure

OUTLINE. STM32F0 Architecture Overview STM32F0 Core Motivation for RISC and Pipelining Cortex-M0 Programming Model Toolchain and Project Structure ARCHITECTURE AND PROGRAMMING George E Hadley, Timothy Rogers, and David G Meyer 2018, Images Property of their Respective Owners OUTLINE STM32F0 Architecture Overview STM32F0 Core Motivation for RISC and

More information

ARM Cortex-M and RTOSs Are Meant for Each Other

ARM Cortex-M and RTOSs Are Meant for Each Other ARM Cortex-M and RTOSs Are Meant for Each Other FEBRUARY 2018 JEAN J. LABROSSE Introduction Author µc/os series of software and books Numerous articles and blogs Lecturer Conferences Training Entrepreneur

More information

ECE 485/585 Microprocessor System Design

ECE 485/585 Microprocessor System Design Microprocessor System Design Lecture 3: Polling and Interrupts Programmed I/O and DMA Interrupts Zeshan Chishti Electrical and Computer Engineering Dept Maseeh College of Engineering and Computer Science

More information

Cortex-M3 Reference Manual

Cortex-M3 Reference Manual Cortex-M3 Reference Manual EFM32 Microcontroller Family 32-bit ARM Cortex-M3 processor running up to 32 MHz Up to 128 KB Flash and 16 KB RAM memory Energy efficient and fast autonomous peripherals Ultra

More information

NET3001. Advanced Assembly

NET3001. Advanced Assembly NET3001 Advanced Assembly Arrays and Indexing supposed we have an array of 16 bytes at 0x0800.0100 write a program that determines if the array contains the byte '0x12' set r0=1 if the byte is found plan:

More information

ECE 3210 Lab 4: Calculator

ECE 3210 Lab 4: Calculator ECE 3210 Lab 4: Calculator Fall 2017 1 Objective In this lab, you will develop an complete assembly program that takes an user input, performs data operations, and produces the expected output. After finishing

More information

EE251: Thursday September 20

EE251: Thursday September 20 EE251: Thursday September 20 Parallel I/O aka General Purpose I/O aka GPIO Common Devices: Switches, LEDs, Keypads Read Lab 4 carefully, and Chapter 14 in text Think about what you would like to review

More information

EEL 4744C: Microprocessor Applications. Lecture 7. Part 1. Interrupt. Dr. Tao Li 1

EEL 4744C: Microprocessor Applications. Lecture 7. Part 1. Interrupt. Dr. Tao Li 1 EEL 4744C: Microprocessor Applications Lecture 7 Part 1 Interrupt Dr. Tao Li 1 M&M: Chapter 8 Or Reading Assignment Software and Hardware Engineering (new version): Chapter 12 Dr. Tao Li 2 Interrupt An

More information

Reading Assignment. Interrupt. Interrupt. Interrupt. EEL 4744C: Microprocessor Applications. Lecture 7. Part 1

Reading Assignment. Interrupt. Interrupt. Interrupt. EEL 4744C: Microprocessor Applications. Lecture 7. Part 1 Reading Assignment EEL 4744C: Microprocessor Applications Lecture 7 M&M: Chapter 8 Or Software and Hardware Engineering (new version): Chapter 12 Part 1 Interrupt Dr. Tao Li 1 Dr. Tao Li 2 Interrupt An

More information

CprE 288 Translating C Control Statements and Function Calls, Loops, Interrupt Processing. Instructors: Dr. Phillip Jones Dr.

CprE 288 Translating C Control Statements and Function Calls, Loops, Interrupt Processing. Instructors: Dr. Phillip Jones Dr. CprE 288 Translating C Control Statements and Function Calls, Loops, Interrupt Processing Instructors: Dr. Phillip Jones Dr. Zhao Zhang 1 Announcements Final Projects Projects: Mandatory Demos Deadweek

More information

Advanced Assembly, Branching, and Monitor Utilities

Advanced Assembly, Branching, and Monitor Utilities 2 Advanced Assembly, Branching, and Monitor Utilities 2.1 Objectives: There are several different ways for an instruction to form effective addresses to acquire data, called addressing modes. One of these

More information

University of Texas at Austin Electrical and Computer Engineering Department. EE319K, Embedded Systems, Spring 2013 Final Exam

University of Texas at Austin Electrical and Computer Engineering Department. EE319K, Embedded Systems, Spring 2013 Final Exam University of Texas at Austin Electrical and Computer Engineering Department EE319K, Embedded Systems, Spring 2013 Final Exam Directions There are 6 problems worth a total of 100 points. The number of

More information

ECE 362 Experiment 4: Interrupts

ECE 362 Experiment 4: Interrupts ECE 362 Experiment 4: Interrupts 1.0 Introduction Microprocessors consistently follow a straight sequence of instructions, and you have likely only worked with this kind of programming until now. In this

More information

Troubleshooting Guide

Troubleshooting Guide APPENDIX I Troubleshooting Guide I.1 Overview There can be various different symptoms when an application does not work. For example: The program does not run at all, or the processor failed to start.

More information

ARM Cortex-M4 Programming Model

ARM Cortex-M4 Programming Model ARM Cortex-M4 Programming Model ARM = Advanced RISC Machines, Ltd. ARM licenses IP to other companies (ARM does not fabricate chips) 2005: ARM had 75% of embedded RISC market, with 2.5 billion processors

More information

PC Interrupt Structure and 8259 DMA Controllers

PC Interrupt Structure and 8259 DMA Controllers ELEC 379 : DESIGN OF DIGITAL AND MICROCOMPUTER SYSTEMS 1998/99 WINTER SESSION, TERM 2 PC Interrupt Structure and 8259 DMA Controllers This lecture covers the use of interrupts and the vectored interrupt

More information

Final Exam. Date: May 12, 2017

Final Exam. Date: May 12, 2017 Final Exam Date: May 12, 2017 UT EID: Printed Name: Last, First Your signature is your promise that you have not cheated and will not cheat on this exam, nor will you help others to cheat on this exam:

More information

(5) Question 2. Give the two most important factors for effective debugging. Jonathan W. Valvano

(5) Question 2. Give the two most important factors for effective debugging. Jonathan W. Valvano EE445M/EE380L Quiz 1 Spring 2013 Page 1 of 5 First Name: Last Name: March 1, 2013, 10:00 to 10:50am Quiz 1 is a closed book exam. You may have one 8.5 by 11 inch sheet of hand-written crib notes, but no

More information

ECE 341. Lecture # 19

ECE 341. Lecture # 19 ECE 341 Lecture # 19 Instructor: Zeshan Chishti zeshan@ece.pdx.edu December 3, 2014 Portland State University Announcements Final exam is on Monday, December 8 from 5:30 PM to 7:20 PM Similar format and

More information

ECE 598 Advanced Operating Systems Lecture 8

ECE 598 Advanced Operating Systems Lecture 8 ECE 598 Advanced Operating Systems Lecture 8 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 15 February 2018 Homework #3 Due. Announcements Homework #4 Posted Soon 1 (Review)

More information

Job Posting (Aug. 19) ECE 425. ARM7 Block Diagram. ARM Programming. Assembly Language Programming. ARM Architecture 9/7/2017. Microprocessor Systems

Job Posting (Aug. 19) ECE 425. ARM7 Block Diagram. ARM Programming. Assembly Language Programming. ARM Architecture 9/7/2017. Microprocessor Systems Job Posting (Aug. 19) ECE 425 Microprocessor Systems TECHNICAL SKILLS: Use software development tools for microcontrollers. Must have experience with verification test languages such as Vera, Specman,

More information

538 Lecture Notes Week 5

538 Lecture Notes Week 5 538 Lecture Notes Week 5 (Sept. 30, 2013) 1/15 538 Lecture Notes Week 5 Answers to last week's questions 1. With the diagram shown for a port (single bit), what happens if the Direction Register is read?

More information

ECE251: Thursday November 8

ECE251: Thursday November 8 ECE251: Thursday November 8 Universal Asynchronous Receiver & Transmitter Text Chapter 22, Sections 22.1.1-22.1.4-read carefully TM4C Data Sheet Section 14-no need to read this A key topic but not a lab

More information

AND SOLUTION FIRST INTERNAL TEST

AND SOLUTION FIRST INTERNAL TEST Faculty: Dr. Bajarangbali P.E.S. Institute of Technology( Bangalore South Campus) Hosur Road, ( 1Km Before Electronic City), Bangalore 560100. Department of Electronics and Communication SCHEME AND SOLUTION

More information

Reset, Interrupts, Exceptions, and Break ECE 3534

Reset, Interrupts, Exceptions, and Break ECE 3534 Reset, Interrupts, Exceptions, and Break ECE 3534 1 Reset, Interrupts, Exceptions, Break These topics are closely related Both software and hardware aspects of a processor are involved On the MicroBlaze,

More information

CHAPTER 11 INTERRUPTS PROGRAMMING

CHAPTER 11 INTERRUPTS PROGRAMMING CHAPTER 11 INTERRUPTS PROGRAMMING Interrupts vs. Polling An interrupt is an external or internal event that interrupts the microcontroller To inform it that a device needs its service A single microcontroller

More information

EE251: Thursday November 15

EE251: Thursday November 15 EE251: Thursday November 15 Major new topic: MEMORY A KEY topic HW #7 due today; HW #8 due Thursday, Nov. 29 Lab #8 finishes this week; due week of Nov. 26 All labs MUST be completed/handed-in by Dec.

More information

EE319K Fall 2013 Exam 1B Modified Page 1. Exam 1. Date: October 3, 2013

EE319K Fall 2013 Exam 1B Modified Page 1. Exam 1. Date: October 3, 2013 EE319K Fall 2013 Exam 1B Modified Page 1 Exam 1 Date: October 3, 2013 UT EID: Printed Name: Last, First Your signature is your promise that you have not cheated and will not cheat on this exam, nor will

More information

Introduction to C. Write a main() function that swaps the contents of two integer variables x and y.

Introduction to C. Write a main() function that swaps the contents of two integer variables x and y. Introduction to C Write a main() function that swaps the contents of two integer variables x and y. void main(void){ int a = 10; int b = 20; a = b; b = a; } 1 Introduction to C Write a main() function

More information

Cortex-M4 Exceptions and Interrupts

Cortex-M4 Exceptions and Interrupts Cortex-M4 Exceptions and Interrupts 1 Overview Exception and Interrupt Concepts Entering an Exception Handler Exiting an Exception Handler Cortex-M4 Interrupts Using Port Module and External Interrupts

More information

ARM Embedded Systems: ARM Design philosophy, Embedded System Hardware, Embedded System Software

ARM 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 information

Input/Output. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University

Input/Output. Jin-Soo Kim Computer Systems Laboratory Sungkyunkwan University Input/Output Jin-Soo Kim (jinsookim@skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu mechanism I/O Devices Usually includes some non-digital component Typical digital interface

More information

Computer Organization & Assembly Language Programming (CSE 2312)

Computer Organization & Assembly Language Programming (CSE 2312) Computer Organization & Assembly Language Programming (CSE 2312) Lecture 16: Processor Pipeline Introduction and Debugging with GDB Taylor Johnson Announcements and Outline Homework 5 due today Know how

More information

Chapters 2, 3: bits and pieces. Chapters 2 & 3. Chapters 2, 3: bits and pieces. Chapters 2, 3: bits and pieces. Using C. A last word about hardware

Chapters 2, 3: bits and pieces. Chapters 2 & 3. Chapters 2, 3: bits and pieces. Chapters 2, 3: bits and pieces. Using C. A last word about hardware Chapters 2 & 3 Chapters 2, 3: bits and pieces A review of hardware essentials Most of you have seen this material in other classes Still worth a careful read: may give you new insight We ll touch briefly

More information

These three counters can be programmed for either binary or BCD count.

These three counters can be programmed for either binary or BCD count. S5 KTU 1 PROGRAMMABLE TIMER 8254/8253 The Intel 8253 and 8254 are Programmable Interval Timers (PTIs) designed for microprocessors to perform timing and counting functions using three 16-bit registers.

More information

CSE 410. Operating Systems

CSE 410. Operating Systems CSE 410 Operating Systems Handout: syllabus 1 Today s Lecture Course organization Computing environment Overview of course topics 2 Course Organization Course website http://www.cse.msu.edu/~cse410/ Syllabus

More information

Lab5 2-Nov-18, due 16-Nov-18 (2 weeks duration) Lab6 16-Nov-19, due 30-Nov-18 (2 weeks duration)

Lab5 2-Nov-18, due 16-Nov-18 (2 weeks duration) Lab6 16-Nov-19, due 30-Nov-18 (2 weeks duration) CS1021 AFTER READING WEEK Mid-Semester Test NOW Thurs 8th Nov @ 9am in Goldsmith Hall (ALL students to attend at 9am) Final 2 Labs Lab5 2-Nov-18, due 16-Nov-18 (2 weeks duration) Lab6 16-Nov-19, due 30-Nov-18

More information

Interrupt/Timer/DMA 1

Interrupt/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 information

Computer Labs: I/O and Interrupts

Computer Labs: I/O and Interrupts Computer Labs: I/O and Interrupts 2 o MIEIC Pedro F. Souto (pfs@fe.up.pt) October 3, 2010 I/O Operation I/O devices are the interface between the computer and its environment Most of the time, the processor

More information

ARM Cortex-M4 Architecture and Instruction Set 3: Branching; Data definition and memory access instructions

ARM Cortex-M4 Architecture and Instruction Set 3: Branching; Data definition and memory access instructions ARM Cortex-M4 Architecture and Instruction Set 3: Branching; Data definition and memory access instructions M J Brockway February 17, 2016 Branching To do anything other than run a fixed sequence of instructions,

More information

McGill University Department of Electrical and Computer Engineering. Course ECSE-322A -- Computer Engineering. MidTerm Test Version 1 Solutions

McGill University Department of Electrical and Computer Engineering. Course ECSE-322A -- Computer Engineering. MidTerm Test Version 1 Solutions Signature: I.D. Number: Printed Name: McGill University Department of Electrical and Computer Engineering Course ECSE-322A -- Computer Engineering PLEASE NOTE CAREFULLY: MidTerm Test Version 1 Solutions

More information