Pages created and updated by Terry Sturtevant Date Posted: November 13, 2013

CP316: Microprocessor Systems and Interfacing

Interrupts Prelab

Setup and test a base program that:

Note: this program has no interrupts and should be a simple reconfiguration of work done in previous labs. Program must be working before you get to the lab.

Demonstration - demonstrate the base program

 

To be done in your lab notebook.

  1. If working in the simulator, an interrupt can be "fired off" using Window | Simulator | Stimulus. What would you have to do in the Stimulus screen to configure and issue an INT1 interrupt?

  2. The timer routine presented in class has been modified to protect the critical region from interrupts.
    • Explain 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?
    	ten_ms:
    		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
          
    		movf	INTCON_copy,W
    		andlw	b'10000000'
    		iorwf	INTCON,F
    		bcf 	INTCON,TRM0IF
          
    		return
          


    Demonstration - Explain your results for the above questions.

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.

Resources

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