class: center, middle, inverse # Timer ## PIC16F887 --- .left-column[ ## Timer 0 ] .right-column[ * 8Bit counter/timer register * Overflow from FFh -> 00h triggers interrupt * Interrupt starts ISR * ISR = Interrupt Service Routine ] --- .left-column[ ## Timer 0 ### Modes ] .right-column[ * Timer mode * Increments on each instruction cycle * Counter mode * Counts rising/falling edge on T0CKI ] --- .left-column[ ## Timer 0 ## Timer 1 ] .right-column[ * 16Bit counter/timer register * works as timer with internal clock source * Prescaler of 1, 2, 4 or 8 * Timer increments if clock sources is a multiple of the prescaler * works as timer with external clock oscillator * works as counter with external clock * Can create an interrupt even if the processer is in sleep mode * Will wake-up the processor ] --- .left-column[ ## Timer 0 ## Timer 1 ## Timer 2 ] .right-column[ * 8Bit timer register, 8Bit period register * period register gets user input * Works only as timer * Prescaler of 1, 4 or 16 * Postscaler 1:1 to 1:16 * Both registers are compared, on match: * Timer register is resetted * Match output goes into postscaler * Creates interrupt for ISR ]