With internal oscillator rtc_timer0 is not at all accurate. With external
crystal and multiplexing 7seg using timer1 I have found that accuracy is
affected. If its just lcd and no ISR involvement other than timer0, rtc
accuracy is pretty good with crystal.

Sunish


On Thu, Jul 24, 2014 at 6:31 PM, Pavel Milanes Costa <[email protected]>
wrote:

> Hi,
>
> First Thanks to all for the replies, I - as always - learn a lot with your
> answers.
>
> I'm on the super cheap project here, no just "cheap" for being cheap, but
> as for no pieces !!!
>
> I'm in Cuba island, no ebay, no radioshack, etc... just a big junkbox >:-)
>
> I rescued a PIC16F630 from a auto alarm, it has 14 pins, 12 to use and 11
> to be outputs + 1 pin input only, I rescued a LCD from an old VCR for the 7
> seg display.
>
> I settled on the timer0_isr_interval for this time...
>
> I used the internal 4 Mhz clock of the pic, internal MCLR, and created a
> routine for multiplexing the display using the tomer0_isr_interval...
>
> All working good... (at the display stage) if you are doing the math I
> have 11 pins (7 segments + 4 common anodes for the digits) so the dot was
> running from an independent and cheap 4069 inverters :-)
>
> The input only pin is for setting the time...
>
> I have two options for the clock, that's why I asked the question in the
> first place...
>
> After experimenting and calibrating I choose the timer0_isr_interval
> version, here is why...
>
> /(The pic has a 5.00 volts as per a LM317T in the power supply... so no
> voltage variations to affect the clock)/
>
> *rtc_timer1 option:*
>
> I have to user it on timer1, because timer0 has the timer0_isr_interval
> for multiplexing the display.
>
> With this option I have only one point to calibrate OSCCAL, I made a
> routine to modify it and load the adjust in the eeprom of the pic.
>
> Results of experimentations:
>
> The step of adjust are to wide apart, my best setting was
>
> OSCCAL = 20: delay of about 3 minutes in 24 hours
> OSCCAL = 21: increase of about 5 minutes in 24 hours
>
> Not so good, reading the pic datasheet, I se that moving the VCC I can
> tuner the INT_OSC.. but na...
>
> *timer0_isr_interval option:*
>
> It's there already for the 7 segment multiplexing...
>
> The adjust was incrementing/decrementing the ticks on the slot... the
> previous routine for modify the OSCCAL was modified to tune the ticks count
> on the particular slot on the isr_interval
>
> Results of experimentations: very good !!!!
>
> In theory with 1khz ticks I have to load the slot with 1000 for 1 second,
> but with an adjust of 1301 I have under 5 seconds increase per 24 hours...
>
> For the record, with 1300 I have a delay of about 30 seconds...
>
> So I stick to this variant... this is a good project for learning about
> timer0_isr_interval and and rtc_* libraries...
>
> At the end I have the pic, the display, a bunch of resistors + capacitors,
> a LM317 and a 4069 inverters, just that to make a neat and homebrew clock...
>
> I then learn that WWVH? in 70Khz can reach Cuba on the nights, I'm
> searching info to *try* to make a lib for decoding the WWVH... If I succeed
> I will contribute it to jallib...
>
> Thanks to all.
>
> PS: I any want to peek in the code drop me an email...
>
>
> El 22/07/14 17:24, Pavel Milanes Costa escribió:
>
>  Hi to all...
>>
>> I'm building a 7 Segment desk clock as a hobby project, and I ran across
>> two methods to get the 1 second increments...
>>
>> - timer0_isr_interval
>>      Setting a 1Khz rate and a slot with tick to make one second
>>
>> - rtc_isr_tmr0
>>      A "more accurate solution" over time...
>>
>> There is any pros and cons about one method or the other?
>>
>> I read that rtc_isr_tmr0 is more accurate over time with jitter on the
>> seconds count... but,
>>
>> This is realy true? any reason to use timer0_isr_interval over this?
>>
>> cheers
>>
>> Pavel.
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/jallib.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/jallib.
For more options, visit https://groups.google.com/d/optout.

Reply via email to