Hi,
Looking at this interrupt stubb ... it seems translating it into pure ASM interrupt is fairly easy ... as all commands have their straight asm equivalent !!!
BTW ... I do not see DT Interrupts fitting into a '629 ...
Alain
Hi,
Looking at this interrupt stubb ... it seems translating it into pure ASM interrupt is fairly easy ... as all commands have their straight asm equivalent !!!
BTW ... I do not see DT Interrupts fitting into a '629 ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Am I missing something? I looked up microchip site for 16F629 ... nothing. Is it a 639 and a 635 you talk about?
As to whether DT instant interrupts fits in a 628 or equivalent, I'm not sure, but I've used assembly language interrupts on a 628. It's very easy once you know.
Hi, Jerson
You should have a strong coffee ...
lol ...
DEVICE 12F629
CONFIG INTRC_OSC_NOCLKOUT, WDT_OFF, PWRTE_ON, BODEN_OFF, CP_OFF, MCLRE_OFF
...
...
For DT interrupts ... the problem is the RAM size, not the Program size ...
So, a 12Fxxx with enough RAM ( 12F683 i.e. ) is Ok
It won't fit into a 16F84 nor ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Hi Alain - I really needed coffee. Too much stress I guess. I mistook it for a 16F device!!! haha
OTOH 64 bytes RAM should be good enough to do asm interrupts no?
This is what I did with the 16F628 interrupts.
I have not checked the datasheet for the banks used in the 12F629, but the wsave registers may need to change accordingly. Otherwise, the context save and restore takes just 4 bytes of RAM !!!!Code:' define the interrupt handler define INTHAND _IntHandler ' These variables are used to save the machine state on interrupt wsave var byte $20 SYSTEM ' location for W if in bank0 wsave1 var byte $A0 SYSTEM ' location for W if in bank1 wsave2 var byte $120 SYSTEM ' location for W if in bank2 ssave var byte BANK0 SYSTEM ' location for STATUS register psave var byte BANK0 SYSTEM ' location for PCLATH register fsave var byte BANK0 SYSTEM ' location for FSR register IntHandler: asm movwf wsave ; Save the W register swapf STATUS, W clrf STATUS ; Point to bank 0 movwf ssave ; Save the STATUS register movf PCLATH, W ; Save PCLATH movwf psave movlw ((INTHAND) >> 8) ; Set PCLATH for jump movwf PCLATH btfss INTCON, INTF ; branch if PULSEIN arrived goto EndInt ; your code goes here ; restore the machine context EndInt movf fsave,w ;restore the FSR movwf FSR movf psave,w ;restore PCH movwf PCLATH swapf ssave, W ;restore STATUS movwf STATUS swapf wsave, F swapf wsave, W ;restore W retfie endasm
That also answers Damien as to the code needed for the CONTEXT RESTORE of proton
![]()
Last edited by Jerson; - 28th August 2009 at 13:12. Reason: added code
Bookmarks