msf anthorn radio time code receiver

Hi Perry
As far as I can tell the decoder will not sync to correct time, unless it’s using the Galleon Systems Time sync version 3.2 or later.

This software will not only allow you time sync with radio feed(Anthorn MSF 60Hz) but also GPS and internet feeds.

It has to see the command(s) I called up to get the function of data output from the MCM-RS232,the final command is character carriage return (hex 0d) for the MCM to execute the command function.

Only the four lower bits of each command and parameter character are used.

For instance the characters “?” “O” and “o” have same effect,(The exception is final carriage return which is decoded by considering the seven lower bits, completely decoded)

We are talking here as to the first data the MCM decoder has to see for a expected request from the PC,
so sync processing can start with a “time” output.

You have called up that your MCM -232 is giving you a time output, unless your data request is as per the output will none valid.

The MCM-232 then requires both positive and negative voltage out of the PC.(not talking here with the MAX232)

the positive voltage is supplied by the DTR line, one of two ways can be used to supply the negative voltage, PC communicates with MCM by sending ACSII characters. Negative voltage supplied by TxD line.

Back to the buffers, use the RTS line to be held low(add to program this function)when the MCM 232 is sending “Time”( can also use the MAX232.

The reply from the MCM232 is as I called up in the previous post, not time data raw.

just a note here the MCM reply for combined time date is a sequence of ASCII characters (terminated by carriage return character.

The character set in the MCM 232 is very limited to 0…9 : ;<=>? information contained in four lower bits, so bit 4 and 5 of every reply character are Binary "1"s bit 6 is Binary “0” and bit 7 is the even parity bit.

The most important aspect here is the MCM232 reply characters cannot be interrupted during the reply, so all characters have to be taken by host PC.

Now there is a more simple way of doing the above.

This may be where your software came in to play which could be why your MCM232 was sort of giving data out .

The more simple method is pull the TxD voltage high,when normally the TxD voltage is low(inactive) if the TxD voltage is high on the start of a second, the MCM232 will feed out it’s message, this can take upto 1 second due to the first start bit of time/date information sets the beginning of the second.

If the TxD line is held high continually MCM 232 will feed out time date information every second.

Beware here as the current consumptionMCM23 will be higher during data output,for aprox 600 ms upto 200uA.

Now all that required is to get the handshaking done with theMCM232 , this is by each character received by MCM is echoed, the next character must not be feed out before the echo of the preceding character plus 10 ms.

Recognising input characters is by checking both start bit and two stop bits at MCM, then the eight echoed data bits remain unchanged, regardless whether or not parity is even or odd.

Tony Smith

Thanks for all that Tony. I don't actually have a MCM232 any more, I just used the EM2S and decoded the raw time data with my own code.

Hopefully the information you have given will help someone else reading this.

++Karma; // For the detailed help.

Hi Perry

Ok understand, if you do need any further help on the hardware side let me know

Tony Smith

P.S if you want to share your software with me for MSF receiver just let me know.

I have been working on mine for a little while now it is showing signs , but not as I want it
yet.

Tony Smith

menbed:
P.S if you want to share your software with me for MSF receiver just let me know.

Tony Smith

Hi Tony,

The code is written in C for a specific PIC, not Arduino. You could adapt it for Arduino, which would require some work. In particular it uses a hardware timer to decide when to sample the incoming data. Those sample times would have to be re-created either using millis or using a timer on whichever Arduino processor you were using. It also uses a timer for running the local clock. I would think you would get away with the timers not being particularly accurate so long as the MSF signal was received reasonably often to synchronise the clock. If I shared the code it would be on the basis of giving it you 'as is' with little support. It might also come embedded in the project it was part of, although it does have its own C and h file, so it is easy to separate it from the rest of the project. You would have to open the files in either MPLABX or notepad. Do you want it on that basis?

Perry

Hi Perry
Thank you for your reply, plus your generous offer to share your code with me, I have been down the path of a PIC, using a PIC 16F877 .

This chip tends to lend itself to MSF decoder, mainly if you use, say PDS Basic compiler from Crownhill.

This also depends on which development board you use (Proton ?)

You can create a program that has an array of 60(1 bit) variables, which can be filled with MSF raw data,

which can start the loop again at the next minute.

Pic operates at 4 mHz . No need to go through this as you have done all this or similar.

I have moved on now left all that behind, to the Arduino ( my case Uno) as with this interesting IC

Atmega (A)328 (p) if you have the lower power consumption variant.

This chip is much more difficult to use as a MSF decoder, trying to get it to function as a simple clock is a big challenge, looking around I think very few people have managed to do this.

Hence my interest , so thank you again Perry, but I was looking for code written for this chip.

So I would have to decline your very kind offer.

Tony Smith

No worries Tony.

I use both PICs and Arduinos, they each have their own different advantages depending on what I need.

Hi Perry
Thanks for your reply.

Just one quick point,by your comment having used Arduinos, did the ones you used have the same mico controller, as the Uno,(Amel Atmega (A) 328 ?

The Pic 16F877 just is so simple to use as a MSF decoder, plus is easy in some ways to make it read a lot more than, time and date, can also show the values at various seconds of the BITS A and B, Waiting for start bit counting,plus UTC values.

I can also look at the Leap second status, looking at the last minute of the year as to seconds count (59/61)

How did you deal with the logic levels,when the using the MSF EM2 receiver raw output, for the PIC( like most need +5volts logic, for constant (True reading decoding) PPL detector maybe, as it's not easy to use a MAX232, or similar.

The Arduino micro controller chip, has very many uses, but MSF decoder is not on the top of it's list by any means, certainly with the Arduino IDE.

This is of course just my thoughts.

I have yet to come across any code (C ,C++) file that can be found on internet (Freeware) which will work first time of being loaded into the Arduino, ok I will limit this to Uno , which will even load to produce any workable sketch.

Its so reliant on the library that particular this code needs in it's variable list, all compilers seem to produce different a library which even then, may or not work with their code, the only I have found to make 100% sure that one Library will not conflict with another, is to take lot out not called up in your code variables.

This is not the case with all the other projects for Arduino in fact just the opposite.

Infact programming with XOD IDE, is very simple for any standard clock, with or with out DS1307 chip,

Put your clock battery on and set time, date, day on DS1307, followed as quick as possible to do the Arduino Atmega chip, this so you can keep the clock running as close as possible to atomic clock time.

Have a few of these running, very little drift.

But having said all that I have still a mission to sort the MSF receiver raw data out to Atmega controller, so that I could up load data (Arduino Code) that will work ,load and program first time, with out starting to have to rewrite the code.

Tony Smith

Just one quick point,by your comment having used Arduinos, did the ones you used have the same mico controller, as the Uno,(Amel Atmega (A) 328 ?

I currently have a Uno, a Mega and an MKRWiFi1010, plus various ESP8266 based boards, some with OLED displays built in.

The Pic 16F877 just is so simple to use as a MSF decoder, plus is easy in some ways to make it read a lot more than, time and date, can also show the values at various seconds of the BITS A and B, Waiting for start bit counting,plus UTC values.

That's ancient!

How did you deal with the logic levels,when the using the MSF EM2 receiver raw output, for the PIC( like most need +5volts logic, for constant (True reading decoding) PPL detector maybe, as it's not easy to use a MAX232, or similar.

The EM2 runs off 5V. I used a PIC 18F26K22 as the controller. I used a CMOS 40106 to clean up the EM2 output to feed into a pin on the 18F26K22.

I don't foresee any problems getting an Arduino of some kind to decode the MSF signal. I've not done it because I have no need to. There was some guy on here a while ago who want to synchronise a church clock to MSF and I offered to do the electronics and programming for him because it seemed like an interesting project, but he never replied. Had I done his project I guess by now I would have Arduino code to decode MSF data.

Hi Perry
Thats a most interesting reply of yours ref the church clock, getting it to run off MSF data,just thinking if it was a XXXX years old mechanical unit, with 2 metre or so clock face and very heavy metal hour and minute hands.

I would expect it to need a total rebuild, plus change it from pendulum if it had one, all though you could leave the old clock works in and put your conversion as primary clock.

I think this is a most interesting project, excellent to have the church bells as well striking the quarter hour,also the hour, would be nice when striking the hour having the last chime on the end of the last minute of the hour.

Did you do any planning as to how this conversion could be done ?

I did start off when looking at MSF receiver kit and MCM232 decoder using a DSPIC33J321/SP, mainly because I had one left over from another project, this as you may well know is an advanced PIC, but again will lend itself to
easy programming (C compiler) but to program it is not that easy I spent a lot of time on Micro’s website reading up all there programming info, very helpful untill I hit a section that even reading more than once slowed me down a little.

So I then moved back down to stoneage PIC, mainly because of the bootloader, there was one around so to speak, then it was all downhill.

The point about overcoming the +5volt logic, by running the EM2 receiver off +5volts, is fine as it’s has a voltage regulator on board to bring it down to correct +3.2volts to run the device, bit like the Arduino for external powering, not just USB so the current load can be increased.

But the MCM232 will only run max +3.3 volts no voltage regulator on board, if by mistake you looped as per the Galleon connection drawing with no 3.3 voltage regulator in circuit, the MCM232 would be damaged beyond repair I think.

I know you took out your MCM232 as you had problems in getting it working,(as we all did)but it’s a point for other folks to remember if they read (cannot think why) our thread.

Tony Smith

I never got to see the clock as the guy who was asking never replied to the offer. Based on not seeing it my plan was to get an accurate 1 pulse per second, which could be got from MSF or a GPS receiver, and use that to accurately time the pendulum. I was going to try putting an electro-magnet at the bottom of the swing, get a pulse from it when the pendulum passed then pulse it exactly 1 second later (or whatever the period of the pendulum was) so as to drag the pendulum a bit faster or a bit slower depending on whether the clock was a bit slow or a bit fast. I don’t know if this would have worked, never got to try it.

Hi Perry
Thanks for your reply.

I think your plan to modify that church clock, to run off MSF or GPS data, by sensing the pendulum position
by a magnetic sensor (Hall Sensor) could well work.

But the correction to run at MSF time or GPS data by altering the pendulum position, or a short stop will depend so much on the clocks propagation delay via the "Clockwork " side of the clock, I think it would be very difficult to get it to run close to MSF atomic clock time.

Just my thoughts.

I think now we must stop this thread, as we have come so far off the original topic, it's becoming a waste
of the Forum's bandwidth.

Tony Smith