Searching \ for '[PIC] Real time Clocks...' 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 Clocks...'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Real time Clocks...'
2004\12\15@082449 by Mauricio Jancic

flavicon
face
Hi all,
       I have developed a timer for a customer. It's a very simple timer,
its actually a project I made perhaps 4-5 years ago. It has a 28-pin PIC
(16c62B) and a DS1307. the RTC also has memory and so it keeps the
programming information (when the timer must activate), and of course it
keeps track of the time...

       Now, the customer asked me to make things cheap. Smaller board, less
components, etc, etc... Is that familiar to anyone?

       Well, anyway, I have never implemented a RTC on a PIC, I have done
more complicated things, but not this one in particular.
       The only problem I see (let's imagine that I use a XTAL in tmr1 or a
4.something XTAL in the XTAL input) is the power consumption. The DS1307 can
last up to 10 years with a cr2032 but I cant see how to make a reliable
timer with a PIC and a battery that can last that long.

       This will sound very incompetent, perhaps, but please read it all.
Another reason I'm trying to change from the ds1307 to something else, is
that the ds1307 has RAM and I'm storing the timer parameters in RAM. We have
used many battery holders for the cr2032 and there is a common denominator:
the battery "sometimes" disconnects and I lost everything, both time and
timer parameters.
       
       I have no problem in loosing time, I mean, is not THAT critical,
because the timers are designed to be used on pet feeders, so the worst case
scenario could be that the pet will be fed x hours later. That's not a big
deal. The main problem is that I also loose the RAM data, so that make the
machine to stop working at all.
       I know the solution to this, a soldered battery, there are battery
holders to solder, but this is a very *special* customer and that is not a
solution, atleast not until I redesign everything. When I told him that he
must start to solder the bat. He told me "No no, never mind I'll take care
of that". He already change 3 different bat. Holders and now he is going to
glue the battery to the holders, it might work... Anyway he knows its not my
responsibility.

       Well, with all that said, can anyone help me on the matter. I think
the most important thing could be how to have a long time battery duration
at a low cost. Have in mind that the equipment would have to be connected to
mains in order to feed, so it will be connected most of the time. I have
volts on the board.

Regards,

Mauricio Jancic
Janso Desarrollos
Microchip Consultant Program Member
(54) 11-4542-3519
spam_OUTinfoTakeThisOuTspamjanso.com.ar
http://www.janso.com.ar

____________________________________________

2004\12\15@105433 by Dwayne Reid

flavicon
face
At 06:24 AM 12/15/2004, Mauricio Jancic wrote:
>Hi all,
>         I have developed a timer for a customer.
>
>         Now, the customer asked me to make things cheap. Smaller board, less
>components, etc, etc... Is that familiar to anyone?
>
>         Well, anyway, I have never implemented a RTC on a PIC, I have done
>more complicated things, but not this one in particular.

You don't say how much I/O you need but I'd seriously consider using a
16F630 for this project.  It has provision for a low power RTC by using
TMR1 with a 38 KHz watch crystal.

Its a little more work than using the Dallas part but the cost savings can
be considerable.  There is also the added advantage of on-board eeprom so
that your user parameters aren't lost when you get a power interruption.

dwayne

--
Dwayne Reid   <.....dwaynerKILLspamspam@spam@planet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 20 years of Engineering Innovation (1984 - 2004)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

____________________________________________

2004\12\15@111507 by William Chops Westfield

face picon face

On Dec 15, 2004, at 5:24 AM, Mauricio Jancic wrote:

> It has a 28-pin PIC
> (16c62B) and a DS1307. the RTC also has memory and so it keeps the
> programming information (when the timer must activate), and of course
> it
> keeps track of the time...
>
>        Now, the customer asked me to make things cheap. Smaller board, less
> components, etc, etc... Is that familiar to anyone?
>
I don't think that you'll be able to match the current consumption of an
RTC with a PIC, but if you need fewer than 16 IOs, you might change the
PIC to something like an 16f627 that is smaller, cheaper, and has its
own
eeprom (running on internal oscillator.)

RAM-based RTCs seem to be OK for millions of personal computers; can you
fix your battery glitching with moderately sized cap?

BillW

____________________________________________

2004\12\15@113145 by Mauricio Jancic

flavicon
face
>>computers; can you fix your battery glitching with moderately
>>sized cap?

The obvious solutions... Havent think of that.... I'll give it a tought.
Anyway that will not reduce costs....

Mauricio Jancic
Janso Desarrollos
Microchip Consultant Program Member
(54) 11-4542-3519
infospamKILLspamjanso.com.ar
http://www.janso.com.ar

____________________________________________

2004\12\15@114348 by Peter Moreton

flavicon
face
> You don't say how much I/O you need but I'd seriously consider using a
16F630 for this project.  It
> has provision for a low power RTC by using
> TMR1 with a 38 KHz watch crystal.

But, how would you efficently implement the divide by thirty eight thousand
counter? :-)

Sorry, couldn't resist. I'm sure you mean a 32Khz watch xtal



____________________________________________

2004\12\15@114754 by Bob Axtell

face picon face
I'd use one of Xicor's RTC's that keep data as EEPROM, but the timer
still runs
on BAT, down to 2V. Then use a PIC10F to do whatever else is left. Its a
pretty
cheap combination. I'd look at the Xicor  X1226. The Xicor can power up
the PIC
at the alarm output, every second, every minute, etc.

--Bob

Mauricio Jancic wrote:

{Quote hidden}

>_____________________________________________

2004\12\15@115236 by Wouter van Ooijen

face picon face
> > It has a 28-pin PIC
> > (16c62B) and a DS1307. the RTC also has memory and so it keeps the
> > programming information (when the timer must activate), and
> of course
> > it keeps track of the time...

IIRC some PICs have an extra oscillator for running a timer with a 32kHz
crystal while the CPU is asleep. Or maybe you can sleep the CPU, to be
woken up by the watchdog, and use the crystal to calibrate the watchdog.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu


____________________________________________

2004\12\15@121537 by olin_piclist

face picon face
Wouter van Ooijen wrote:
> IIRC some PICs have an extra oscillator for running a timer with a 32kHz
> crystal while the CPU is asleep.

Just about every PIC that has a timer 1 has this capability.  I've used it
once to make a real time clock, with the timer 1 oscillator driving a
32,768Hz watch crystal.  It worked well enough, but you won't get the very
low currents a dedicated RTC can give you.  Still, the "nanowatt" PICs can
get low enough for many applications.

> Or maybe you can sleep the CPU, to be
> woken up by the watchdog, and use the crystal to calibrate the watchdog.

I've done this in some applications too, but it is not suitable for a real
time clock.  The WDT has too much drift for the accuracy to be good enough.
To keep power consumption low, you only calibrate every few 100 wakeup
intervals.  You can't count on the accuracy in the mean time to RTC levels.

This method does work fine for less strict timing.  I've got one device that
has a 10F202 that needs to send out a message every 10.0 to 10.5 seconds.
To save power, the 10F is woken up periodically by the watchdog timer.  This
can vary by a factor of 2, so every 256 watchdog wakeups the 4MHz oscillator
is left on to calibrate the WDT.  This works very nicely.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com
____________________________________________

2004\12\15@135701 by Dwayne Reid

flavicon
face
At 09:44 AM 12/15/2004, Peter Moreton wrote:
> > You don't say how much I/O you need but I'd seriously consider using a
>16F630 for this project.  It
> > has provision for a low power RTC by using
> > TMR1 with a 38 KHz watch crystal.
>
>But, how would you efficently implement the divide by thirty eight thousand
>counter? :-)
>
>Sorry, couldn't resist. I'm sure you mean a 32Khz watch xtal

You are so right <grin>.  Yeah - I started off by typing 32,768 , then
decided I was being too darned precise and just slipped up with the fingers.

Good catch!

dwayne

--
Dwayne Reid   <EraseMEdwaynerspam_OUTspamTakeThisOuTplanet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 20 years of Engineering Innovation (1984 - 2004)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

____________________________________________

2004\12\15@150448 by Bob Ammerman

picon face
A nanowatt PIC with a 32.768 KHz watch crystal on TMR1 and burst processing
to do the real work should be pretty good on power consumption.

For example, a PIC16F636 has 2K program words, 256 bytes EEPROM and 128
bytes RAM (typical values at 3V Vdd):

Base current while 'powered down' (sleeping) - 1.2nA
Watch dog delta value -     1.8 uA
T1OSC (32KHz watch crystal) - 4.6 uA
Total < 6.5 uA

Using the internal 4MHz RC oscillator in burst mode on timer interrupts 500
uA while the burst is active.

So, if you can keep your burst duty cycle low you can have pretty reasonable
average power. For example, with 1% duty cycle your average consumption will
be under 12 uA

You can draw 12 uA out of a pretty small battery for a pretty long time.

Bob Ammerman
RAm Systems


{Original Message removed}

2004\12\15@163331 by Bob Barr

flavicon
face
On Wed, 15 Dec 2004 10:24:40 -0300, "Mauricio Jancic" wrote:

<snip>
       
>        I have no problem in loosing time, I mean, is not THAT critical,
>because the timers are designed to be used on pet feeders, so the worst case
>scenario could be that the pet will be fed x hours later. That's not a big
>deal. The main problem is that I also loose the RAM data, so that make the
>machine to stop working at all.

<snip>


Not a big deal?? Fed *hours* later??

