Professional Documents
Culture Documents
Int Test 1
Int Test 1
3170: Microprocessors I
## UMass Lowell
## Instructor: M. Geiger
## intTest1.S: in-class example to demonstrate PIC interrupt basics
## Basically same as timerTest.S but using timer interrupts
main:
// Configure Timer 1
sw zero, T1CON ## Clear T1CON--disables timer to allow
setup
## Prescale clock
li t3, _T1CON_TCKPS1_MASK ## Prescale by factor of 64 (TCKPS = 10)
sw t3, T1CONSET
// Configure interrupts
lui t3, 0x0001 ## Want INTCON bit 16 (VS<0>) = 1
## so vectors 8 bytes apart
ori t3, t3, _INTCON_MVEC_MASK ## Enable multivectored interrupt mode
sw t3, INTCON