Vous êtes sur la page 1sur 1

TMR0IF_bit = 0; se pone al pinal para que el timer vuelva a funcionar, para que haa

caso
Si no se le pone cero, el programa entiende como si se esta trabajando con la
interrupcion.

El timer genera la interrupcion cuando hay un sobre flujo, y la bandera


anteriormente mencionada se pone a 1.

INTCON - en el registro intcon los 3 bits menos significativos son banderas, con
ellas se sabe que tipo de interrupcion es. La descripcion de todos esos bits esta
en el datasheet
1 para el bit 7 y 0 para las demas

el tmr0 se puede llenar de forma externa o de forma interna


Las banderas se pueden configurar para que el timer incremente cada cierto numero
de ciclos maquina

PORTB = PORTB~ EL "~" niega el valor de puerto b

Con el timer0 se puede modificar el tiempo en el que hace las cosas el


microcontrolador

EL INTCON SIRVE PARA HABILTAR LAS INTERRUPCIONES

EL OPTION ES EL PREESCALADOR, ES DECIR, AQUI SE HABILITAN LAS OPCIONES DE LAS


INTERRUPCIONES.
EN EL INTCONN DEBE ESTAR HABILITADO EL GLOBAL Y EL QUE SE USA, Y EN ESTE CASO ES EL
TMR0
EL OPTION DECIDE CADA CUANTOS CICLOS MAQUINA SE INCREENTA EN 1 EL TMR0
TODOS LOS PICS TRAEN EL TMR0 Y FUNCIONAN DE MANERA MUY SIMILAR, PERO
AL INCREMENTAR EL NUMERO DE TIMERS INCREMENTAN SU NUMERO DE CONTROLES PARA ESE
TIMER

Vous aimerez peut-être aussi