thank you Tibi, already solved the problem ! top 10 wishes, Vasile http://surducan.netfirms.com On Tue, 12 Aug 2003, tibi wrote: > 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 > > > > -- > > http://www.piclist.com hint: The list server can filter out subtopics > > (like ads or off topics) for you. See http://www.piclist.com/#topics > > HI Vasile > > Try this code from a PICkit tutorial 3 downloaded from microchip web site > > .. > . > . > > ;**************************************************************************** > > ;Initialization > ;**************************************************************************** > > Init > ;call 0x3FF ; retrieve factory calibration value > ; comment instruction if using simulator, ICD2, or ICE2000 > BANK1 > movwf OSCCAL ; update register with factory cal value > call InitLED ;Initialize LED Routine Variables > BANK0 > clrf GPIO ;Clear Port > BANK1 > > clrf ANSEL ;PIC12F675 Only <<<<<<<<<<<<<<<<<< > movlw 0xFF > movwf TRISIO ;Tri-State All Inputs > clrf VRCON ;Vref Off > BANK0 > movlw 0x07 > movwf CMCON ;Comparator Off > BANK1 > movlw b'10000000' > movwf OPTION_REG ;TIMER0 Prescaler > bsf IOCB,3 ;Interrupt on Pin Change For GP3 > bsf INTCON,GPIE ;Interrupt on Change Enabled > bsf INTCON,T0IE ;Interrupt on TIMER0 Overflow Enabled > bcf INTCON,T0IF ;Clear TIMER0 Overflow Interrupt Flag > bcf INTCON,GPIF ;Clear Interrupt On Change Flag > bsf INTCON,GIE ;Turn on Global Interrupts > BANK0 > clrf TMR0 > > etc > > regards Tibor > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.