Post Go back to editing

DS1308 OSF question

Category: Datasheet/Specs
Product Number: DS1308U-18+

Dear Sir,

We have a question for DS1308 OSF function. The discretion of OSF function is may cause OSF bit to set when first time power up.

Now after we first power up, some model read back OSF bit is 1 and some are 0.  Might i know the OSF triggering conditions when power up or we need set the OSF bit to 0 after first power up? 

  • My reading of the data sheet says that you should expect OSF to be set at the first power on, and thus you should always clear it after the first power on, before initializing the date and time. I have no idea what might cause it not to be set at first power on, but it may be dependent on how quickly the crystal starts up (which depends on the particular crystal, the particular DS1308, the temperature, and the voltage ramp rate). In any case, I would not worry about it, just always clear it as part of the initialization routine. 

    If you rely on this function, and want to verify that it will be set (if the battery is drained or removed, for example), then I would build in a test that verifies OSF is clear, then stops the oscillator by setting CH, waits for a bit, then clears CH, waits for a bit to allow the oscillator to restart, then verifies OSF is set. (Then clear OSF and continue). The data sheet indicates the oscillator may take up to one second to start, so I would use 1.5 to 2 seconds as the second "wait for a bit" time. The oscillator should stop very quickly, so the first wait time might only need to be a hundred milliseconds or so. That will help reduce the test time.

    If you are still concerned that you might not detect a failed battery, then I would put a checksum over all or part of the SRAM, and verify that at every power up. If the battery has failed or been removed, the SRAM contents will be garbage and the checksum will fail. This is verifying the integrity of the SRAM, which might be your real concern.