Hello,
I just sublimized my two last 16F690 and had to replace and adapt the code to my old 16F88... ones...
Since I did so, I can't make the INTerrupt routine work anymore.
I compared with former programs I made and can't find the difference.
Why isn't it working; where's the fish?
Code:' Fuses @ DEVICE HS_OSC @ DEVICE PROTECT_OFF @ DEVICE WDT_ON @ DEVICE PWRT_ON @ DEVICE MCLR_OFF @ DEVICE BOD_OFF @ DEVICE LVP_OFF @ DEVICE CPD_OFF @ DEVICE DEBUG_OFF @ DEVICE CCPMX_OFF '------------------------------------------------------------------------------- ' Registers 76543210 OPTION_REG = %10000000 'PORTB Pull-Ups disabled OSCCON = %00000000 'Internal RC set External Xtal ANSEL = %00000000 'Disable analog inputs ADCON0 = %00000000 'A/D Module is OFF CMCON = %00000111 'Comparator Module is OFF INTCON = %10100000 'Set Interrupts TRISA = %00000000 'Set Input/Output PORTA = %00000000 'Ports High/Low TRISB = %00000000 'Set Input/Output PORTB = %00000000 'Ports High/Low '------------------------------------------------------------------------------- ' Variables Ticks var byte Second var byte Minute var byte Hour var byte LED1 var PORTB.5 LED2 VAR PORTB.4 '------------------------------------------------------------------------------- ' Program clear On Interrupt Goto tick_int TEST: if second = 2 then second = 0 toggle led1 goto test endif end '------------------------------------------------------------------------------- disable TICK_INT: Ticks = Ticks + 1 If Ticks < 61 Then TICK_INT_RESET Ticks = 0 Second = Second + 1 If Second >= 60 Then Second = 0 minute = minute + 1 If minute >= 60 Then minute = 0 Hour = Hour + 1 Endif Endif toggle led2 'control LED - blink every second TICK_INT_RESET: INTCON.2 = 0 Resume enable





Bookmarks