Hi groups ! I have spend a whole sunday trying to understand why interrupt of change are not working for me. I have played with those on PIC16F877 and works ok there. According to DS41190A datasheet, using interrupt of change means: In the main program: - enabling all interrupts by setting gie - enabling interrupts on change by setting gpie - enabling pins individual interrupts on change by setting iocb0-iocb5 In the interrupt routine: - push-ing the status and w - detecting gpif high state - disabling gie - writting the specific gpio to itself for mistmach condition - calling the user isr routine - clearing the gpif for the next interrupt sequence - pop-ing the status_saved and w_saved - retfie-ing ( gie is enabled) However, does not work. There is something I'm missing as new (and unknown for me) 12F675 erata ? thank you in advance, Vasile http://surducan.netfirms.com |
|
[PIC]: 12F675 interrupt on change, a lost sunday...
Started by ●August 11, 2003
Reply by ●August 11, 20032003-08-11
What exactly is it doing or not doing? The mismatch condition is cleared by reading, not writing. Chad --- Vasile Surducan <> wrote: > > Hi groups ! > > I have spend a whole sunday trying to understand why interrupt of > change > are not working for me. I have played with those on PIC16F877 and > works > ok there. > According to DS41190A datasheet, using interrupt of change means: > In the main program: > - enabling all interrupts by setting gie > - enabling interrupts on change by setting gpie > - enabling pins individual interrupts on change by setting > iocb0-iocb5 > > In the interrupt routine: > - push-ing the status and w > - detecting gpif high state > - disabling gie > - writting the specific gpio to itself for mistmach condition > - calling the user isr routine > - clearing the gpif for the next interrupt sequence > - pop-ing the status_saved and w_saved > - retfie-ing ( gie is enabled) > > However, does not work. There is something I'm missing as new > (and unknown for me) 12F675 erata ? > > thank you in advance, > Vasile > http://surducan.netfirms.com __________________________________ |
|
Reply by ●August 11, 20032003-08-11
By reading, sure, it was a writting mistake. Moving the port value into w register. I can't sense the change in any pin input. The pullpup is enabled by option so pulling low the input must be seen as a change state. However, does not. On Mon, 11 Aug 2003, Chad Russel wrote: > What exactly is it doing or not doing? The mismatch condition is > cleared by reading, not writing. > > Chad > > --- Vasile Surducan <> wrote: > > > > Hi groups ! > > > > I have spend a whole sunday trying to understand why interrupt of > > change > > are not working for me. I have played with those on PIC16F877 and > > works > > ok there. > > According to DS41190A datasheet, using interrupt of change means: > > In the main program: > > - enabling all interrupts by setting gie > > - enabling interrupts on change by setting gpie > > - enabling pins individual interrupts on change by setting > > iocb0-iocb5 > > > > In the interrupt routine: > > - push-ing the status and w > > - detecting gpif high state > > - disabling gie > > - writting the specific gpio to itself for mistmach condition > > - calling the user isr routine > > - clearing the gpif for the next interrupt sequence > > - pop-ing the status_saved and w_saved > > - retfie-ing ( gie is enabled) > > > > However, does not work. There is something I'm missing as new > > (and unknown for me) 12F675 erata ? > > > > thank you in advance, > > Vasile > > http://surducan.netfirms.com > > __________________________________ > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > > ">http://docs.yahoo.com/info/terms/ |
|
Reply by ●August 11, 20032003-08-11
With out seen the code and schematic, I can only guess. Make sure you do a port read immediately before enabling the "Interrupt on Change" flag for the first time. Changing any of these pins from an input to an output can cause an interrupt. Is the pin actually being pulled up and down. The weak pullup is only 400 microamps max. Chad --- Vasile Surducan <> wrote: > > > By reading, sure, it was a writting mistake. Moving the port value > into > w register. I can't sense the change in any pin input. The pullpup is > enabled by option so pulling low the input must be seen as a change > state. > However, does not. > On Mon, 11 Aug 2003, Chad Russel wrote: > > > What exactly is it doing or not doing? The mismatch condition is > > cleared by reading, not writing. > > > > Chad > > > > --- Vasile Surducan <> wrote: > > > > > > Hi groups ! > > > > > > I have spend a whole sunday trying to understand why interrupt of > > > change > > > are not working for me. I have played with those on PIC16F877 and > > > works > > > ok there. > > > According to DS41190A datasheet, using interrupt of change means: > > > In the main program: > > > - enabling all interrupts by setting gie > > > - enabling interrupts on change by setting gpie > > > - enabling pins individual interrupts on change by setting > > > iocb0-iocb5 > > > > > > In the interrupt routine: > > > - push-ing the status and w > > > - detecting gpif high state > > > - disabling gie > > > - writting the specific gpio to itself for mistmach condition > > > - calling the user isr routine > > > - clearing the gpif for the next interrupt sequence > > > - pop-ing the status_saved and w_saved > > > - retfie-ing ( gie is enabled) > > > > > > However, does not work. There is something I'm missing as new > > > (and unknown for me) 12F675 erata ? > > > > > > thank you in advance, > > > Vasile > > > http://surducan.netfirms.com > > > > > > > > __________________________________ > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the > instructions > > > > ">http://docs.yahoo.com/info/terms/ > > > __________________________________ |