I used my atmega32 out of the box and I programmed it in winavr. I noticed it was really slow and I found out that apparently it is set to run on an 8mhz internal clock that is divided by 8 by default in the fuse bits.
I changed the makefile F_CPU to 1000000 and things worked as normal because it was infact running at 1mhz. I setup a clock and factored it by 1024 in the register giving 1000 ticks per second or millisecond intervals. I counted up to 1000 of these ticks and it did in fact give 1 second.
I now want more than just 1mhz and would like to not divide by 8. I used the calculator and removed the divide by 8 to get back to 8mhz. My program then did not run but I then changed the F_CPU to 8000000 and just like that it ran which I would expect.
I expected to have to go and change my code to cater for the faster clock count but I didn't have to? The program still reads the TCNT value and the timer factors by 1024 and counts to 1000 for the old second, I would have expected this to increment faster because it counts up 8 times faster.
Am I misunderstanding something about timing?
I changed the makefile F_CPU to 1000000 and things worked as normal because it was infact running at 1mhz. I setup a clock and factored it by 1024 in the register giving 1000 ticks per second or millisecond intervals. I counted up to 1000 of these ticks and it did in fact give 1 second.
I now want more than just 1mhz and would like to not divide by 8. I used the calculator and removed the divide by 8 to get back to 8mhz. My program then did not run but I then changed the F_CPU to 8000000 and just like that it ran which I would expect.
I expected to have to go and change my code to cater for the faster clock count but I didn't have to? The program still reads the TCNT value and the timer factors by 1024 and counts to 1000 for the old second, I would have expected this to increment faster because it counts up 8 times faster.
Am I misunderstanding something about timing?