Greetings experts!
I have found something a bit surprising and I thought I'd ask to see if this is a known phenomenon.
I have a program that illuminates a "heartbeat" LED for 120mS every second. While it is doing that, it is also generating some 5kHz square waves using SPI DACs. I'm using millis() and micros() in the usual way (like the "blink without delay" example) to trigger these various events. All is working well.
The strange thing that I am noticing is that the rate of the microsecond counter (and maybe more) seems to change significantly (several percent) depending on whether the heartbeat LED is "on" or "off". If the output in question is "high" the timer rate slows down. The effect is quite clear.
I checked the current draw, and it was < 10mA. I further checked for current related effects by reducing it to ~1mA with a larger series resistor. The power supply is not affected by the LED current. I also checked to make sure my logic wasn't doing something obviously stupid by leaving everything the same and replacing the relevant "HIGH" with a "LOW" so that the LED output isn't taken high. The timer rate does not change.
Because the effect did not seem to be load-dependent, I then tried with an un-connected output pin. I found the same effect.
Is this sort of thing expected/known?
cheers
Doug
I have found something a bit surprising and I thought I'd ask to see if this is a known phenomenon.
I have a program that illuminates a "heartbeat" LED for 120mS every second. While it is doing that, it is also generating some 5kHz square waves using SPI DACs. I'm using millis() and micros() in the usual way (like the "blink without delay" example) to trigger these various events. All is working well.
The strange thing that I am noticing is that the rate of the microsecond counter (and maybe more) seems to change significantly (several percent) depending on whether the heartbeat LED is "on" or "off". If the output in question is "high" the timer rate slows down. The effect is quite clear.
I checked the current draw, and it was < 10mA. I further checked for current related effects by reducing it to ~1mA with a larger series resistor. The power supply is not affected by the LED current. I also checked to make sure my logic wasn't doing something obviously stupid by leaving everything the same and replacing the relevant "HIGH" with a "LOW" so that the LED output isn't taken high. The timer rate does not change.
Because the effect did not seem to be load-dependent, I then tried with an un-connected output pin. I found the same effect.
Is this sort of thing expected/known?
cheers
Doug