Design help for RTC & Microcontroller

D

Dan Marz

Guest
I am looking for someone to work part-time on a design project or point
me in the right direction?

I have the need for a simple RTC & Microcontroller that can be
programmed to switch a low power circuit at regular times of the day on
selected days, during the year. Plus have compensation for daylight
saving time.

It will be used in remote locations, so it needs to be set
(pre-programmed) and forget.

I have looked at various pre-assembled RTC / Microcontroller boards but
these are expensive. Unit price is an issue as I need quite a few.

The design needs to be from the ground up, unless someone knows
otherwise. My weeks of searching has not come up with a practical
solution yet.

There are lots of designs for controllers of regular timer settings but
not for long periods with variables. I have a background in electronics
but not microcontroller design or programming.

If someone is interested in a bit of extra pocket money email me directly.

Otherwise any pointers is greatly appreciated?

Daniel
Northbridge NSW Australia

Direct reply to:
medcirc@tpg.com.au
 
have you got a example of the timing ?
e.g.
First Monday in each month, from 8pm to 8:15pm


"Dan Marz" <medcircDELETETHIS@tpg.com.au> wrote in message
news:3fb08033@dnews.tpgi.com.au...
I am looking for someone to work part-time on a design project or point
me in the right direction?

I have the need for a simple RTC & Microcontroller that can be
programmed to switch a low power circuit at regular times of the day on
selected days, during the year. Plus have compensation for daylight
saving time.

It will be used in remote locations, so it needs to be set
(pre-programmed) and forget.

I have looked at various pre-assembled RTC / Microcontroller boards but
these are expensive. Unit price is an issue as I need quite a few.

The design needs to be from the ground up, unless someone knows
otherwise. My weeks of searching has not come up with a practical
solution yet.

There are lots of designs for controllers of regular timer settings but
not for long periods with variables. I have a background in electronics
but not microcontroller design or programming.

If someone is interested in a bit of extra pocket money email me directly.

Otherwise any pointers is greatly appreciated?

Daniel
Northbridge NSW Australia

Direct reply to:
medcirc@tpg.com.au
 
If you are concerned about the cost then you probably can't afford to
pay someone to do this anyway, so perhaps its a good time to learn a
little about microcontrollers. This is a simple task, although there are
a few things you haven't made clear.

The RTC itself is simple to do, rather than buy a separate RTC yuo might
as well use the micro itself. There is no complex programming, so it
would be adequate to run the micro at watch crystal frequency of
32.768kHz. The lowest power micro around right now is probably the Ti
MSP430Fseries. In the sort of application you need these can probably
run at an average current of a 5-10uA.

You don't mention a power source. I assume battery. You don't mentioned
how it is programmed, I assume a simple user interface, say 4 buttons
and a small display. I would use something like an MSP430F1121, it has a
comparator for checking battery voltage, and enough I/O to talk to a
simple 8x2 or 16x2 LCD.

There are effectively three separate programs you need to write:-

The RTC including leap years, and daylight saving.
The switching task data entry a
and the switching tasks itself.

These are within the range of a novice with advice.

I don't know how many quite a few is but assuming they are manually
assembled, by yourself, or whoever takes this on, but use comemrcial
grade PCB's I would suggest that using an a small 16 x 2 display mounted
to the main PCB with buttons on the main PCB. Using Entechs prototype
service you would get about 72 PCBs for about $5.00 each. You can get
quite a lot cheaper, but Entech are usually high quality. You could
shrink the board to almost nothing, in reality, and use coloured LEDs as
the interface, but data entry might be a bit cryptic.

Components, depending on the low power switch requirements, would cost
around $10-$35 depending on what you chose to use as switches, display, etc.

Maybe 5 days work to do a really good job and test it thoroughly. For a
novice it might take a month at most.

Al

Dan Marz wrote:
I am looking for someone to work part-time on a design project or point
me in the right direction?

I have the need for a simple RTC & Microcontroller that can be
programmed to switch a low power circuit at regular times of the day on
selected days, during the year. Plus have compensation for daylight
saving time.

It will be used in remote locations, so it needs to be set
(pre-programmed) and forget.

I have looked at various pre-assembled RTC / Microcontroller boards but
these are expensive. Unit price is an issue as I need quite a few.

The design needs to be from the ground up, unless someone knows
otherwise. My weeks of searching has not come up with a practical
solution yet.

There are lots of designs for controllers of regular timer settings but
not for long periods with variables. I have a background in electronics
but not microcontroller design or programming.

If someone is interested in a bit of extra pocket money email me directly.

