1
\$\begingroup\$

So I just started learning AVR and I am currently working with the ATMega328P. I have a question regarding the CPU clock. Currently I am using the 8MHz internal clock. Now I know that F_CPU tells the compiler what my clock speed is. The problem here is that the CLKDIV8 fuse is programmed by default, so I was wondering what value would I enter for F_CPU? Will it be 8000000 or 1000000.

I would be glad if someone could clear this confusion.

\$\endgroup\$
1

1 Answer 1

2
\$\begingroup\$

1Mhz, until/unless you change the CLKDIV8 fuse, then it's 8MHz

\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.