Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 9th January 2008, 07:22 AM   (permalink)
Default

I'm not trying to make it a stopwatch. Once I set it, I'm probably setting it for good. Using it as a timestamp.
ssylee is offline  
Reply With Quote
Old 9th January 2008, 07:23 AM   (permalink)
Default

Then set the seconds last, you can't simple turn a bit on. You have to write the whole byte.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Reply With Quote
Old 9th January 2008, 07:36 AM   (permalink)
Default

Isn't the best way to use burst mode then the registers all get updated at the same time - once the 8th register is written.

Or, write the seconds first. As long as the value written is not 59 then there is no chance of the minutes/hours etc. rolling over during the update.

Mike.
Pommie is offline  
Reply With Quote
Old 9th January 2008, 07:39 AM   (permalink)
Default

The burst mode is the way to go, since SPI is very fast you can update the RTC in a fraction of a second.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is online now  
Reply With Quote
Old 9th January 2008, 08:18 AM   (permalink)
Default

How much faster would the burst mode be compared to accessing the register contents one at a time?
ssylee is offline  
Reply With Quote
Old 9th January 2008, 08:44 AM   (permalink)
Default

It's not that it is faster. Burst mode has the advantage that none of the registers are written until you write the eight one, therefore ensuring that a register can't rollover during the update.

Alternatively, writing the seconds register first with a value other than 0x59 will make sure that rollover can't happen during the update.

Mike.
Pommie is offline  
Reply With Quote
Old 9th January 2008, 08:53 AM   (permalink)
Default

hi,
I downloaded the attached asm file from the web yesterday.
Recently got a couple of DS1307's, used the asm file as a quick test with a 16F628A, worked OK.

Time set/read is via RS232.

I will re-search the web so I can credit the author..

EDIT:
The full description is here:
http://pdfserv.maxim-ic.com/en/an/AN3921.pdf
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 7th July 2008 at 11:23 AM.
ericgibbs is online now  
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Real Time FLIR Video Feed digital0ne Robotics Chat 3 11th April 2004 06:21 PM
digital clock setting the time mode Jay Duluguin Electronic Projects Design/Ideas/Reviews 0 19th February 2004 10:09 PM
real time clock finst Micro Controllers 4 17th January 2004 12:11 AM
list of Real Time Clock thendo Micro Controllers 2 8th November 2003 05:41 PM
time clock gogo01 Electronic Projects Design/Ideas/Reviews 2 22nd August 2003 05:05 AM



All times are GMT. The time now is 06:37 PM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.