Otherwise any pointers is greatly appreciated?

Daniel
Northbridge NSW Australia

Direct reply to:
medcirc@tpg.com.au
--
Please remove capitalised letters to reply
My apologies for the inconvenience
Blame it on the morons that spam the net
 
onestone wrote:
If you are concerned about the cost then you probably can't afford to
pay someone to do this anyway, so perhaps its a good time to learn a
little about microcontrollers.
Thanks for the reply "onestone", I may just have to learn some new skills.

My aim is to mass produce a project with these microcontrollers at low
cost. I have a reasonable design budget and I am looking for a quick way
to get it to prototype stage. It will probably take me a month if I do
it myself.

There are plenty of options but that is my dilemma, at this point I
don't know a PIC from an AVR or 8051. I don't want to go down one path
to find I run out of code space or another path where I spend $25 a chip
when a $7 one will do the job.

A simple example is that to make 300 at $35 each the cost is $10,500 but
if they are $25 it will cost $7,500 - saving $4,000. I need several
hundred of these buggers.

You know the old saying, money talks.....

What I am hoping for is a little guidance to a chip(s) to do the job,
without having unnecessary capacity, functions or extras that will never
be used.

I guess I may have to learn some programming skills. I am a qualified
electronics engineer but I gave the game away 20 years ago to pursue a
totally different path. Now I am (sort of) back

If you are a "wiz", drop me a line.

See ya!
Daniel
medcirc@tpg.com.au
 
Code it initially in a larger chip, make sure you have everything you need,
and that it works nicely, then port to the smallest chip in the line.

If it was me, I'd use Zilog Z8 for low cost, and Atmel AVR for ease of
coding.
 
I have a simple and reliible RTC clock routine using a Brezenham algorithm,
alternatively i also have working code using a Dallas 1904 Time iButton.

For the first code, you can download it from the ftp site of Nuts and Volts
www.nutsvolts.com and it is the Sprinkler/Water Monitor published March this
year.

Yes Mr Silicon Chip, the same water cost monitor and timed sprinkler
project you rejected due to too many sprinkler projects in the past 3
years - I must have been dozing when they were published. Ah I feel so much
better now that's off my chest.

For the iButton code you'd have to email me.

You may even find tinkering with the sprinkler schedule time may do what you
want, the timer, monitor and rain detector all work independently of each
other.

I even have silk screened PCB's if you ever felt the need for that project.

The code is for a Pic 16F873 but would convert nicely into one of the
819/630 or 18F252 parts.


Colin


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.538 / Virus Database: 333 - Release Date: 10.November.2003
 
Dan Marz wrote:

I am looking for someone to work part-time on a design project or point
me in the right direction?

I have the need for a simple RTC & Microcontroller that can be
programmed to switch a low power circuit at regular times of the day on
selected days, during the year. Plus have compensation for daylight
saving time.
Dan,

If each unit only needs to switch a single valve, I recommend the
PIC16f628. Connect the serial port on the chip to any terminal type
program in any computer and you have eliminated the need for a display
or input device to the unit.

Since this is a 'set it and forget it' device. Connecting to a laptop
computer just once seems appropriate. A fairly complex setup screen can
be implemented just by sending and recieving ascii data to the computer.

--
Luhan Monat, "LuhanKnows" At 'Yahoo' dot 'Com'
http://members.cox.net/berniekm
"The future is not what it used to be."
 
Dan Marz wrote:
I am looking for someone to work part-time on a design project or point
me in the right direction?

I have the need for a simple RTC & Microcontroller that can be
programmed to switch a low power circuit at regular times of the day on
selected days, during the year. Plus have compensation for daylight
saving time.

It will be used in remote locations, so it needs to be set
(pre-programmed) and forget.

I have looked at various pre-assembled RTC / Microcontroller boards but
these are expensive. Unit price is an issue as I need quite a few.

The design needs to be from the ground up, unless someone knows
otherwise. My weeks of searching has not come up with a practical
solution yet.

There are lots of designs for controllers of regular timer settings but
not for long periods with variables. I have a background in electronics
but not microcontroller design or programming.

If someone is interested in a bit of extra pocket money email me directly.

Otherwise any pointers is greatly appreciated?

You are aware that the RTCs are not that accurate ?
Especially if the temperature varies. You might need to
synchronize there and then.
What was the required accuracy ? 1 second per year ?
1 second per month ? 1 second per day ? 1 second per hour ?

That set and forget : what timeframe did you think of ?
1 year ? 10 years ?

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net
 
