Electrical – what does the “UL” means when specifying the clock speed for AVR MCUs

microcontroller

So I am using the ATTiny10 for the first time, and I noticed that even after setting the clock pre-scaler register correctly (0x00 in my case) I had to define a value called F_CPU for the _delay() function to work correctly. but when going over the code example I have there was #define F_CPU 8000000UL. What does the UL mean?

Also if someone can recommend a good book to start with microcontrollers that would be appreciated, too many registers and setup conditions it's overwhelming!.

Best Answer

The "UL" means unsigned long. The C/C++ language defines this and other type specifiers for integer literals. See https://en.cppreference.com/w/cpp/language/integer_literal