lab4_interlab

lab4_interlab - Microprocessor Lab Interrupts Use...

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

View Full Document Right Arrow Icon
Microprocessor Lab --- Interrupts Use Interrupts to Perform Simultaneous Tasks 1. Equipment M68HC12EVB Oscilloscope Personal Computer 2. Introduction Interrupts are a very useful tool which allows the processor to perform multiple tasks simultaneously. An interrupt is typically generated by hardware such as a UART, timer, or GPIO pin. When an interrupt is triggered, the main program is halted and the processor examines the Interrupt Vector Table to find the memory location of the Interrupt Service Routine. Each interrupt has a specific location in the IVT. Once the location of the ISR is determined, the processor will jump to that location. An ISR is a lot like a regular subroutine, except that context switching is implemented by the processor when entering and leaving the ISR. Context switching consists of pushing all the registers onto the stack, and popping them once the ISR is complete. This provides you with a “virtual processor” to run the ISR without causing any changes to registers used by the main program. Remember that execution of the ISR can happen at any time, so take appropriate steps to ensure that unexpected behavior does not occur. Also be aware that you cannot use registers to communicate between the ISR and main program. 3. Procedure 1. Run the following program, which will toggle the pins in port T and echo characters to the serial terminal simultaneously. REGBS EQU $0000 ; DP256 register bank base address PTT: EQU REGBS+$240 ;portT data register DDRT: EQU REGBS+$242 ;portT direction register TIOS: EQU REGBS+$40 ;timer input/output select
Background image of page 1

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

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 3

lab4_interlab - Microprocessor Lab Interrupts Use...

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

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