Rene wrote:
You are aware that the RTCs are not that accurate ?
Especially if the temperature varies. You might need to
synchronize there and then.
What was the required accuracy ? 1 second per year ?
1 second per month ? 1 second per day ? 1 second per hour ?
Accuracy is not that important to me it just a guide. +/- a few minutes
per year is OK. Although I am going to experiment with clock accuracy by
using a 10Mhz crystal rather than the clock standard 3.3768MHz.

Here's a thought. What about an atomic clock type RF signal, maybe a GPS
timing signal. GPS antennas are tiny, then it needs an interface

The tough part though will be programming the various dates a few years
ahead. I have found some code that has a calendar which will help get me
going.

http://www.hut.fi/~jalapaav/Electronics/Pic/Clock/index.html

The good news is that there is lots of great info out there and many
posts have been very helpful. It should not be too hard to do.

Last night I built the SC Jan 2001 PIC programmer & test bed kit and now
I'm off to tricky dickies to get some more PICs and other bits. I 'm
looking forward to my learning adventure.

Any ideas on sharpening timing accuracy or programming calendars?

See ya!
Daniel
 
Rene wrote:
You are aware that the RTCs are not that accurate ?
Especially if the temperature varies. You might need to
synchronize there and then.
What was the required accuracy ? 1 second per year ?
1 second per month ? 1 second per day ? 1 second per hour ?
Accuracy is not that important to me it's just a guide. ą a few minutes
per year is OK. Although I am going to experiment with clock accuracy by
using a 10Mhz crystal rather than 3.3768 or 4MHz.

Here's a thought. What about an atomic clock type RF signal, maybe a GPS
timing signal. GPS antennas are tiny, all it would need is an interface
and code.

That bloody code! I am a novice in this area.

The tough part though will be programming the various dates a few years
ahead. I have found some code that has a calendar which will help get me
going.

http://www.hut.fi/~jalapaav/Electronics/Pic/Clock/index.html

The good news is that there is lots of great info out there and many
posts have been very helpful. It should not be too hard to do.

Last night I built the SC Jan 2001 PIC programmer & test bed kit and now
I'm off to tricky dickies to get some more PICs and other bits. I 'm
looking forward to my learning adventure.

Any ideas on sharpening timing accuracy or programming calendars?

See ya!
Daniel
 
Rene wrote:
You are aware that the RTCs are not that accurate ?
Especially if the temperature varies. You might need to
synchronize there and then.
What was the required accuracy ? 1 second per year ?
1 second per month ? 1 second per day ? 1 second per hour ?
Accuracy is not that important to me it's just a guide. ą a few minutes
per year is OK. Although I am going to experiment with clock accuracy by
using a 10Mhz crystal rather than 3.3768 or 4MHz.

Here's a thought. What about an atomic clock type RF signal, maybe a GPS
timing signal. GPS antennas are tiny, all it would need is an interface
and code.

