![]() #define clockOutPin 13 // data out, send this to your second * fired something off that spurs on 60kHz or you just fried your WWVB receiver * For those days when you want to work on your code, but the singal is bad, somebody Run on a second Arduino, run a two wire data cable between the two (common ground, signal) and fiddle to your heart's content. ( edited to change 8 to 9, 1001 BCD is 9)įor those bad receive days where you want to work on your data decode, but the signal's not cooperating, or your neighbor just fired up some sort of technological marvel hash generator, here's a WWVB Signal Simulator. These are the bcd numbers, convert to decimal and you start having time information to play with. WwvbRxBuffer = wwvbRxBuffer | ((unsigned long long) signal MinTen bitwise OR wwvbRxBuffer contents with signal bit shifted to bufferPosition * 0 to account for MSB0/LSB0 mismach between processor and transmitted data. Reverse bit order by starting at 63 and working back towards The bufferPosition counter shifts the writing position within * Append a decoded signal bit to the wwvbRxBuffer and decrement bufferPosition counter. I then fill the buffer from bit 64 back to bit 5. Unsigned long long MinTen :3 // minutes tens Unsigned long long MinOne :4 // minutes ones Unsigned long long HourTen :2 // hours tens Unsigned long long HourOne :4 // hours ones Unsigned long long DayHun :2 // day hundreds Unsigned long long OffSign :3 // offset sign Unsigned long long OffVal :4 // offset value Unsigned long long YearTen :4 // year (5 -> 2005) Unsigned long long YearOne :4 // year (5 -> 2005) Unsigned long long Leapyear :1 // leapyear Unsigned long long Leapsec :1 // leapsecond Unsigned long long U12 :4 // no value, empty four bits only 60 of 64 bits used All this points to a 64 bit buffer wwvbRxBuffer that the bits get inserted into as the I took the DCF77 work already done by Mathias Dalheimer » Blog Archive » Arduino DCF77 radio clock receiver and reworked his data structure in reverse (ie minutes come last instead of first) like so: // WWVB time format struct - acts as an overlay on wwvbRxBuffer to extract time/date data. You are given a year, day of year and leapyear bit. Then if you want dates, you will have to calculate them somehow. 1001 gives you 9 just fine, but 0101 becomes 1010 if you get the drift. And then the WWVB data has MSB0/LSB0 reversed, so you have to read it backwards to get the BCD stuff to actually give you proper digits. ![]() On top of that each BCD decimal is separated from the next one by a zero non-data bit, so you cannot just read a number, you have to read each digit. We're working with Cold War Era techonology, none of that fancy schmancy parity stuff, and actual dates so most of the preexisting work with DCF77 won't work. Get the long loopstick antenna for that and make sure you get it up off the workbench and into a Colorado facing window with the antenna broadside. ![]()
0 Comments
Leave a Reply. |