Data logging RTC program
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- ADWSystems
- Posts: 57
- Joined: Sat Feb 25, 2017 10:10 pm
Data logging RTC program
I inherited a project that is using an Adafruit Data Logging shield (1141) Rev A with the DS1307. There are to be multiple setups so the new setups have Rev B shields. Is there a way to determine at runtime which RTC is in use?
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Data logging RTC program
Hmmm. might be difficult.
For the DS1307, the library has a function isRunning().
For the PCF8523, the library has a function initialized()
I suppose you could declare an object of each type, and then run the corresponding function. For example. if initialized() returns false, then assume you have a DS1307. Otherwise, assume you have a PCF8523
For the DS1307, the library has a function isRunning().
For the PCF8523, the library has a function initialized()
I suppose you could declare an object of each type, and then run the corresponding function. For example. if initialized() returns false, then assume you have a DS1307. Otherwise, assume you have a PCF8523
- ADWSystems
- Posts: 57
- Joined: Sat Feb 25, 2017 10:10 pm
Re: Data logging RTC program
So you are not aware of a unique register in each that would show the difference?
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Data logging RTC program
Well, you can double-check the datasheets, but I don't see anything that you could use for that.
http://www.nxp.com/docs/en/data-sheet/PCF8523.pdf
http://datasheets.maximintegrated.com/en/ds/DS1307.pdf
http://www.nxp.com/docs/en/data-sheet/PCF8523.pdf
http://datasheets.maximintegrated.com/en/ds/DS1307.pdf
- ADWSystems
- Posts: 57
- Joined: Sat Feb 25, 2017 10:10 pm
Re: Data logging RTC program
I did check the datasheets. I was hoping I overlooked something that someone more familiar with the chips would know about, maybe something between the lines. Guess not. Plan B is to solder a digital input pin to ground on one revision of the shield and leave the other revision alone. Likely we'll modify the older ones and leave the new revision alone. Then if one is replaced we don't have to continuous modify the shields.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Data logging RTC program
That sounds like the most sensible solution. Probably no need to mention this, but remember to set the input pin with INPUT_PULLUP.
Please be positive and constructive with your questions and comments.