Mmmm... that code thing again! I am a novice in that area. :(

The tough part though will be programming the various dates a few years
ahead. I have found some code that has a calendar which will help get me
going.

http://www.hut.fi/~jalapaav/Electronics/Pic/Clock/index.html

The good news is that there is lots of great info out there and many
posts have been very helpful. It should not be too hard to do.

Last night I built the SC Jan 2001 PIC programmer & test bed kit and now
I'm off to tricky dickies to get some more PICs and other bits. I 'm
looking forward to my learning adventure.

Any ideas on sharpening timing accuracy or programming calendars?

See ya!
Daniel
 
"Dan Marz" <medcircDELETETHIS@tpg.com.au> schreef in bericht
news:3fb2f54a@dnews.tpgi.com.au...
Rene wrote:
You are aware that the RTCs are not that accurate ?
Especially if the temperature varies. You might need to
synchronize there and then.
What was the required accuracy ? 1 second per year ?
1 second per month ? 1 second per day ? 1 second per hour ?

Accuracy is not that important to me it just a guide. +/- a few minutes
per year is OK. Although I am going to experiment with clock accuracy by
using a 10Mhz crystal rather than the clock standard 3.3768MHz.

Here's a thought. What about an atomic clock type RF signal, maybe a GPS
timing signal. GPS antennas are tiny, then it needs an interface

The tough part though will be programming the various dates a few years
ahead. I have found some code that has a calendar which will help get me
going.

http://www.hut.fi/~jalapaav/Electronics/Pic/Clock/index.html

The good news is that there is lots of great info out there and many
posts have been very helpful. It should not be too hard to do.

Last night I built the SC Jan 2001 PIC programmer & test bed kit and now
I'm off to tricky dickies to get some more PICs and other bits. I 'm
looking forward to my learning adventure.

Any ideas on sharpening timing accuracy or programming calendars?
The choice of crystal, 3.4Mhz, or 10Mhz, has little to do
with accuracy. It doesn't have to divide to seconds to make
an accurate clock. 5 minutes per year is not very easy, that
equals to 35mS per hour. And 5 minutes per year is an hour
in twelve years. You have to calibrate the crystal, with a
trimmer or in software. You need to be more specific about that
'set & forget'. Why is daylight saving so important? Anyway,
that is just software thing, not a real problem.

A GPS antenna is nice, but costs a bit too. Tuning into an
available RF signal is probably cheaper, if you are sure the
reception is strong enough in the final locations. Inside
buildings it doesn't work always, certainly not in cellars.

Power? The device to be switched is low power, but how about
the power for the microcontroller itself, does that need to
be low power as well, and what is low power? 5uA or 50mA?
Is it placed outside, can you use a solar panel?

You need to be a bit more specific.

--
Thanks, Frank.
(remove 'x' and 'invalid' when replying by email)
 
On Thu, 13 Nov 2003 09:03:35 +0100, "Frank Bemelman"
<fbemelx@euronet.invalid.nl> wrote:

"Dan Marz" <medcircDELETETHIS@tpg.com.au> schreef in bericht
news:3fb2f54a@dnews.tpgi.com.au...
Rene wrote:
You are aware that the RTCs are not that accurate ?
Especially if the temperature varies. You might need to
synchronize there and then.
What was the required accuracy ? 1 second per year ?
1 second per month ? 1 second per day ? 1 second per hour ?

Accuracy is not that important to me it just a guide. +/- a few minutes
per year is OK. Although I am going to experiment with clock accuracy by
using a 10Mhz crystal rather than the clock standard 3.3768MHz.

Here's a thought. What about an atomic clock type RF signal, maybe a GPS
timing signal. GPS antennas are tiny, then it needs an interface

The tough part though will be programming the various dates a few years
ahead. I have found some code that has a calendar which will help get me
going.

http://www.hut.fi/~jalapaav/Electronics/Pic/Clock/index.html

The good news is that there is lots of great info out there and many
posts have been very helpful. It should not be too hard to do.

Last night I built the SC Jan 2001 PIC programmer & test bed kit and now
I'm off to tricky dickies to get some more PICs and other bits. I 'm
looking forward to my learning adventure.

Any ideas on sharpening timing accuracy or programming calendars?
I wouldn't bother with doing the calendar yourself, there are plenty
of RTC chips out there with calendars. The Dallas DS1307 for
instance. That way it's already debugged and guaranteed working, no
need for exhaustive testing of any PIC code.
Hey - some RTC chips even have programmable alarms I think... if that
is the case then all your PIC would have to do is setup the RTC chip
and maybe do a one shot on the alarm output pin or something...
definitely worth investigating. You might even be able to get away
with just and RTC chip in your circuit - that would be neat!

For a few minutes per year over the whole temp range you'll definitely
need the DS32KHz oscillator.

GPS is expensive and overly complex, not needed in this case. Just set
your clock once and use a very low drift oscillator into a proper RTC
chip.

Regards
Dave :)
 
Just remember, unless you are mains powered faster clocks mean more
current. Ultra low current is why I prefer MSPs to PICs. Unless you care
about absolute time (for programming) it is much easier to use a 32 bit
counter as a timer. tHE MATHS BECOME QUITE SIMPLE. Either way convert
up and down to these 32 bit values using a reference base. ie I use Time
= 0 as 00:00 January 1 2000 (not a leap year) then a simple 32 bit timer
can be easily converted into date, and time. the algorithms are simple.
tables make it even simpler.

Al


Dan Marz wrote:

Rene wrote:
You are aware that the RTCs are not that accurate ?
Especially if the temperature varies. You might need to
synchronize there and then.
What was the required accuracy ? 1 second per year ?
1 second per month ? 1 second per day ? 1 second per hour ?

Accuracy is not that important to me it's just a guide. ą a few minutes
per year is OK. Although I am going to experiment with clock accuracy by
using a 10Mhz crystal rather than 3.3768 or 4MHz.

Here's a thought. What about an atomic clock type RF signal, maybe a GPS
timing signal. GPS antennas are tiny, all it would need is an interface
and code.

Mmmm... that code thing again! I am a novice in that area. :(

The tough part though will be programming the various dates a few years
ahead. I have found some code that has a calendar which will help get me
going.

http://www.hut.fi/~jalapaav/Electronics/Pic/Clock/index.html

The good news is that there is lots of great info out there and many
posts have been very helpful. It should not be too hard to do.

Last night I built the SC Jan 2001 PIC programmer & test bed kit and now
I'm off to tricky dickies to get some more PICs and other bits. I 'm
looking forward to my learning adventure.

Any ideas on sharpening timing accuracy or programming calendars?

See ya!
Daniel
--
Please remove capitalised letters to reply
My apologies for the inconvenience
Blame it on the morons that spam the net
 
I read in sci.electronics.design that onestone <onestoneXYZ@ABCbigpond.n
et.au> wrote (in <rqmub.15805$aT.15309@news-server.bigpond.net.au>)
about 'Design help for RTC & Microcontroller', on Tue, 18 Nov 2003:
I use Time
= 0 as 00:00 January 1 2000 (not a leap year)
Which planet are you on? Check your 2000 diary. Century years divisible
by 400 ARE leap years.
--
Regards, John Woodgate, OOO - Own Opinions Only. http://www.jmwa.demon.co.uk
Interested in professional sound reinforcement and distribution? Then go to
http://www.isce.org.uk
PLEASE do NOT copy news posts to me by E-MAIL!
 
In article <rqmub.15805$aT.15309@news-server.bigpond.net.au>,
onestoneXYZ@ABCbigpond.net.au says...
Just remember, unless you are mains powered faster clocks mean more
current. Ultra low current is why I prefer MSPs to PICs. Unless you care
about absolute time (for programming) it is much easier to use a 32 bit
counter as a timer. tHE MATHS BECOME QUITE SIMPLE. Either way convert
up and down to these 32 bit values using a reference base. ie I use Time
= 0 as 00:00 January 1 2000 (not a leap year) then a simple 32 bit timer
can be easily converted into date, and time. the algorithms are simple.
tables make it even simpler.
Huh??? Perhaps I haven't had my coffee yet, but 2000 *was* a leap-year.
It's divisible by 400.

--
Keith
 
John Woodgate wrote:
I read in sci.electronics.design that onestone <onestoneXYZ@ABCbigpond.n
et.au> wrote (in <rqmub.15805$aT.15309@news-server.bigpond.net.au>)
about 'Design help for RTC & Microcontroller', on Tue, 18 Nov 2003:

I use Time
= 0 as 00:00 January 1 2000 (not a leap year)


Which planet are you on? Check your 2000 diary. Century years divisible
by 400 ARE leap years.
Whoops, don't use a diary, don't need one. But forgot that centuries
aren't unless they divide by 400. Silly me. Oh well 1 day every 4
centuries is pretty accurate ;@}

Al
 
Keith R. Williams wrote:

In article <rqmub.15805$aT.15309@news-server.bigpond.net.au>,
onestoneXYZ@ABCbigpond.net.au says...

Just remember, unless you are mains powered faster clocks mean more
current. Ultra low current is why I prefer MSPs to PICs. Unless you care
about absolute time (for programming) it is much easier to use a 32 bit
counter as a timer. tHE MATHS BECOME QUITE SIMPLE. Either way convert
up and down to these 32 bit values using a reference base. ie I use Time
= 0 as 00:00 January 1 2000 (not a leap year) then a simple 32 bit timer
can be easily converted into date, and time. the algorithms are simple.
tables make it even simpler.


Huh??? Perhaps I haven't had my coffee yet, but 2000 *was* a leap-year.
It's divisible by 400.
I was lacking the caffiene it seems. Brain totally disengaged.
 
I did a nice little project with an Atmel AVR. Then they discontinued
the line (other then the maga- parts). Creeps.

"Dave VanHorn" <dvanhorn@cedar.net> wrote in message news:<9d2dnbrpE9Y5ICyiRVn-sQ@comcast.com>...
Code it initially in a larger chip, make sure you have everything you need,
and that it works nicely, then port to the smallest chip in the line.

If it was me, I'd use Zilog Z8 for low cost, and Atmel AVR for ease of
coding.
 
good advice, you can use a terminal emulator with a palm pilot or
handspring so that gets really simple to lug around.

Paul

Luhan Monat .

Dan,

If each unit only needs to switch a single valve, I recommend the
PIC16f628. Connect the serial port on the chip to any terminal type
program in any computer and you have eliminated the need for a display
or input device to the unit.

Since this is a 'set it and forget it' device. Connecting to a laptop
computer just once seems appropriate. A fairly complex setup screen can
be implemented just by sending and recieving ascii data to the computer.
 

Welcome to EDABoard.com

Sponsor

Back
Top