Searching \ for '[PIC]: Real Time Clock' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/time.htm?key=real+time
Search entire site for: 'Real Time Clock'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Real Time Clock'
2001\02\15@174218 by Peter May

flavicon
face
What is the easiest and where can I find examples of hooking up a RTC chip
to a 16F877? I have a couple of Dallas 1302's. Are there any others I should
consider?

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2001\02\16@021231 by Vasile Surducan

flavicon
face
Why do you want to connect a RTC to a chip who already have tmr1 who works
ok with external 32768 crystal ?
Vasile

On Fri, 16 Feb 2001, Peter May wrote:

> What is the easiest and where can I find examples of hooking up a RTC chip
> to a 16F877? I have a couple of Dallas 1302's. Are there any others I should
> consider?
>
> --
> http://www.piclist.com hint: To leave the PICList
> .....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu
>
>

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\16@022227 by Peter May

flavicon
face
Well It doesn't really matter wether I have an external chip or not as long
as I can get a reasonably accurate time and date etc.

{Original Message removed}

2001\02\16@084028 by Drew Vassallo

picon face
>Why do you want to connect a RTC to a chip who already have tmr1 who works
>ok with external 32768 crystal ?

I would do it just to avoid having to program time/date code.  For cheap
RTC's in the $1 range, it's well worth it, especially if: 1) you need the
code space, 2) if you're already using TMR1 for something else, and 2) a
low-power battery backup can still run the RTC long-term to maintain your
settings.

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\16@121627 by Tsvetan Usunov

flavicon
face
>> What is the easiest and where can I find examples of hooking up a RTC
chip
>> to a 16F877? I have a couple of Dallas 1302's. Are there any others I
should
>> consider?

V3021 from EM Marin, easy interface to any micro

>
>Why do you want to connect a RTC to a chip who already have tmr1 who works
>ok with external 32768 crystal ?
>Vasile

...and (the F version) consumes more than 200 uA clocked even at 32768 Hz ;)

Cheers
Tsvetan
---
PCB prototypes for $26 at http://run.to/pcb

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\16@160408 by Byron A Jeff

face picon face
>
> Well It doesn't really matter wether I have an external chip or not as long
> as I can get a reasonably accurate time and date etc.

I'm in the process of running TMR1 32768 Hz tests right now for a
sunrise/sunset clock I'm building. Since the timing resolution wasn't
real important I set TMR1 for the max 16 second timeout and added 16
seconds to the time every timeout. But without too much work you can get
the timeout down to 2 seconds and with a bit of code you can actually
update every second.

I've run a couple of 12 hour tests and they've kept time to within 1 second.
Once I get my display and button interface added I plan to run a week or
two test.

Also I've suceeded in getting a Nicad battery interface working. A 9V high
capacity Nicad from the RatShack kept the board running for 8 hours. I figure
that'll outlast most any power outage.

After fiddling with it, I'd highly recommend using the 32768 Hz crystal on
TMR1.

BAJ
>
> {Original Message removed}

2001\02\16@161621 by Peter May

flavicon
face
Hi there. I did a search on V3021 and couldn't find much. Any pointers to a
couple of eb pages would be great.

{Original Message removed}

2001\02\16@161643 by Byron A Jeff

face picon face
>
> >Why do you want to connect a RTC to a chip who already have tmr1 who works
> >ok with external 32768 crystal ?
>
> I would do it just to avoid having to program time/date code.

Debateable. The alternative is writing code to access the registers. Here's
the code snippet I have from the clock I'm currently building:
------------------------------------------------------------
; RTC update code using TMR1. TMR1 set to max 16 second timeout
; (c) Byron A. Jeff 2001
; Licensed under GPL. See GPL copying file at http://www.fsf.org for more info.
main
       btfss   PIR1,TMR1IF     ; Wait for timer 1 timeout
       goto    main
       movlw   16              ; Add 16 seconds
       addwf   seconds
       movlw   60              ; See if we exceeded max seconds
       subwf   seconds,W       ; Don't change unless necessary
       btfsc   STATUS,Z        ; Update if exactly 60
       goto    upsecs
       btfss   STATUS,C        ; update if carry is set (positive)
       goto    printdate       ; Done if no update
upsecs  movwf   seconds         ; Move updated value back
       incf    minutes         ; Move to next minute
       movlw   60              ; See if we're at 60
       xorwf   minutes,W
       btfss   STATUS,Z        ; Done if not 60 minutes.
       goto    printdate
       clrf    minutes         ; Back to 0 minutes
       incf    hours           ; Next hour
       movlw   24              ; See if 24th hour
       xorwf   hours,W
       btfss   STATUS,Z        ; Done if not 24 hours
       goto    printdate
       clrf    hours           ; Back to 0 hours
       incf    day             ; Next day
       call    getlastday      ; Get the last day of the month
       xorwf   day,W
       btfss   STATUS,Z        ; Done if not last day
       goto    printdate
       movlw   1               ; day starts at day 1.
       movwf   day
       incf    month           ; Next month
       movlw   13              ; See if last month of the year
       xorwf   month,W
       btfss   STATUS,Z        ; Done if not last day
       goto    printdate
       movlw   1               ; month starts at 1.
       movwf   month

