Just build three of them so far, and the problem of synchronize between these clocks surfaced.
I modify the NTP code, now it will handle all of the timestame (uint64_t), also count in latency
then I can delay the decimal in timestamp so the system will synchronize in microseconds.
But the problem is that RTC chip handles Synchronize differently, the two RTC chip I'm using is DS1338(DS1307 3.3v version)
and PCF8563 , PCF8563 is tricky because it will not clear the counter after writing new time, so I have to wait the 1Hz clock output goes low, then stop the RTC clock, then write the new timestamp, also note that the time waiting for Clock output must also count in.
For DS1338, just write the second reg and it will clear the counter, much easier then PCF8563.
Although new version of IV-18 VFD seems working great, but its luminance is too small compare with first one with same voltage, I've check every thing from high voltage ripple to HV5812 scanning code, but still not found where the problem is.
When I comparing both tubes, it seems to have two types.
first one, I brought cuple month ago, which is military grade type of IV-18
the military mark is at the back of the tube.
second one seems to be civil grade of IV-18
other than the mark at the back, both plate that contain deoxidants and the white paint to cover the mark is less than military grade type of IV-18.
So, I'm thinking that if civil grade needs higher voltage than 30V?
current step-up design can handle up to 40V, so maybe I'll try how it performs on higher voltage.
First of all, the Linkit connect module is working and received NTP data, I've modify the code in to a library form(Github)
and some optimization
Linkit connect module
Second, I've add a photocell which monitor environment lux to control VFD brightness, the first one just close the VFD when light is under threshold but since I connect the blink pin on MAX6921, I can control the brightness using PWM, also the control is in timer interrupt, so i don't need to constantly update value and PWM.
Third,the hardware is all finish, but to use them all ,the program size become a big problem, currently the SD lib and Wifi lib is both too big to squeeze in 28K rom, after adding NTP time sync, the code size is already 27.3K not much room for SD card,
I will try to cut down the code size by not using USB CDC(Serial),which count for 4K of ROM.
Ver 1.0 on Linkit one on the left , Ver 2.0 standalone on the right
So adding a Linkit connect module and add a low cost RTC (both DS1307 or PCF8563),and a SD slot and some buttons, the next main board almost finish,(Still need a buzzer and a photocell) hope i can finish coding before Arduino Day event in Taiwan.
and by the way, the IV-18 board still have to make another version, because that SSOP version of MAX6921 is VERY EXPENSIVE and HARD TO BUY, so I'll try to build a version made of HV5812 and LM9022(equals to LM4871 by the way)