Is this correct:
20000000/4 = 5000000 -> internal clock
5000000/256 = 19531.25 -> RTCC roll over
19531.25/256 = 76.294 -> RTCC_DIV_256
===========================================
This is wher I get confused
On page 136 of PICmicro MCU C by Nigel Gardner the following appears;
#use delay(clock=1024000)
===in code
setup_counters(rtcc_internal,rtcc_div_256);
// increments 1024000/4*256 times per second
//or every millisecond
Is this correct:
1024000/4 = 256000 -> internal clock
256000/256 = 1000 -> RTCC roll over
-- this part of the calculation is not performed
1000/256 = 3.9 -> RTCC_DIV_256
===========================================
My question is: is the example in Nigel Gardner's book incorrect because the RTCC_DIV_256 is never taken in to account?</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516638
:=This is wher I get confused
:=On page 136 of PICmicro MCU C by Nigel Gardner the following appears;
:=
:=#use delay(clock=1024000)
:=
:====in code
:=setup_counters(rtcc_internal,rtcc_div_256);
:=// increments 1024000/4*256 times per second
:=//or every millisecond
:=
:=Is this correct:
:=1024000/4 = 256000 -> internal clock
:=256000/256 = 1000 -> RTCC roll over
The comment of the code sais something about incrementing every 1ms, so I think this 1000 is the incrementing frequency of tmr0 and not the roll over frequ.
:=-- this part of the calculation is not performed
:=1000/256 = 3.9 -> RTCC_DIV_256
:============================================
:=
:=My question is: is the example in Nigel Gardner's book incorrect because the RTCC_DIV_256 is never taken in to account?
I don't know this appliaction of M. Gardner but perhaps there is no tmr0-isr? And so he don't use the roll-over.
may this helps
mfg
Felix
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516641
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum