> > Hi, > > > > Anyone knocked up an accurate (at least 0.1%) mains frequency measurement > > device with a PIC? The basic requirement is to datalog the mains > frequency > > over a period of time as it can often be unstable. > > I have done this. (Unfortunately as a work-for-hire so I can't publish the > code:-() It is relatively easy. You can just use the PICs crystal as a > timebase, a zero cross detector with some hysteresis, and low-pass filter > the result. > > * I had a go at this last year (with a 68HC11) and found that the zero > cross detect was very slow and the cumulative time delay between detection > of the pulse and being able to see it in the micro was not very repeatable. > I think it was maybe my bog-standard opto zero cross detect (slow) that > scuppered it. It know it's pretty straight forward (especially with > capture/compare) but getting that pulse in fast and with a known low delay > seemed to be the problem.... Slow is not an issue. We are dealing with at least seconds here. What does matter is consistency on the zero cross. > > > Reports of it being "speeded up" at the end of months to get the right > > number of cycles in are often suggested.....(!) > > Actually, it is adjusted much more often than once a month. > > * I know - this was just one of the things "mentioned" to me when I quizzed > several people about the subject. > > Best regards, > Dan Bob Ammerman RAm Systems (contract development of high performance, high function, low-level software) -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics