Interrupt driven MSF Clock project problems

18 Apr 2010 . Edited: 19 Apr 2010

Hi and thanks for taking the time to read this.

I am in the process of creating an MSF clock using my nice new MBed but am experiencing some problems I can't figure out.

For those of you that don't know what MSF is please take a look at:-

http://en.wikipedia.org/wiki/Time_from_NPL

I originally wrote a clock to decode the MSF signal in assembler for a PIC Microcontroller and didn't have any problems but on the MBed I am having what appear to be stability issues decoding the signal.

My main() function only contains clock initialization code and the ISR samples the input data, checks it for errors and updates the MBed RTC if the received data contains no errors at the end of the minute.

The MSF receiver is connected to (p5) and simply outputs a TTL level indicating whether or not the radio carrier is on or off.

I realise a lot more info is required in order to help me with code specifics but my initial question is how accurate is the 100Hz interrupt likely to be given there is quite a bit of code in the ISR but should be easily executable in the time required.

The interrupts are started like this.

Ticker timer;

void timerInt() {
....

....

}

int main() {
    timer.attach(&timerInt, 0.01);
    lcdDisplay.cls();

    while (1) {
        wait (5);
    }

}

Regards

Lynton

19 Apr 2010

Hi Lynton,

It should be fine, as it is based off a hardware timer so will interrupt very regularly. You could try the following in your interrupt routine:

DigitalOut test(p6);

void timerInt() {
    test = 1;
    wait(0.001);
    test = 0;
}
and measure p6 on an oscilloscope if you want; it should all be fine!

Simon

19 Apr 2010

Hi Simon,

Thanks for the swift response :-)

In fact all my problems were down to an error in my logic so it was not an MBed issue at all.

I now have a semi-working clock that sets its time from the MSF signal and free runs if the signal fails or contains errors.

Just got to tidy up the code and iron out any remaining bugs before I publish the code if anyone is interested?

Hardware required for the clock is as follows:-

1 X MBed

1 X LCD Display (16 x 2)

1 X MSF Receiver (Eg. http://www.galleon.eu.com/OEM-Receivers-MSF.htm)

Misc parts for LCD contrast adjustment, MSF input pull up resistor etc etc.

I'm actually using a Maplin receiver module which is similar to the one above but no longer stocked by the company as far as I am aware.

Regards

 

Lynton

07 Feb 2012

Hi Lynton

I'm very much interested in this.

Any further with the MSF project yet?

I'm looking to put something together but the initial programming code would be beyond me. I tend to use chunks of other example code, spend hours modifying to put together what I want. If you have the code to read the MSF signal and convert to time/date, I would like to convert the output to display on a 4Dsystems Oled display.

I like the example here on you tube: http://www.youtube.com/watch?v=kDqbKSz20Yo

What about the DCF77, is this system different and could it be incorperated.

Ebay has several MSF and DCF77 receivers for around £8 in case you have not seen these yet.

Let me know.

Regards

Paul