hexagon5un / AVR-Programming

Code examples for the book "Make: AVR Programming"
http://littlehacks.org/AVR-Programming
MIT License
725 stars 340 forks source link

examples 11-1 vs 11-2, prescaling and count speed #55

Closed sjomae closed 9 months ago

sjomae commented 9 months ago

Example 11-1 uses / 1 prescaling, while example 11-2 is using / 8. Still the ICR1 are both on 20000, marked as 20ms in the comments. If the prescaling differs, then the speed of the count is not the same right? So how can they be both 20ms with different prescaling?

sjomae commented 9 months ago

Ok F_CPU differs in the Makefile. https://github.com/hexagon5un/AVR-Programming/blob/master/Chapter11_Driving-Servo-Motors/servoWorkout/Makefile#L8 https://github.com/hexagon5un/AVR-Programming/blob/master/Chapter11_Driving-Servo-Motors/servoSundial/Makefile#L8