Pages created and updated by Terry Sturtevant Date Posted: February 5, 2018

CP316: Microprocessor Systems and Interfacing

Interrupts Prelab

Setup a base program that:

Note: this program has no interrupts and should be a simple reconfiguration of work done in previous labs.


  1. If working in the simulator, an interrupt can be "fired off" using Window | Simulator | Stimulus.

  2. The timer routine presented in class has been modified to protect the critical region from interrupts.
    • Examine how this code (shown below) works.
    • What is the advantage to using this instead of simply clearing/setting GIEL or GIEH?
    • Would time_adj have to be modified to use this code? If yes, what is the adjustment; if no, why not?
    		btfss   INTCON,TMR0IF
    		bra 	ten_ms
    		movff	INTCON,INTCON_copy
    		bcf 	INTCON,GIEH
    		movff	TMR0L,tmr_l
    		movff	TMR0H,tmr_h
    		movlw	low time_adj
    		addwf	tmr_l,F
    		movlw	high time_adj
    		addwfc	tmr_h,F
    		movff	tmr_h,TMR0H
    		movff	tmr_l,TMR0L
    		bcf 	INTCON,TRM0IF
    		movf	INTCON_copy,W
    		andlw	b'10000000'
    		iorwf	INTCON,F
Creative Commons License

Information on this site which is produced by Terry Sturtevant is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 2.5 Canada License.


To view pdf documents, you can download Adobe Acrobat Reader .
get Acrobat Reader
If you need to update a browser, you might try Firefox which is Get Firefox!
Since this page uses cascading style sheets for its layout, it will look best with a browser which supports the specifications as fully as possible.

If you are looking for an office package, with a word processor, spreadsheet, etc., you might try LibreOffice which is Get LibreOffice!

Go to the main page for the Department of Physics and Computer Science.

Valid XHTML 1.1

Valid CSS!

Wilfrid Laurier University