I wrote this code
/* * DisplayTest.cpp * * Created: 21.1.2016. 21:17:01 * Author: Zvoc47 */ #include <avr/io.h> #define F_CPU 32768000 #include <util/delay.h> int main(void) { PORTQ_DIRSET=0b00001000; while(1) { PORTQ_OUTTGL=0b00001000; _delay_ms(500); //TODO:: Please write your application code } }
for my XMEGA A1U Xplained Pro board. This time without ASF. I just wanted to check if the timing is correct.
The LED blinks after 8 seconds instead of half a second. If the crystal fails, the frequency of the CPU goes to 2MHz. The board has a 32Mhz crystal. If this calculation is correct: 32/2[MHz]=8000/500 ... then it seems that something has happened to my crystal! I wonder how do I fix this. Is it maybe the clock settings that are problematic?
* Moved to XMega forum *