From 96509494f0d0438fc4f85171b66ec2a598f00a62 Mon Sep 17 00:00:00 2001
From: Ben Gamari <bgamari.foss@gmail.com>
Date: Wed, 7 Mar 2012 17:58:35 -0500
Subject: [PATCH] stepper: Clarify comment on timer-counter configuration

---
 Marlin/stepper.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp
index 55c09902bc..c3ea41b02d 100644
--- a/Marlin/stepper.cpp
+++ b/Marlin/stepper.cpp
@@ -740,7 +740,13 @@ void st_init()
   // output mode = 00 (disconnected)
   TCCR1A &= ~(3<<COM1A0); 
   TCCR1A &= ~(3<<COM1B0); 
-  TCCR1B = (TCCR1B & ~(0x07<<CS10)) | (2<<CS10); // 2MHz timer
+  
+  // Set the timer pre-scaler
+  // Generally we use a divider of 8, resulting in a 2MHz timer
+  // frequency on a 16MHz MCU. If you are going to change this, be
+  // sure to regenerate speed_lookuptable.h with
+  // create_speed_lookuptable.py
+  TCCR1B = (TCCR1B & ~(0x07<<CS10)) | (2<<CS10);
 
   OCR1A = 0x4000;
   TCNT1 = 0;
-- 
GitLab