60 Hz voltage source effects on micrcontroller timing/errors?
60 Hz voltage source effects on micrcontroller timing/errors?
(OP)
I am trying to trouble shoot a microcontroller circuit utilizing an Hitachi controller chip which runs into a very random error event which I believe may be linked to noise events on the 120 Volt AC power source to the power supply transformer for the microcontroller. The system has its own crystal oscillator that it times off of which runs at 4 MHz but it also use the 60 Hz AC voltage waveform as a check/reference timer.
Has anyone ever seen similar AC power problems causing such errors? Any ideas on how to create (or purchase) a power supply for which noise and volatage sags and spikes could be simulated would also be appreciated. Thanks,
Phil
Has anyone ever seen similar AC power problems causing such errors? Any ideas on how to create (or purchase) a power supply for which noise and volatage sags and spikes could be simulated would also be appreciated. Thanks,
Phil





RE: 60 Hz voltage source effects on micrcontroller timing/errors?
I often use a Variac transformer to test my design's response to voltage fluctuations. They let you turn up and down your "AC supply" from Zero to 130VAC with a twist of a knob.
RE: 60 Hz voltage source effects on micrcontroller timing/errors?
If the filtering and detection method and software your circuit is using to sense the 60 cycle does not adequately handle such events then problems could occur. Transients could be counted as several AC cycles. Short drop-outs may not cause the lights to flicker but could cause you system to miss cycles. I have never noticed such problems outside of old digital alarm clocks or appliance clocks.
Do a search for "AC power sources" or "programmable AC power". Search for a model that has the drop-out, transient, or frequency variation features you may need. Many choices are available from test equipment rental companies.
RE: 60 Hz voltage source effects on micrcontroller timing/errors?
Frequencies are often +-0.3Hz from 60Hz and this should have little affect on your timing unless it is an extremely short time or long time.
RE: 60 Hz voltage source effects on micrcontroller timing/errors?
That is interesting that you mention zero crossing. In one incident location where I got a log of voltage waveforms to a residence, I saw a waveform glitch to 120VAC power that crossed zero from about -170 volts up to about +70 volt and back. This occurred once and the pulse was about 2-3ms in duration.
As for emulating harmonics, can you reccommend a good programmable power supply to rent that I could use to run some tests in this area? Thanks,
PVH
RE: 60 Hz voltage source effects on micrcontroller timing/errors?
There's an old joke that seems applicable to this case.
A man with a wrist watch always knows
what time it is. A man with two wrist
watches is never quite sure what time
it is...
The concept of using 60 Hz as a check on a crystal oscillator seems dubious. If the 4MHz stops dead, then [I assume that] the uC is not working anyway. If you're using the 60Hz to calibrate the 4MHz over the very long term (days), that would require some fairly elaborate software[*] and trust in the local power company (on top of the noise problems you're having).
[* I assume you're not doing that...]
In short - how about the option of not using the 60Hz? Would the system be more reliable (in every respect) without using the noisy 60Hz as a check?
RE: 60 Hz voltage source effects on micrcontroller timing/errors?
RE: 60 Hz voltage source effects on micrcontroller timing/errors?
As for using 60Hz for timing, it can be done using appropriately sized caps, etc to form, essentially, a square wave (very steep rising and falling edges) so the zero cross is very direct. If you have a few glitches in the power, it should be no big deal given that one cycle is only 16mS. You can also use a scmitt trigger (as suggested) if you want to get fancy but, to me, it is unnecessary. If a little fluff in the time is unacceptable then use your clock. I would hope your not using the 60Hz for timing out times less than a sec or using it for a real time clock or something.
RE: 60 Hz voltage source effects on micrcontroller timing/errors?
A line monitor will indicate the nature, as well as the magnitude, of the problem. It's a good place to start.
Good luck!
Rick