Send real time to picaxe upon loading it

frank2644

Member
Is there a way to send the time of day to the picaxe when you load it? Ideally this would be automatic rather than have the picaxe prompt you to enter it. Once loaded I think I can figure out how to make the picaxe keep the time updated.

Not sure it makes a difference but I have a 20x2 chip.

Thanks,
 

techElder

Well-known member
You have to use an external "real time clock" chip. Search the forum. There are thousands of references for that.
 

eggdweather

Senior Member
I'm using the DS3221 which can read with the same routines as the DS1307 but it remains in-time by just a few ppm, it says 5ppm and can be set by the user to be even more accurate with a register setting. If it tends to be fast or slow there is a compensating register that is used to correct the gains or losses.
 

frank2644

Member
Even with an external real time clock chip don't you still have to set the time of day somehow?

Anyway, I really don't want to add another IC, isn't there a simple way to send the time of day when you load the picaxe?

Today I manually change the hours and minutes variable in my source code just prior to loading the Picaxe. Isn't there a way to do this automatically?
 

Buzby

Senior Member
There are plenty ways to set the time automatically, it really just depends where the time is coming from.

You could send it in serially from a PC, but that means you need a PC every time you power up.

You could I2C it from a GPS chip, but that's a bit overkill, and needs a chip.

You could use a DS3221, dead easy, but needs the chip.

Where do you intend getting the time from ?
 

srnet

Senior Member
Anyway, I really don't want to add another IC, isn't there a simple way to send the time of day when you load the picaxe?
Never heard of a way, simple or difficult, within the PICAXE program load environment.

An X2 can only run on the internal oscillator, which is unlikly to be accurate or stable enough for timekeeping purposes.

So its not surprising that for real time clock applications the standard practice is to use a RTC IC.
 

bpowell

Senior Member
Looks like Marks suggestion above will work for you...the current date/time is pulled by the pre-processor, and pushed to the chip at download. You'll lose the time if the chip power cycles...but otherwise, you should be good.
 

frank2644

Member
Thank you Marks. That looks like exactly what I needed. I played with the "ppp_datetime" parameter and I am very encouraged.

I know the 20x2 timing is not very accurate, but good enough for my purposes.

Great forum, very helpful.

Thanks to everyone.
 
Top