Decoding UK's NPL MSF Time Signal

hippy

Ex-Staff (retired)
Thanks BenieBots. I particularly liked, "After twenty weeks working on the project, satisfactory work has been done". Should have used a PICAXE; three days :)

Having moved up to an 18X, I've now got it parity checking and reporting GMT/BST. I did try optimising the 08M version but just cannot get enough space for either.

If it's going to be used at the heart of something which needs to keep accurate time then it makes sense to spend the little extra to go to an 18X, but I do have an idea for a dual 08M system which should be able to handle parity checking and also fill in missing time codes.
 

hippy

Ex-Staff (retired)
1) If anyone else gets the same Acctim clock as eclectic and myself, the MSF receiver can be removed without dismantling the clock leaving it fully functional except without radio control -- Check it works first. Then remove battery. Turn it so the T-shaped MSF receiver is at the top, battery at bottom. Remove the screw just to left of centre in the T. Gently pull the MSF receiver away from the clock. When detached from main module, move up and down tangential to the clock ( as per how it was released ). This should cause the ribbon cable to eventually snap where it connects to the main controller. If it snaps inside the receiver that's not the end of the world.

2) Key to including parity checking in the 08M software is minimising human readable SERTXD output. I have a version now which includes parity, human readable debugging info plus time, and a serial feed to another PICAXE which gets synchronised every minute. I'll publish some code later on.

3) Have a two 08M solution working which gives out a human readable SERTXD output showing time every second. Based on PAUSE so needs tuning for accurate seconds counting but is accurate every minute ( within a second with constant offset error ).

4) @ eclectic : Did you have any joy in getting my code to work with your hardware ?
 

eclectic

Moderator
1)
cut

4) @ eclectic : Did you have any joy in getting my code to work with your hardware ?
My bad manners for not replying earlier. :-(

I changed the module's outputs to gnd / RF (as your earlier circuit).
Direct input to Picaxe.
Power supply 2.4v - 3.0 v, (2 x AA NiMh or alkaline)

Works perfectly for hours at a time.

e
 

eclectic

Moderator
0 = Sunday
1 = Monday
2 = Tuesday ...

Or have I misinterpreted your query ?
Not at all.
I garbled the question. :-(
It should have said something like:-

If this display is read by non-binary readers, then
day 0
should be read as Sunday.

e
 

hippy

Ex-Staff (retired)
You're right - One always has to be on-guard for whether data is base zero or base one and, as with MSF, there's often a mix; why not use 1 to 7 for day of week, or conversly why not use 0 to 11 for month, 0 to 27/28/29/30 for day for consistency ?

Even more inexplicable is how the DUT1 bits are held; why not three bits for Nx100ms deifferences and another bit for sign ? And why isn't there a parity bit per data field or even 'per digit' ? Where's the 32-bit 'epoch time' which would be very useful these days, plenty of spare A and B-bits ?

Most specifications are arbitrary to start with, or the rational reasoning for seemingly peculiar choices are lost to history. Once established, there's a reluctance to change anything in case it breaks existing product even if it's the product's fault it becomes broken.
 

slurp

Senior Member
I'm tempted to get a clock from Argos to play with this.... I don't think I've got a pratical application.

There are some interesting items for consideration in the application on www.npl.co.uk/time under the MSf link. It may be worth thinking about what you do with the time calculated and how your application deals with signal outages:-

12 March 2009 from 10:00 UTC to 14:00 UTC
11 June 2009 from 10:00 BST to 14:00 BST
10 September 2009 from 10:00 BST to 14:00 BST
10 December 2009 from 10:00 UTC to 14:00 UTC

plus a two day period in July or August.

I guess this is where the clock becomre more complicated, with a periodic update of a Real Time Clock allow continued indication of time when the signal is loss.

Best regards,
Colin
 

hippy

Ex-Staff (retired)
Welcome to the "PICAXE MSF Club" - Stick a label on it saying "Atomic clock" and impress your friends. Cross that out and write "Radio Controlled" if taking through security gates :)

Planned outages shouldn't be any different to normal loss of signal, transmitter power failure, bad atmospherics, the delivery truck blocking the signal, but it is necessary to decide what to do when the signal isn't present.

A regeneration system which fills in "missing time" is necessary for a useful clock but even that needs some thought as to algorithm, especially if there's an alarm function; you don't want it jumping to correct time if that skips the time the alarm is set for. You can speed up and slow down the regenerator to bring it into synch but that gets more complicated and if an alarm sounds for 30 seconds you don't want to shorten that alarm if the seconds come flying in, plus you will probably still want an instant jump when switching between GMT/BST and back. Alarms which can be set in the BST/GMT fall-back would need special handling.

Even if jumping to what actual time is every minute, how to handle the filled in seconds is an interesting challenge; synch to MSF second ticks ( which may be missing or be too many if the signal is noisy ), generate them by pause etc but what when they run too slow or too fast; missed seconds or repeated times which jump backwards. Errors and any jumps will get bigger as the signal is missing for longer periods.

It's quite a challenging problem. One advantage of the low PICAXE price is that it can be modularised with multiple PICAXE's; receiver/decoder, a seconds tick regenerator synched to the receiver, a current time keeper plus an alarm handler.
 

manuka

Senior Member
For mere mortals who (like myself down here in the South Seas) reside well beyond European MSF coverage, some solace may be gained from learning about other time & frequency stations, especially on Short Wave (SW). See => http://www.cl.cam.ac.uk/~mgk25/time/lf-clocks/ & => http://www.ac6v.com/standard.htm

Best known are surely pre WW2 vintage (& hence well before "decent" watches or GPS),WWV (Colorado-male) & WWVH (Hawaii-female), giving Pacific wide coverage on 2.5,5,10 & 15 MHz. I well recall using WWV ~1966 to synchronise watches for a car rally, when in an isolated mountainous NZ region beyond hourly MW time pips. Wide blue yonder yachts still swear by them as a navigation backstop too, since almost any simple SW radio can receive them. Aside from SW "noise " & varying band conditions, their main limit relates to 10s of millisec wireless propagation delays, arising both from ionospheric bouncing & the finite speed of EM waves.

WWV's ~90 year long history makes ripping reading => http://tf.nist.gov/stations/wwvhistory.htm

Of course,keep your eye on Digital Radio Mondiale (DRM) developments=> http://en.wikipedia.org/wiki/Digital_Radio_Mondiale
 

abcd1234

New Member
I'm using an MSF module from HKW Elektronik connected to a 28X project board, but I can't get either Greypower or Hippy's code to work.

If I power the MSF module on its own, a measurable signal is produced. It seems to vary between 0.1v and 3.4v. I'm measuring this with a cheap multimeter as I don't have a 'scope.

If I connect the MSF module to the 28X board - taking power from the 28X, and connecting the signal line from the MSF directly to a digital input pin, then the signal fixes to a steady 5.1v, which is Vcc.

I think I have a circuit problem here, but I'm not smart enough to know what it is or how to fix it. Any suggestions would be welcome. Do I need to invert the signal (with a transisitor); or perhaps insert a diode or a pull-down resistor?
 

hippy

Ex-Staff (retired)
This is where "this + this + this = works" knowledge comes in very handy and why I launched into my project knowing that eclectic had success with a particular module and chose exactly the same.

The HKW Elektronik modules are a complete unknown for me so I cannot really give much advice. Firstly, are you sure ( being a German company ) they are MSF and not tuned for some other signal ?

Beyond that it's going to be a matter of looking for a datasheet, looking at the signals on a scope, finding similar projects which have used the same module, or trying to second guess what it is putting out and how to interface that to a PICAXE.

Determining the interface without a circuit is always a challenge. I made a guess using my diode and pull-up R interface that there wouldn't be enough current from 5V into its output to cause damage and using it in an 'open collector' configuration it should pull the PICAXE input down, and luckily it seems to have worked.

For people with MSF working; clocks go forward this Sunday morning, so there's some exciting 'numbers' to watch for if you have nothing better to do :)
 

abcd1234

New Member
MSF Round-Up

Thanks for the replies Hippy and Eclectic. As you say a little knowledge comes in very handy. Unfortunately most of mine is borrowed at present.

If you want to buy a time signal decoding module (rather than rip one out of a clock or build one from scratch) and you live in the UK there are three sources currently available:

  • Galleon: A UK company who will give you a free sample if you are a student, or charge an arm and a leg for a single unit if you are not. They do offer quantity discounts
  • C-Max: a US manufacturer with no UK distributor so you have to go through the hassle of importing, which puts the price up
  • HKW: a German manufacturer that makes modules for each of the world's atomic/radio clocks. They are happy to sell single units and there's no import hassle as they are in the EU. Purchasing is a little bizzare, but prices are reasonable even with the present GBP/Euro rate. Galleon distributes the HKW product
  • Maplin used to distribute the HKW product but no longer do so
The modules that I have are the EM2 MSF receiver and the 100mm 60Hz aerial. This module produces a non-inverted signal. I bought two receivers and two aerials for just under 40 Euros including VAT and shipping. The receiver works at 3v to 12v, which is convenient.

Initially when I couldn't get the receiver and code working I thought I had either blown it with static or fried it with the soldering iron (I was careful, but not overly so). However, there's several references to the module on the interweb and nowhere is it described as sensitive.

I have now built a bare-bones circuit round an 08M - the chip, three resistors, a 3.5mm jack, some wires and the MSF receiver. I'm pleased to say that this works perfectly with Hippy's original code. The root cause, so far as I can tell, of my problem is that the 28X project boards have a built in pull-down resistor and the signal from the MSF module needs a pull-up resistor. I may try to invert the signal to see if this will work with the 28X board. I'll have to scrounge some more knowledge on how to do this. Earlier in this thread someone (Hippy?) mentioned using a BC548 transistor and a couple of resistors. If I understood correctly, the suggestion is that the receiver should be connected to the base of the transistor via a 100k resistor; the emitter goes to ground, and the collector connects to an input on the PIC via a 2k7 resistor. Warning: I could be way off here.

If anyone is interested, I have the whole assembly (on a bread board) lying on my desk next to my keyboard and monitor, and maybe two-feet from my PC. The aerial is oriented East-West, at right angles to the signal (I'm pretty much due North of Cumbria). Looking at the sample number, the code seems to decode the signal first time every time. Finally, I don't know if it was mentioned earlier in the thread, but Hippy's code outputs Binary Coded Decimal (BCD), and it took me a few minutes to remember how to translate back into normal decimal - it's been over 25 years since I last came across BCD.
 

hippy

Ex-Staff (retired)
Welcome to the PICAXE MSF owner's club !

Glad to see you got it working. Given that decoding MSF requires a PICAXE to be spending almost all of its time sampling the signal and it will take an average of one and a half minutes to get a reading, this is one of those cases where a dedicated 08M doing that and passing the time out to another PICAXE does make sense.

I'm doing that in my project ( alarm clock ) so the main PICAXE can be working while the MSF decoder does its thing. The entire 08M+MSF part is powered via a PICAXE output pin so it can all be turned off to conserve power.

On the subject of interfacing, if you can successfully read the signal into the PICAXE that's it, job done. In some cases it may be necessary to invert the signal but that can be just as easily done in software as in hardware. If it's battling against pull-ups or pull-downs then some hardware drive like a transistor may be needed. Driving the 28X board from an 08M output should overcome whatever pull-up or pull-downs there might be there.

As to the BCD nature of the data, that's how it comes from the transmitter and I just grab the bits in sequence and package them up into more convenient sized chunks which happen to be the separate parts of the time.
 

abcd1234

New Member
A 28X project board should probably be overkill for the project I have in mind. I only want to display hours and minutes, so I will dump some of the decode code and hope to make space for the display code. If not an 18X chip may be the answer.

I'll let you know how I get on
 

Mike yeulett

New Member
MSF decoder and driver

Hi i want to build a clock based on the MSF 60Khz signal as part of my daughters school project. We have built the receiver that works fine. Can some one give me a circuit and code if necessary for decoding the MSF code and driving six seven segment displays (hours,mins, secs). Thanks Mike
 

eclectic

Moderator
Hi i want to build a clock based on the MSF 60Khz signal as part of my daughters school project. We have built the receiver that works fine. Can some one give me a circuit and code if necessary for decoding the MSF code and driving six seven segment displays (hours,mins, secs). Thanks Mike
Welcome to the Forum, and the
(nearly) MSF owner's club! :)

Can you please provide some more details of your receiver?
(schematic and photo's if possible).

The basics for connection can probably be cobbled together
from some of the earlier posts in this thread.

The seven-segment display is discussed in Manual 3
See "PICAXE Manual" above.

e
 

Mike yeulett

New Member
MSF decoding

Hi

we are using the galleon receiver with their ferrite antenna. We have buffered the output and driving a LED at the moment. It seems to wotk fine.
 

eclectic

Moderator
I'm sorry, but I'm getting lost here. :)

Quotes
“Will the Rewbichron 2 work with the code transmitted today ?
Mike”

And
“Hi we are using the galleon receiver with their ferrite antenna. We have buffered the output and driving a LED at the moment. It seems to wotk fine."


Can you provide some further information / links / datasheets
as to the circuit and output format please?

e
 

Dippy

Moderator
".. as part of my daughters school project."
and
"Can some one give me a circuit and code if necessary for decoding the MSF code and driving six seven segment displays (hours,mins, secs)."

Mike, I don't mean to sound like a MOG, but please note that this isn't a do-my-homework Forum.

You seem to want a complete solution. What will you be doing towards it?

People will happily give hints, tips amd pointers.

I sincerely hope eclectic (and others maybe) will get some marks if he does ALL the work for you :)
 

Mike yeulett

New Member
Thanks for your response.
Worth clarifying what we have done to date. We have built the Galleon EM2S MSF receiver. We have buffered the output and have a LED showing the code being received. This appears to work very well.We have built a REWBICHRON 2 decoder but we cannot get it to decode the code. We are not sure if the inability to decode the code is the REWBICHRON or noise on the received signal. As this is a old design we also wonder if the code of the transmission has changed since the design. We have built the power unit and the display circuritry so we have a lot of the work done.

We are expoloring if there is a better modern solution for decoding the code.

I'm sorry, but I'm getting lost here. :)

Quotes
“Will the Rewbichron 2 work with the code transmitted today ?
Mike”

And
“Hi we are using the galleon receiver with their ferrite antenna. We have buffered the output and driving a LED at the moment. It seems to wotk fine."


Can you provide some further information / links / datasheets
as to the circuit and output format please?

e
 

Mike yeulett

New Member
Yes you are being a MOG. We are simply seeing if someone can assist us. We dont expect you to do the work for us.

".. as part of my daughters school project."
and
"Can some one give me a circuit and code if necessary for decoding the MSF code and driving six seven segment displays (hours,mins, secs)."

Mike, I don't mean to sound like a MOG, but please note that this isn't a do-my-homework Forum.

You seem to want a complete solution. What will you be doing towards it?

People will happily give hints, tips amd pointers.

I sincerely hope eclectic (and others maybe) will get some marks if he does ALL the work for you :)
 

Dippy

Moderator
I apologise. I got it wrong.

You see, we get many requests on here to do someone's school project for them .. for various reasons - usually laziness and it's-got-to-be-in-by-next-Tuesday-ness.

And when someone asks for circuit designs and code for something so specific then 'homework alarm' bells ring.

"We dont expect you to do the work for us" - fair enough.
But I guess cutting and pasting circuits and a healthy drop of code is a fair chunk of the work - yes/no? :)

Anyway, good luck. Nice project.
 

Mike yeulett

New Member
Thank you

We appreciate greatley any help you give us and yes code and circuits is a fair chunk of the work. It is good to see the youngsters invloved in projects of this type.

regards,

Mike


I apologise. I got it wrong.

You see, we get many requests on here to do someone's school project for them .. for various reasons - usually laziness and it's-got-to-be-in-by-next-Tuesday-ness.

And when someone asks for circuit designs and code for something so specific then 'homework alarm' bells ring.

"We dont expect you to do the work for us" - fair enough.
But I guess cutting and pasting circuits and a healthy drop of code is a fair chunk of the work - yes/no? :)

Anyway, good luck. Nice project.
 

BeanieBots

Moderator
I've not read every detail of all the links and attachments on this thread but I get the impression that all the required code is right here in this thread.
For the time being, forget the diplay part and just concentrate on decoding using something like sertxd or debug to display the results.
Once you have known working/correct numbers, then worry about the display.
 

hippy

Ex-Staff (retired)
The spec for the Galleon Systems' EM2S MSF module appears to be ...

# Recommended voltage range 3V to 5.25V
# Current consumption at+3V, active: 1mA
# Standby: 1µA
# Output: Open collector NPN transistor, active low
# Maximum sink current: 15µA
# Maximum collector voltage: +5.25V

Taking that 15uA figure as correct, it should be possible to connect its output directly to a PICAXE input with just a 334K pull-up to 5V ( 330K+4K7 in series or 470K ).

The PICAXE code given should work as is though the signal may be inverted which would need to be catered for.

The first step would be to read the signal from EM2S through the PICAXE and set a LED when it was present. Then perhaps moving on to proving you were receiving the every-minute sync pulse ( see post #24 ). As BeanieBots says, most of the code for decoding the signal has been done and should work or be possible to make work, then it's a matter of taking the decoded values and displaying them.

One thing which would help is an indication of what sort of assistance you require.
 
Last edited:

chigley

Senior Member
I know it's an old thread, but I've been trying to get this working, and didn't think a new thread was required.

I went out the other day to buy the same clock as Electic and Hippy, and got round to breadboarding the circuit as shown in post #37 today. I tried the code in post #32 and also the code in post #36, running on an 18X. No sign of life with either - the LED didn't flash with the #32 code, and the terminal remained blank with the #36 code.

Photos of the setup are below. The only thing I can think of is that I'm using a 4.5V supply instead of 5V (voltmeter reads 1.1V across the power pins of the RF module) - could this be the cause of the problems, i.e. no power to the RF module? If not, what's wrong with my circuit?



Thanks,

Charlie
 

eclectic

Moderator
Charlie. First thing.

Get the antenna near a window,
preferably facing North,
and away from bits of metal.

Yes, I know, it might be impossible,
but do the best you can.

All the bits I used are back in the toybox at the moment,
but I'll try and dig them out tomorrow.

Ec
 
Last edited:

chigley

Senior Member
Then look at post #44

Try a power supply of 2.4 > 3 volts.

e
Can't try with a supply of 3V right now because I don't have a 2xAA battery pack, or a bench supply, or anything else that'll do the job!

Still new to the world of electronics remember, not quite built up all of the essentials yet! Although I did have a massive sort of all my gear today, into a new cabinet with drawers, which I'm very proud of :)

Thanks for the replies, I'll try next to the window and a 3V supply when I can.
 

hippy

Ex-Staff (retired)
I'd have thought the 4V5 PICAXE supply would be okay but the supply to the MSF module may be too low. You can try squidging a wire into the battery box springs to get 1V5 feed for the MSF ( check it is 1V5 with reference to PICAXE 0V first ! ).
 

chigley

Senior Member
Tried with a 1V5 supply, no different.
Upped it to 3V, appeared to be no different.

As a last ditch effort I unplugged the download cable to enable me to walk to the window. Moved about 10cm and it started working! Back to my desk, and it stops. Makes me wonder whether or not it would have worked with the 1V1 supply now!

Thanks for your help guys, will let you know if I ever make anything cool with it! If only I had 6 7-segment displays...

EDIT: Time to try and make sense out of Hippy's code now, too :)

EDIT2: I also wanted to ask what the purpose is of the 1N4148 diode in the circuit. It looks to me like it would prevent current from flowing from the RF pin of the module to the PICAXE input pin. This obviously isn't the case, so I'm clearly misunderstanding. Be gentle, please!
 
Last edited:

hippy

Ex-Staff (retired)
Moved about 10cm and it started working! Back to my desk, and it stops.

I had similar problems and also with two different commerical un-hacked MSF clocks. I had mine next to my desk when testing PICAXE code and it seemed to depend on whether I was leaning forwards or backwards - took a bit to figure out why it wasn't working after it had been. There also seems to be a delay when powered up which can make it seem like it's not working for a while to watch out for.

Glad to hear it's working and another member of the MSF Club - Just a little too late to catch the 2009-2010 roll-over but at least there's a leap year to look forward to.
 

chigley

Senior Member
Quick update in case anyone tries this and has signal problems in the future.

All signal problems were cured when I just powered the exact same circuit up from a 9v wall wart supply with regulator and caps. It now works anywhere in the house with no issues at all :)