It may not be a big deal to you, but you have obviously never met my
cat. :=)


Regards, Bob


____________________________________________

2004\12\15@223048 by Mauricio Jancic

flavicon
face
>>Not a big deal?? Fed *hours* later??
>>
>>It may not be a big deal to you, but you have obviously never
>>met my cat. :=)

Je! You might be right, its just an "acceptable" failure, but it cannot
happened every day..., by the way, it doesn't.

       In fact the machines are working really fine. The problems we have
encountered are mainly (funny):
       - people miss use: The machine is supposed to contained dry food.
One customer throw inside the machine meat and          spaghetti....
       - Installer incorrect handling: They where throwing the machines in
the back of the truck so that was actually why          the battery disconnects
and the previously set, time and programming was lost.
       - Distributors negligence: A distri thought it could be easy to copy
the machines since we where not in the same          country and we couldn't
control him. So he started to change chips and touch the circuitry... Many
burned pics... At          first we didn't know what the heck was going on,
then, when he was arrested for fraud to someone on his country,
his secretary told us the truth.
       - Rat attack!!: Yes, big rats slip inside the machines and eaten all
the wiring... Never thought of that one...
       

       The other, harder to solve, problems I had, where mainly provision
problems. I don't get here the PIC16F630 or that one I don't remember that
someone mentioned. So I used what I have in stock. Now, some things had
changed so I'm now really choosing which PIC I need and I order it. Before
that I had to see what can I do with the variety that we have in stock...
Well, that's the *funny* part...:))

Well, I'll take a look at all the proposals you people wrote. Thanks!

Mauricio Jancic
Janso Desarrollos
Microchip Consultant Program Member
(54) 11-4542-3519
infospamspam_OUTjanso.com.ar
http://www.janso.com.ar

____________________________________________

2004\12\15@232645 by Russell McMahon

face
flavicon
face
>  - Rat attack!!: Yes, big rats slip inside the machines and eaten all
> the wiring... Never thought of that one...

Your wiring must take better than the food :-)

Rats love to eat network cables, I've found.


       RM
____________________________________________

2004\12\16@035140 by Alan B. Pearce

face picon face
>Not a big deal?? Fed *hours* later??
>
>It may not be a big deal to you, but
>you have obviously never met my cat. :=)

Or mine :))
____________________________________________

2004\12\16@072418 by Mauricio Jancic

flavicon
face
>>>Not a big deal?? Fed *hours* later??
>>>
>>>It may not be a big deal to you, but
>>>you have obviously never met my cat. :=)
>>
>>Or mine :))

Actually there was 1 case...

The machine is made in < description because I don't know the English name
of it > it's a system in which you must provide a negative mold. For
example, lets make a cube. You must provide a metal box that has internally
the desired size of the object. Then, you fill the mold with the necessary
amount of this (name not known) plastic and start rotating the mold until
all the cube sides or walls are covered with the plastic. Off course, the
objects are always not filled...<end of explanation>. This plastic wall is
about 5mm thick and its very hard. A dog open it with its nails and eat all
the food in the machine...... Is your cat like that?? :>>

Mauricio Jancic
Janso Desarrollos
Microchip Consultant Program Member
(54) 11-4542-3519
@spam@infoKILLspamspamjanso.com.ar
http://www.janso.com.ar

____________________________________________

2004\12\16@074335 by Jan-Erik Soderholm

face picon face
> >Not a big deal?? Fed *hours* later??
> >
> >It may not be a big deal to you, but
> >you have obviously never met my cat. :=)
>
> Or mine :))

Never mind the pets,
what about  *me* !! :-)

Regards,
Jan-Erik.



____________________________________________

2004\12\16@082203 by Russell McMahon

face
flavicon
face
> The machine is made in < description because I don't know the English name
> of it > it's a system in which you must provide a negative mold. For
> example, lets make a cube. You must provide a metal box that has
> internally
> the desired size of the object. Then, you fill the mold with the necessary
> amount of this (name not known) plastic and start rotating the mold until
> all the cube sides or walls are covered with the plastic. Off course, the
> objects are always not filled...<end of explanation>.


Rotational moulding.
Good description.

Just wait until you see what bears can do :-)



       RM

____________________________________________

2004\12\16@085657 by Alan B. Pearce

face picon face
>Just wait until you see what bears can do :-)

heh, I've seen the photos at Yosemite. Window frames of cars peeled down so
bear can get inside at food. Soft-tops torn open - easier than opening the
window by peeling it down.

Also saw a bear while driving through some conservation wildlife park,
cannot remember just where in USA, which kept a ranger busy. It was
insistent on removing the covers over spare wheels mounted on the rear of 4
wheel drives and motorhomes. Ranger had to keep following the bear around
picking up the covers. :))

____________________________________________

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