Hi guys, I got a problem with my ATTiny25V. I'm just trying to blink an LED, but I'm trying to adjust the frequency. I've tried using delay_ms from delay.h, as well as just using a for loop that does nothing between turning portB on and off.
First of all, using delay_ms(1000) doesn't give me a delay of 1 second. It's more like 1/2 second or 1/3 second. Then when I go ahead and increase it to 20000 or 40000 or 60000, the period for all of those is about 1 second. You would think it would increase proportionally, but no. I don't understand why.
I assumed that it was just some reason I didn't understand having to do with the coding of delay.h, but even with a for loop set to do nothing for 1 second's worth of clock cycles (977 with the 1 MHz system clock divided by 1024), the frequency still acts unpredictable.
I attached the code of what I'm trying to do. Can anyone tell me why it's not flashing at 1 Hz?