Sean Schouten wrote : > > There is another way; other than hard-coded memory > addressing? You would make me happy by pointing > me to an example. You could simply use the docs. Look up the RES assembler directiv in the MPASM manual (or in the help file). > > Also if TEMP_W is supposed to be > > where W gets saved on interrupt, this will not work > > on PICs that have more than one bank. > > Ah, why is that? Because you want to save W *without* making any changes to STATUS (since that one will be save next, as-is). And since you can not know which bank you're in when the INT fired, you have to use un-banked memory. In the case of the F684, that is h'70' - h'7F'. See the "data memory map" in the data sheet. > How do I not use 'absolute-mode' in this case?... In short : - Add a "linker script" to your MPLAB project. - Make the needed changes to the source to convert it from asb mode to reloc mode. Not that you code of course will *work* in either mode, but relocatable is the *prefered* way of writing code today. > > ; Set OSC to 31kHz > > > MOVLW 0x03 > > > MOVWF OSCCON > > > > Doesn't this do more than just select the oscillator frequency? > > No. Yes, it also select the source if the "system clock". You are also writing a "1" to the LTS bit, which is read-only... > > BSF INTCON, GIE ;Set the General Interrupt Enable bit to 1. > > > BCF INTCON, RAIF ;Clear the PORTA interrupt flag. > > > > This is out of order. Turning on GIE is the last thing you > > should do in the interrupt setup. > > > I thought that GIE had to be turned on in order to enable > interrupts in general. It is. Just do it last in your INIT routine. > Wouldn't it take multiple overflows to count to > a second if I switch my OSC up to 8Mhz? Of course, that's the normal way to handle it, not to lower the system clock as you do. Jan-Erik. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist