Real Time Clock Code (RTC) for PIC family

few mA,

That isn't a bare metal LCD display. The right chipset can do it with a current draw that is not much different to the self discharge rate of the battery. I have done it with a PIC and about 15uA for a 4 digit display (including the current for the CPU itself).

The Hitachi controllers are easy to use but not energy efficient. You are into bespoke LCD controller territory for low current work. Though a PIC can be made to drive simple LCD displays directly.

Ultra low power displays with many switchable sites requires ePaper technology with no need to periodically refresh the chroma sites. Power there is only needed to switch colour state.

Regards, Martin Brown

Reply to
Martin Brown
Loading thread data ...

few mA,

Yeah, down in the uA range, depending on size, operating voltage, type etc., which might be less than the self-discharge of a smallish battery.

JP's probably thinking of an alphanumeric LCD module (like those based on the HD44780 type of controller chip), which indeed uses a mA or more, rather than the 'bare glass' type of LCD (plus current in the bias network, plus a lot more for the backlight, if present).

Reply to
Spehro Pefhany

There are many PICs with easy-to-use, low-power, built-in LCD drivers.

--
John W. Temples, III
Reply to
John Temples

It's pretty simple to control _some_ 'bare glass' with _some_ PICs.. especially the ones with built-in LCD controllers (static to quad-plexed). Set up the hardware and it runs, you just have to flip bits for segments on/off. Not enough segments for dot matrix displays, but plenty for segment displays plus some annunciators.

Reply to
Spehro Pefhany

A reasonable approximation to "uses no power" is a device that runs on one set of batteries for roughly as long as the stated shelf life of those batteries. LCD-based wrist watches and alarm clocks routinely manage that. TV remotes and pocket calculators often come close.

Reply to
=?ISO-8859-1?Q?Hans-Bernhard_B

The way I'd do it, would be to use a reliable, reasonably-close-to- a-known-frequency oscillator (an off-the-shelf quartz crystal type) as a short-term internal time base, which was then frequency- locked to the power-line input via a periodic sampling (e.g. 60 HZ) via a microcontroller of some sort. Don't use the actual zero-crossing events of the powerline... as you point out, this would be vulnerable to false triggering due to line noise. Instead, implement a software PLL, with a suitable averaging loop time.

This technique has an additional benefit. If you run the micro and oscillator from a battery-backed-up power supply, and add a bit of "smarts" to the software, you can automatically disable the PLL tracking whenever the 60 Hz signal goes away, and just do your time-counting based on the current pulse-count rate of the internal oscillator.

In effect, you would have a "line-frequency-standard disciplined" quartz crystal oscillator, rather than trying to use the line frequency directly as a timing source.

A similar technique is used in the VE2ZAZ frequency standard (and, no doubt, numerous others) which use the slow and jitter-prone "pulse per second" output from a good GPS receiver to discipline a quartz- crystal oscillator. By using an averaging period of an hour or two, you can get *very* close to an exact 10.00000000 MHz signal... and the firmware in the controller will automatically reject any timing samples which further from this rate than a margin you select due to noise or jitter or hardware glitches.

--
Dave Platt                                    AE6EO
Friends of Jade Warrior home page:  http://www.radagast.org/jade-warrior
  I do _not_ wish to receive unsolicited commercial email, and I will
     boycott any company which has the gall to send me such ads!
Reply to
Dave Platt

On a sunny day (Wed, 17 Nov 2010 11:23:25 -0800) it happened Tim Wescott wrote in :

real life.

few mA,

The subject was PIC, and making LCD scan signals with PIC is not so simple. No body in his sane mind will do that, everybody uses a LCD module with some ASICs on it.

Reply to
Jan Panteltje

On a sunny day (Wed, 17 Nov 2010 18:50:04 +0000) it happened John Devereux wrote in :

I have used 50 Hz from the mains in Europe in a dark room timer in the seventies. It needed a bit of lowpass to get rid of the spikes on teh mains, but was very accurate. Later it was modified and used as a slide show timer...

Later I made an other one for a big art project.

Reply to
Jan Panteltje

On a sunny day (Wed, 17 Nov 2010 16:16:45 -0500) it happened Spehro Pefhany wrote in :

few mA,

Yes, Ok sorry to all, I did not know there were PICs with a LCD scanning module build in. I would like to hear what the OP wants, backlight? For many applications backlight is a must.

Reply to
Jan Panteltje

Really? Watch batteries last me about a year.

TV remotes and pocket calculators often come close.

TV remote batteries last a few months, far short of the three to four year, 'Use By date' on the labels. I normally use solar power calculators, or the one built into every computer I have.

--
For the last time:  I am not a mad scientist!  I m just a very ticked
off scientist!!!
Reply to
Michael A. Terrell

60 or
n
t

of

It can be simpler and more reliable to just have your own 60Hz* timer (or more precisely, a reasonable multiple of that from which you can derive the 60Hz signal), and then use what you pull off the mains to correct for drift. That makes it easy to deal with various sorts of missed zero crossings (since you know where it's supposed to be, plus or minus a percent or two), and, as you mentioned, you can use that same internal timer to filter much of the noise that you can see between the zero crossings. It also leads to a setup where you can run a device without depending on the mains (obviously practical only if there's another power source), but you might get a bit of time drift while the power is out. I believe that's what the "better" line powered alarm clocks (the one's with a backup battery) do, and at least the clock is powered by the battery, even if the display is not.

*60Hz chauvinism not to be taken too seriously
Reply to
robertwessel2

I've got a credit-card sized calculator that has no battery at all - just a little puny PV cell about 1/4" X 3/4". The calc. doesn't even have an "off" button - all you do is slide it into its handy little leatherette case. ;-)

Heh - I just checked, and I still have my Casio Fx-115v calculator

formatting link
and it's fully PV-powered. :-)

Cheers! Rich

  • PV == photovoltaic
Reply to
Rich Grise

ny

used a few mA,

le

k

Jan:

My initial concern is to not worry about backlight. Thank you for your postings - I will study these further.

On the backlighting topic, I am quite curious to test the pulsed performance of using a white LED with a CR2032 cell. I have connected a CR2032 directly to a white LED directly (yes, directly - relying on the internal resistance of the CR2032), and it remained illuminated for almost a week!

TomC

Reply to
tomcee

Some larger pinout PICs drive mux'd LCDs direct.

Easier to drive the LCD modules with HD44780 (?) Hitachi 4|8 bit interface.

Or, you could drive 4 digit LCD via a latch/decoder/driver, the one with single backplane (no mux) need too many I/O lines (one per segment) for direct control, unless you dedicate a 40 pin (or more) PIC to the task, depends what you want.

Direct LCD drive is easy, low frequency AC drive to backplane, out-of-phase drive to turn on segments, in-phase drive to turn off segments. Keep net DC across way down as DC may 'burn in' segments.

I think OP wants a PIC with second 32768 crystal osc. option, if the Microchip app note is one I'm thinking of, it's only a vague guide to what needed.

Running RTC from that second osc is easy, what it's designed for. There's a 16bit counter hangs off that osc, just set the thing to interrupt (and perhaps power up too from standby) each msb rollover and run the RTC divider chain in software. I think the guide's interrupt code is usable, but there's more needed in the RTC divider chain? Haven't looked at it for months.

As Jan said, then you need clock setting from somewhere, serial port or some pushbuttons. Or a GPS rx if that's what you really want :)

PICkit2 with the 28pin demo card comes with the 32kHz xtal option, it's what I used to make RTC with 2 or 4 line LCD module. 28pin PIC: PIC16F886, 40pin PIC16F887 could be taught to drive 7seg LCD direct, lots of others too, these I use because of the 28pin demo board to PICkit2 makes it easy to program.

Grant.

Reply to
Grant

A lot of the newer alarm clocks use a WWVB 60KHz receiver to keep the clock time accurate. They have a backup supply to handle short power outages and recalibrate themselves at regular intervals.

What is your definition of "jitter-prone" for the GPS 1PPS output? I've used a number of inexpensive OEM modules that quote sync to UTC within +/-60nS.

For a battery-powered system, the 50 to 75mA drain of a GPS chip might be excessive if it was left on all the time. However, I suppose you could turn on the GPS for a few minutes an hour to recalibrate the local crystal oscillator. How often you would need to turn on the GPS depends a lot on the rate of temperature change the clock will experience.

My wristwatch turns on an internal 60KHZ WWBV receiver every night to check the time and correct the internal clock. Digikey has similar time code recievers for about four bucks. I don't know what they require in support components, but I think it will be cheaper than the VE2ZAZ standard---which apparently costs up to $200, depending on what you have in your junk box.

formatting link

After all, this is to develop a people-readable clock--- not a stable 10MHZ oscillator for RF usage.

Mark Borgerson

Reply to
Mark Borgerson

in real life.

few mA,

It isn't trivial, but it isn't all that difficult either. Provided that you only want to drive a single 4 digit display or less most 40 pin PICs have enough IO pins. The rest is just a SMOP.

ASICs on it.

Oh no they don't! Bare metal is cheaper and much much lower power.

Regards, Martin Brown

Reply to
Martin Brown

They have obviously moved on a bit since I last used one in 2001. Which modern ones do you recommend for a 4 and 6 digit display?

I had a look on Microchip but didn't spot anything obvious about direct drive of LCD functionality. But I did spot an RTC implementation:

formatting link

(which may interest the OP)

It was for an amateur astronomer friend who wanted a sidereal clock that did not need to be accompanied everywhere by a car battery.

formatting link

Mine will run for years on a pair of AA cells drawing just 15uA. Trimming is all done in software. Obviously no crystal oven!

These days you can get an iPhone app to do the same job for pennies.

Regards, Martin Brown

Reply to
Martin Brown

On a sunny day (Thu, 18 Nov 2010 08:15:00 +0000) it happened Martin Brown wrote in :

in real life.

a few mA,

Yes, well I was talking for myself I guess, I like the DIL PICs, so > 40 pins would likely be a no go. But also to avoid DC you need a very precise drive wave I think. I do not know how much a few uS asymmetry would work out on the LCD in the long term in the form of DC.

ASICs on it.

Yes my apologies for that remark, I did not know PICs exists with build in LCD drive hardware.

Reply to
Jan Panteltje

On a sunny day (Wed, 17 Nov 2010 16:03:46 -0800 (PST)) it happened tomcee wrote in :

Modern LEDs are very efficient, and will still light up visibly with only a few uA. I have a couple of CR2430 3V cells on the desk that I sometimes use as LED tester in the same way :-) Those cells are now many years old (>5?). But the text LCD modules usually need a quite a few mA. The one I am just designing in uses green LEDs, 2 x 16 char, is specified at max 630 mA peak in pulse mode, and 100 cd/m^2 at 130 mA DC. But you can get away with much lower current in absolute dark. Add a backlight switch' perhaps.

Reply to
Jan Panteltje

On a sunny day (Wed, 17 Nov 2010 15:35:57 -0800 (PST)) it happened " snipped-for-privacy@yahoo.com" wrote in :

IIRC in some Olympic games, I think it was fencing, they used timers from Europe brought to the US. The timers were running fast. They had to go back to the stopwatches.

Reply to
Jan Panteltje

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.