Mrunal Ahirrao
Full Member level 2
- Joined
- Nov 26, 2012
- Messages
- 133
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 1,298
- Location
- India
- Activity points
- 2,213
hello everyone I am trying to measure frequency using PIC16f886. I am using simple comparator for Sine wave to square wave conversion. And I have attached the input of comparator with RA4/T0CLK to use Timer0 as a counter.I have also copied code for it but my LCD displays counts from 0-9 and then again roll overs to 0 and starts counting again. The code I copied is:
Please guide me.
Code:
void Display_Freq(unsigned int freq2write)
{
frequency[1] = (freq2write/10) + 48; // Extract tens digit
frequency[2] = (freq2write/1)%10 + 48; // Extract ones digit
// Display Frequency on LCD
Lcd_Out(2,13,frequency);
Lcd_Out(2,15,"Hz");
}
Please guide me.