bluemonday
Newbie level 6
pic16f877 timer interrupt
hi.. i used this code to program my pic..
unsigned int adc_value;
void main() {
ADCON1 = 0x80; // Configure analog inputs and Vref
TRISA = 0xFF; // PORTA is input
TRISB = 0x3F; // Pins RB7, RB6 are outputs
Usart_Init(115200);
do {
adc_value = Adc_Read(2); // Get results of AD conversion
Usart_Write(adc_value);
Delay_us(200);
} while(1);
}
i cant get an accurate sampling.. can anyone help me with this.. i want to use an interruput based timer for this but im dont know how.. plz help me.. anybody who knows.. plz let me have ur code..
hi.. i used this code to program my pic..
unsigned int adc_value;
void main() {
ADCON1 = 0x80; // Configure analog inputs and Vref
TRISA = 0xFF; // PORTA is input
TRISB = 0x3F; // Pins RB7, RB6 are outputs
Usart_Init(115200);
do {
adc_value = Adc_Read(2); // Get results of AD conversion
Usart_Write(adc_value);
Delay_us(200);
} while(1);
}
i cant get an accurate sampling.. can anyone help me with this.. i want to use an interruput based timer for this but im dont know how.. plz help me.. anybody who knows.. plz let me have ur code..