#include <pic.h>
void main()
{
TRISC=0; // PORTC output
PORTC=0; // PORTC clear
T0CS=0; // Internal clock select (Fosc/4)
PSA=0; // Prescaler assigned to TMR0
PS2=1;
PS1=1;
PS0=0; // 1:128 Prescaler ratio
TMR0=100; // (256-156=100) for 156 increments
RC0=1; // RC0 LED ON
while(1)
{
if(T0IF==1){
TMR0=100;
RC0=!RC0;
T0IF=0; //clear overflow flag bit
}
}
}
void main()
{
TRISC=0; // PORTC output
PORTC=0; // PORTC clear
T0CS=0; // Internal clock select (Fosc/4)
PSA=0; // Prescaler assigned to TMR0
PS2=1;
PS1=1;
PS0=0; // 1:128 Prescaler ratio
TMR0=100; // (256-156=100) for 156 increments
RC0=1; // RC0 LED ON
while(1)
{
if(T0IF==1){
TMR0=100;
RC0=!RC0;
T0IF=0; //clear overflow flag bit
}
}
}
Comments
Post a Comment