Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
bsodmike said:Ohh very nice!
Question. The say the PIC has a 4Mhz clock, what speed does the code run at 4Mhz or 1Mhz? I know that the tmr0 runs @ 1/4th the clock tho....
This has been bugging me a bit. I even noticed how you do a 4Mhz/4....so hrm...
Matt(Pic progger) said::?
If the timer is interupt driven, assuming (using) TMR0 is set to a ratio of 1:1 then at 4.096Mhz, TMR0 will generate an interrupt every 250uS, the 4.000Mhz crystal every 256uS...... if we add D'04' to TMR0 in the interrupt routine (allowing for the 2clks to update it, see the datasheets) this will correct the time for you!
bsodmike said:Nigel, why does the code run @ 1/4th - is it due to the PIC doing 'other' stuff.....or... ?!?
bsodmike said:Ahh thanks, that makes more sense. Another Q: how does one work out how long it will take for the WDT to trip - is it 1 / (clock/4/WDT scaler) ?
kentken said:How hard is it to set up the WDT as a simple timmer?
How acurate is it?
What is the longest time before int, on any tmr's?
How does all the Prescaler, and Post scaler work?
It isn't sinking in yet.
Thanks
Kent