gnupic: Thread: simulating an interrupt


[<<] [<] Page 1 of 1 [>] [>>]
Subject: simulating an interrupt
From: "Maxim Wexler" ####@####.####
Date: 9 Dec 2006 23:34:36 +0000
Message-Id: <a0811460612091534t38c28c22v5df25f30b1b5968@mail.gmail.com>

Hi group,

This file runs nicely in gpsim. But I can't seem to get the interrupt to
work. I looked at help stimulus and help attach but they don't seem to cover
a manual one time toggle. Furthermore, once it's running the command line
can't be accessed. I made a node in the gui called inter1 and connected a
stimulus from it to portb4; in the 'Breadboard' window it says 'Stimulus
portb4 connected to node inter1' but that didn't help. It just loops from
'payrol' to 'goto payrol'.

;inter1.asm is a simple interrupt handler-
; it does not save the state of the machine
; nor does it determine the kind of interrupt.
;
;*********************************************simulator
;watch window: intcon, pcl
;stack: have this open too- see the return address come & go
;asynch stimulus: have a toggle on rb4
;********************************************* setup
processor 16c84
    movlw h'0'
    movwf h'0b' ;clear intcon
    goto main ;hop over the isr
;********************************************** isr start
isr: org h'0004' ;interrupts always vector to here
    nop ;here we actually do the stuff
    nop ; of the interrupt
    bcf h'0b',0 ;clear int before going back
    retfie ;this re-sets intcon gie
;*********************************************** isr ends
;
;*********************************************** main start
main: org h'0020' ; leave enough room for the isr!
    bsf h'0b',7 ; set global int enable
    bsf h'0b',3 ; set change on b int enable
payrol: nop ; loop here until interrupted,
    nop ; doing payroll stuff
    goto payrol ;
    nop
    nop
end

  I'm not even sure what to expect. Like I say, once it's running, how do
you "interrupt" it without stopping it? Hope that makes sense.

Maxim
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.