|
From: | John Gallagher |
Subject: | Re: [avr-gcc-list] Blink period shorter than expected |
Date: | Sun, 1 Dec 2013 14:44:46 -0500 |
I made a very simple circuit for LED to blink.
The code is as follows:
# include <avr/io.h>
# define F_CPU 20000000UL
# include <util/delay.h>
int main (void) {
DDRB | = _BV (DDB0);
while (1) {
PORTB ^ = _BV (PB0);
_delay_ms (10000);
}
}
The processor is an ATMEGA324PA with clock = 20 MHz.
The fuses are:
lfuse = 0x4F
hfuse = 0x99
eFUSE = 0xFF.
The problem is that the period of switching on / off of the LED is approximately 16 seconds. instead of 20 seconds expected.
Where is the error? What should I check for a period of 20 seconds?
Thank you to those who can help me.
Domenico
PS: I suppose that with a quartz 16 MHz operation would be correct, but there is a way to use one 20 Mhz?
---
Questa e-mail è priva di virus e malware perché è attiva la protezione avast! Antivirus.
http://www.avast.com
_______________________________________________
AVR-GCC-list mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
[Prev in Thread] | Current Thread | [Next in Thread] |