Long time I do not use the timers except once in a super easy project and use the code below, every second the Red Led would turn on and off while it lasted a few ms the Green Led.
Now I want to do a project that every minute makes battery and temperature measurement.
But with the PIC 18F26K22 there are instructions that do not exist as:
I have been looking but I can not clarify with TMR0L or replace OPTION_REG, So that every minute makes a measurement.
Somebody help me.
THX.Code:Device = 12F675 Xtal = 4 All_Digital True On_Interrupt GoTo LED_ON_GREEN OPTION_REG = %10000111 INTCON = %11100000 CMCON = 7 TRISIO = $0 GPIO = %00010000 Dim COUNT As Byte Symbol LED_RED = GPIO.1 ' Out LEd RED Symbol LED_GREEN = GPIO.0 ' Out LEd GREEN TMR0 = 0 Low LED_RED Low LED_GREEN GoTo INI LED_ON_GREEN: Inc COUNT If COUNT =40 Then Toggle LED_GREEN COUNT=0 End If TMR0=0 INTCONT = %11100000 Context Restore INI: High LED_RED DelayMS 1000 Low LED_RED DelayMS 1000 GoTo INI