I am new to embedded programming and have some bit confusions,
1. I made to connect 16 MHz xtal to Atmega16 to operate it at 16 MHz now in some example programs they use,
#ifndef F_CPU #define F_CPU 16000000UL #endif
and in some other examples they write,
#define F_CPU 16000000UL
before including delay.h as,
now my question is that it it make some difference if I use the
#ifndef #define #endif
or just use only
before including delay.h, because my LED is blinking the same by using the both.
2. What is uint8_t ? I think it is 8 bit integer (unsigned), now what type of data types are supported like this, please give me a list of all such data types supported by Atmel studio, is data type 'byte' is also suupported?
3. Please explain me in depth what is F_CPU and why it is used, if I use a xtal of freq. = x Hz then I will write in my program F_CPU = xUL to tell the compiler that mu MCU will be working on x Hz, am I write??
and what is UL in F_CPU i think it is Unsigned Long, what are the other options ?? Please tell me
Please reply me soon
Thanks in advance