Tutorial3 - Tutorial #3 Bojan Mihajlovic McGill University...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Tutorial #3 Bojan Mihajlovic McGill University Microprocessor Systems ECSE-426
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Overview Interrupts Timer Operation Low Power Modes
Background image of page 2
Interrupts Two classes Non-Maskable Reset – Watchdog or External Oscillator Fault FLASH Access Violation Maskable Peripherals (i.e. Timer, Analog Converter, USART) Break Execution Flow Save Context: Program Counter & Status Register Highest priority interrupt selected SR is saved, then cleared (stops all low-power modes) Fetch Interrupt Vector -> Put in PC
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
From the 'C' Point of View Interrupt Service Routine Like a function Extra information Interrupt vector name Tell the compiler to use RETI instead of RET Code Example*: // Timer A0 interrupt service routine void Timer_A (void) __interrupt[TIMERA0_VECTOR] { P1OUT ^= 0x01; // Toggle P1.0 CCR0 += 50000; // Add Offset to CCR0 } *Taken from fet140_ta01.c in the Rowley Examples Folder
Background image of page 4
Interrupt Service Routine Disassembly from Rowley (Open the .HZX file) // Timer A0 interrupt service routine void Timer_A (void) __interrupt[TIMERA0_VECTOR] { P1OUT ^= 0x01; // Toggle P1.0 CCR0 += 50000; // Add Offset to CCR0 } =================================================== void Timer_A (void) __interrupt[TIMERA0_VECTOR] 115c .ALIGN BYTE[2] 115c _Timer_A 115c @8 P1OUT ^= 0x01; // Toggle P1.0 115c d2e32100 XOR.B CCR0 += 50000; // Add Offset to CCR0
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/14/2010 for the course ELEC ENG ECSE 221 taught by Professor Ferrie during the Spring '08 term at McGill.

Page1 / 15

Tutorial3 - Tutorial #3 Bojan Mihajlovic McGill University...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online