I also have some nice displays (courtesy of Electic) which I'll add when I have time.

My question still stands about the purpose of the 1N4148 diode!

Charlie
 

hippy

Ex-Staff (retired)
Sorry, missed the question about the diode. To save seraching for the previous circuit ...

Code:
From Acctim Radio Controlled Wall Clock
  ( Argos Catalogue Number 255/1966 )

.---------------------.
| MSF Receiver Module |                       5V -.-
`----.           .----'                           |
     |           |                               .|.
     |___________|        1V5 -.-           100K | |
       | | | | |               |                 |_|
       | | | | `-----< VDD <---{                  |
       | | | `-------> RF  >---|-----------|<|----^----> PICAXE Input Pin
       | | `---------< VSS <---|---.     1N4148
       | `-----------< PON <---|---{
       `-------------< AGC <---'   |
                                   |
                               0V _|_
The diode is there because I wasn't sure if the 1V5 signal from the module would be of a high enough voltage to read on a pin when the PICAXE was operating at 5V.

The diode is intended to allow the module to operate as if its RF output were open collector; when the RF output is high, current is blocked coming out of the RF pin and only a small amount should flow into the module because of the 100K. The pin will read a high input as it's pulled high. When the RF output is low, it pulls the cathode to 0V which lowers the voltage on the PICAXE pin so it reads a low signal.

I'm not sure that analysis holds up, and when the RF output is high (1V5) the pin will see a voltage of 1V5 plus diode drop of 0V6 and 2V1 is enough for the PICAXE to see a high.

I took the non-electrical engineer / software designer approach and threw something together which I thought might work and should be safe to try and it did work. I'm sure someone else could design something better !

If the voltage to the PICAXE pin is a little border line then that could explain why it's working better with an external supply. I've never even looked at any of the signals on a scope.
 

chigley

Senior Member
Sorry, missed the question about the diode. To save seraching for the previous circuit ...

[...]

The diode is there because I wasn't sure if the 1V5 signal from the module would be of a high enough voltage to read on a pin when the PICAXE was operating at 5V.

The diode is intended to allow the module to operate as if its RF output were open collector; when the RF output is high, current is blocked coming out of the RF pin and only a small amount should flow into the module because of the 100K. The pin will read a high input as it's pulled high. When the RF output is low, it pulls the cathode to 0V which lowers the voltage on the PICAXE pin so it reads a low signal.

I'm not sure that analysis holds up, and when the RF output is high (1V5) the pin will see a voltage of 1V5 plus diode drop of 0V6 and 2V1 is enough for the PICAXE to see a high.

I took the non-electrical engineer / software designer approach and threw something together which I thought might work and should be safe to try and it did work. I'm sure someone else could design something better !

If the voltage to the PICAXE pin is a little border line then that could explain why it's working better with an external supply. I've never even looked at any of the signals on a scope.
Makes perfect sense now thanks. Well, it does for a standard high/low output anyway. How you actually read the time signal from these highs/lows is a completely different matter, but at least I understand what the diode does :)

Cheers
 
Top