; printdate is the end of the routine and pushes the date out the serial port

getlastday
       movf    month,W         ; Get the last day of the month + 1
       addwf   PCL,F           ;
       dt      32,29,32,31,32,31,32,32,31,32,31,32
-----------------------------------------------------------------------

It took the most time just figuring out how the Carry flag reacts on a
subtract. There's a good description in the Midrange manual.

Also note that this code keep the time in binary, not BCD. You need a routine
to convert binary to BCD before display. See Andy Warren's BCD example on
is FastForward PIC page if you want to track BCD.

Doesn't have the year but it's not too difficult.

The hardest part and the only RTC chip win would be daylight savings time.
Does anyone know how it's computed?

>  For cheap
> RTC's in the $1 range, it's well worth it, especially if: 1) you need the
> code space, 2) if you're already using TMR1 for something else, and 2) a
> low-power battery backup can still run the RTC long-term to maintain your
> settings.

See code above and I powered the chip with a 9V nicad for 8 hours with no
problem. Also TMR1 is specifically designed to wake the chip from SLEEP on
interrupt because it continues to run even when the chip sleeps.

I only wish a PIC had 2 more timers just like TMR0-TMR2.

BAJ

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\16@162209 by Spehro Pefhany

picon face
At 08:12 AM 2/17/01 +1100, you wrote:
>Hi there. I did a search on V3021 and couldn't find much. Any pointers to a
>couple of eb pages would be great.

http://www.elateceurope.com/emmarin/pdf/v3021.pdf

Best regards,

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Spehro Pefhany --"it's the network..."            "The Journey is the reward"
speffspamKILLspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Contributions invited->The AVR-gcc FAQ is at: http://www.bluecollarlinux.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\16@175419 by Drew Vassallo

picon face
>See code above and I powered the chip with a 9V nicad for 8 hours with no
>problem. Also TMR1 is specifically designed to wake the chip from SLEEP on

I'm not sure about the calcs, but a $.55 Lithium coin cell (220mAh) at 3V
could keep the RTC running at 3uA for about 8 years.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\20@223450 by Eric Chan

picon face
Have you considered the i2c M41T00 from ST Microelectronics?  The i2c
might make life easier for you.

http://www.st.com/stonline/books/pdf/docs/6100.pdf

Eric


Peter May wrote:
>
> What is the easiest and where can I find examples of hooking up a RTC chip
> to a 16F877? I have a couple of Dallas 1302's. Are there any others I should
> consider?
>
> --
> http://www.piclist.com hint: To leave the PICList
> .....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam_OUTspamTakeThisOuTmitvma.mit.edu


2001\02\21@075931 by McIlvaine, Robert

flavicon
face
I know the ic's you mention are low pin count, serial i/o...but, just for
another option you may want to look at the BenchMarq
http://www.benchmarq.com/rtc.html RTC's.

These are real Tim 'The Tool Man' "more power...arr, arr, arr" type clock
chips.

- 32k - 512k bytes (yes, bytes, not bits) ram
- watchdog timers
- date and time
- 10 year battery backup on board
- interrupt output
- etc.

in one 40 pin package.

{Quote hidden}

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\21@082250 by Drew Vassallo

picon face
> > Peter May wrote:
> > >
> > > What is the easiest and where can I find examples of
> > hooking up a RTC chip
> > > to a 16F877? I have a couple of Dallas 1302's. Are there
> > any others I should
> > > consider?

Wow, a 40-pin RTC with 512K RAM.  Must be able to control the Space Shuttle.

Try the JRC NJU6355, from Digi-Key for $1.80.  No 512K ram, but I have
interface code if you need it.  2-wire interface, automagic leap year
adjustment, etc. in an 8-pin package.

--Andrew
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2001\02\21@085454 by kayode.ayandokun

flavicon
face
Drew Vassallo <KILLspamsnurpleKILLspamspamHOTMAIL.COM> wrote:
> >Why do you want to connect a RTC to a chip who already have tmr1 who works
> >ok with external 32768 crystal ?
>
> I would do it just to avoid having to program time/date code.  For cheap
> RTC's in the $1 range, it's well worth it, especially if: 1) you need the
> code space, 2) if you're already using TMR1 for something else, and 2) a
> low-power battery backup can still run the RTC long-term to maintain your
> settings.

Time / date code for the 16F84 is available from
http://www.hut.fi/~jalapaav/Electronics/Pic/Clock/ together with a
discussion of how to calculate time intervals with a variety of clock
speeds.  It has been included in a real time clock demo program that is
available free from http://www.stv5730a.co.uk.  This demo can display on
a serial LCD as well as a TV screen or video monitor.

Kayode.
________________________________________________________________________
Visit http://www.stv5730a.co.uk and put your next PIC project on TV
with the 16F84 STV5730A on screen display project board.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...