.. kung ganito ang method, kailangan mo pa rin ng isa pang reference. sa method rin na 'to kailangan mo ng fixed time in getting the number of pulses.
.meaning pwede ka magmeasure ng frequency na many times faster than your MCU clock speed.
..Another pin is used para magate yung pulses sa T0CKI pin..
.. naguumpisa sa mataas na frequency then may level na ikinucompare, kung below a certain level, next range naman.
pwedeng mas mataas pa keysa sa maximum clock frequency nya (i.e. 20MHz)?
ang disadvantage nung counting then comparing to a fixed time in measuring frequency e kapag nabubuo at kinukulang yung count. mahirap explain pero graphically makikita. hindi rin gaanong ka-responsive kapag mabilis magbago ang frequency (like sa RPM measurement) kaya mostly, period yung kinukuha. though with limited hardware mahirap din yung period ang kunin (typically requires a Timer/Counter with Capture module).
@glutnix..yung slewrate ng T0CKI pin, saan makikita sa datasheet ang value nito? Mukhang interesting ang makameasure ng freq higher than the PIC clock speed
Hindi po ko alam saan sa datasheet(malamang sa electrical characteristics).pero dun sa kabilang threadhttp://www.electronicslab.ph/forum/index.php?topic=1988.40andun yung link ng appnote na binabanggit natinhttp://www.jimfranklin.info/microchipdatasheets/00592d.pdfdun din po nakalagay limitation ng T0CKIdinadownload ko pa ulet appnote kaya di ko pa matingnan,hehehe
.. So self-clocking is applied.This is done by using an 2 I/Os that controls the gate of the freq counter and the other one to self-clock.The first I/O is to disable the input. The other I/O is connected to the RTCC input. During capture, this I/O is set to high-impedance. After the gate-time elapsed, the first I/O disables the input then the 2nd I/O is set to output.Then clock pulses are generated and counted. On each pulse, TMR0 is checked for any changes.When TMR0 changed its value, the clocking stopped and the previous prescaler value = (256-count) is now determined. This idea behind self-clocking is that it the prescaler is clocked until overflow occurs thus the clock pulse count is the lacking pulses until overflow.
thanks, sir zer0w1ng dito sa idea.. di sya 100% clear sa'kin, pero i'll try to make a code para dito.....natataka lang ako sa schematic nya, wala syang ibang pins na ginamit para sa input aside dun sa RTCC, isa pang pin na gaya ng sabi ni glutnix_neo na naka-tie sa RTCC for gating..
good enough master zerowing, nahirapan din ako magexplain di ko kasi alam tawag dun eh,hehehe,self clocking pala yun.
This means we must use some other method for measuring time - specifically, by manually counting the number of instructions that are executed.