Hippy,
The Oregon Scientific clock MSF receiver has three inputs - 0V, V+, PON (hold low to enable, high to effectively go to standby) amd one output - the MSF signal as a pulse train of '0's and '1's
I did a bit of debugging in-situ on my clock - I also have no scope, so its a bit difficult. When the clock is turned on, PON is low and the MSF output is showing signs of being an irregular pulse train. Coincidentally with the clock showing that the MSF time has been captured (2-3 minutes), PON goes high and the MSF output is permanently low (or high maybe - I can't remember!)
I presume that periodically (once a hour, once a day maybe) the clock part sets PON low again and re-captures the time, turning PON high when it has done so. I expect I could find the period fairly easily if I wanted - but in the URL I mention, PON is permanently low, so the MSF output is always active. Looking at the specs, the standby current (ie PON high) is very very low, as opposed to the active current which is very low. I think the Mk1 version will have PON permanently low!
As for decoding MSF, my current idea is to have a 50ms repeating interrupt, with the interrupt code examining MSF and trying to derive where we are in the one-minute cycle. e.g. 10 highs in a row and we are at the start of a minute. I need to draw some timing diagrams to see the effect of the interrupt not being synchronised with the MSF pulse transition points - maybe I need a (much) higher speed interrupt initially to determine any transition point and then set up the 50ms interrupt so that it occurs in the 'middle' of the spec'ed MSF periods (if you see what I mean). Might be a bit of experimentation here (and headaches!) - and a scope is almost certainly required to see when the interrupt is occurring wrt the MSF pulses and any drifting that occurs.
Further thoughts? - I'm sure it can be done (my £9.99 clock can do it!) but I'm a bit worried that the PICAXE might be too slow to do all this...
There's still other problems to be solved:
- actually displaying the time. I want to use 7-segment LEDs and want minimal component count, so the PICAXE also needs to be doing a mutiplexing loop at the same time
....I have an idea floating around my mind that I should use two PICAXEs and interface them via a DS1307 ie one decodes the MSF and sets the time into the DS, the other reads the time from the DS and multiplexes it onto the display - I would need some sort of circuitry to make sure that both PICAXEs aren't the master on the i2c bus at the same time - do you think there is a technical solution to that?
- setting the time manually when there is no MSF signal/it's too corrupt to be decoded etc etc
Soory about teh victorian novel - it is helping me clarify my thoughts try to write it down!
PS am off in a few hours for a long weekend break with no Internet access, so won't be around for 4-5 days, but I'd appreciate your thoughts...