MSF Time Decoder
g3cwi
Posts: 262
Hi
Does anyone have the code written to decode the MSF time signals. If so would you are to share it?
http://www.npl.co.uk/upload/pdf/MSF_Time_Date_Code.pdf
If not it looks like a nice little exercise!
http://www.pvelectronics.co.uk/index.php?main_page=index&cPath=9&zenid=ea39d143e3ff1a9d7da5af3aacdb93cf
Cheers
Richard
Does anyone have the code written to decode the MSF time signals. If so would you are to share it?
http://www.npl.co.uk/upload/pdf/MSF_Time_Date_Code.pdf
If not it looks like a nice little exercise!
http://www.pvelectronics.co.uk/index.php?main_page=index&cPath=9&zenid=ea39d143e3ff1a9d7da5af3aacdb93cf
Cheers
Richard
Comments
Unfortunately the data I have is inverted so I need to measure the spaces. I have tried a few things including reversing the order of waitpeq and waitpne without success. What might be the best way to invert the incoming data stream or to measure the 0 periods?
Thanks.
Richard
PS I am also surprised that I have to insert a correction of 17mS to get the pulses reasonably accurate but they still have a lot of jitter. This is strange as they come from a standard time source.
Alan
I'm surprised that you get anything usefull out of this code
ctra[30..26] := 010
sets the counter mode to POSEDGE if I count the modes right (010=decimal 10 = binary %01010).
To measure a pulse length you need POSDETECT or NEGDETECT, for low pulses NEGDETECT is the right mode:
ctra[30..26] := %01100
Then
ctra[5..0] := LONG[MSF_In]
This sets the pin number to the value of the hubmemory long at the location MSF_In, which I don't think was your intention.
Just set it to the pin number with:
ctra[5..0] := MSF_In
If you now swap the WAITPNE and WAITPEQ lines, you should measure the low pulse length.
But if you need only a milliseconds resolution then the following code without a counter should also work:
Andy
I suspect some of the decoding RF work done by Phil may work without requiring the pcb at all ??? (i.e. decode fully in propeller software with simple R/C/L circuitry)
Yes, "LOGIC A" makes sense. If the pin was also the correct one by accident, then it's not so surprising anymore...
So to get the Low pulse time he can also set the mode to "LOGIC !A". Looks like these counter modes are exactly the same as POS and NEG detect.
Andy
...such are the joys of the OBEX! It is a lift out of an object there.
Cheers
Richard
I will plod on regardless!
Cheers
Richard
Amazingly I have written a decoder that works! The Parity checking is crude. Are there clever ways of doing it?
Cheers
Richard
PS Year displays as Zero if there is a Parity Error which looks like it's impossible... Driving me crazy!!!
Look here for an explanation on parity bits: http://en.wikipedia.org/wiki/Parity_bit
So you parity check will become:
However you write 999 to the bit value when you detect different levels within 10mS. Chnage that part of the code to something like this (avering the bit vaue over 3 tries):
What's more although your code works for the normal case it will not work for lead seconds where the system send 58 or 60 seonds!!
Yiou might be better off with the edge detection as described earlier
I revised your snippets as follows:
Your averaging idea did not seem to work so I multiplied the samples together. My "999" idea was a bad one!
The code is now in the OBEX.
http://obex.parallax.com/objects/875/
Cheers
Richard
Ahh yes. thanks Cluso. I recall that - but I cant actually find it again Nothing obvious in the OBEX.
Cheers
Richard
Richard
The PEK text (available from Prop Tool Help menu) has a some stuff on using counters. I think they have some code examples. I don't think (IIRC) they go into much depth on the subject though.
But, what we would really like is the logic diagram of the counters including the VGA too. A number of us are convinced we could find some other great uses if we had this info. You never can get to this sort of level with other micros because they are just too complex and too many varieties - and of course the chip vendors are very secretive, not at all like Chip & Parallax.
For reference, here are some links to other threads...
http://forums.parallax.com/showthread.php?136886-A-link-for-PhiPi-on-a-SDR-maybe-you-ve-already-seen-it.&highlight=software+defined+radio
http://forums.parallax.com/showthread.php?135233-quot-Density-Domain-quot-Signal-Processing&highlight=software+defined+radio
http://forums.parallax.com/showthread.php?133173-FIR2PASM-Automatic-FIR-Filter-Code-Generator&highlight=software+defined+radio
http://forums.parallax.com/showthread.php?123791-Propeller-mediated-Sine-Wave-Frequency-Synthesizer
http://forums.parallax.com/showthread.php?117044-Online-Ham-Radio-Receiver&highlight=software+defined+radio
http://forums.parallax.com/showthread.php?132977-Hilbert-Transform-Prop-DSP&highlight=software+defined+radio
http://forums.parallax.com/showthread.php?105674-Hook-an-antenna-to-your-Propeller-and-listen-to-the-radio!-(New-shortwave-prog&highlight=software+defined+radio
and you shuold also look here for SRD info..
http://www.wb5rvz.com/sdr/softrock_40_r/
http://www.wb5rvz.com/sdr/ensemble_rx_ii/