Blink period shorter than expected
dfx <[email protected]>
| Newsgroups | gmane.comp.hardware.avr.gcc |
|---|---|
| Organization | dfx s.r.l. |
| Message-ID | <[email protected]> |
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
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-gcc-list
dfx.vcf
(text/x-vcard, 259 B)
begin:vcard fn:Domenico Formenton n:Formenton;Domenico org:dfx adr;dom:;;Via delle due Case, 12;APRILIA;LT;04011 email;internet:[email protected] tel;work:06 92500019 tel;cell:333 7075929 x-mozilla-html:TRUE url:www.dfx.it version:2.1 end:vcard