hello I am using a program called MPLAB-SIM and I am trying to test my interrupts on a 16F class pic

my interrupts registers are setup like this

movlw   b'11001000' ;sets up INTCON, with PEIE and PORTA interrupts allowed
movwf   intcon      ;uses w to set intcon interrupt control
movlw   b'00011110' ;sets up PIE1, with comparator 1/2, oscillator fail, TMR2IE
movwf   pie1        ;uses w to set PIE1 interrupt control
movlw   b'00000000' ;sets up PIE1
movwf   pir1        ;uses w to set PIE1 interrupt control

however i cant even get to my interrupt service routine. Dont I just need to clear the GIE bit of INTCON<7> to get there?

PS how to you set the CODE flag here so that it recognises assembly?

Edited by diafol: fixed formatting

9 Years
Discussion Span
Last Post by Duoas

MPLAB SIM is another proprietary, created for a textbook, simulated processor/language. I don't have access to it. Your best bet is to go get help from your professor.

I don't think the code tags here understand assembly. I've tried a lot of different variations and none work...

Good luck.


in mplab-sim i know how to alter intcon, so taht i may change the GIE bit

However when an interrupt happens is this how the assembler knows?


I think you are going to have to ask your professor.

Like I said, I don't have access to anything that has to do with MPLAB SIM, so I couldn't tell you... and I don't think anyone else here can either...


[EDIT] Oh yeah, I discovered that if you type [[I][/I]code=asm[I][/I]] that you can highlight for Intel assembly.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.