Using the Mikro timer calculator @ 8MHz
Of course the syntax is wrong but the values are correct. I couldn't get 1 second so I did 0.1 second. Same principle count to 10 for one sec and 50 for five sec.Code:'Timer1 'Prescaler 1:4; TMR1 Preload = 15536; Actual Interrupt Time : 100 ms 'Place/Copy this part in declaration section sub procedure InitTimer1() T1CON = 0x21 TMR1IF_bit = 0 TMR1H = 0x3C TMR1L = 0xB0 TMR1IE_bit = 1 INTCON = 0xC0 end sub sub procedure Interrupt() if (TMR1IF_bit) then TMR1IF_bit = 0 TMR1H = 0x3C TMR1L = 0xB0 'Enter your code here end if end sub




Bookmarks