Browse Source

stepper: Clarify comment on timer-counter configuration

Ben Gamari 13 years ago
parent
commit
96509494f0
1 changed files with 7 additions and 1 deletions
  1. 7
    1
      Marlin/stepper.cpp

+ 7
- 1
Marlin/stepper.cpp View File

@@ -740,7 +740,13 @@ void st_init()
740 740
   // output mode = 00 (disconnected)
741 741
   TCCR1A &= ~(3<<COM1A0); 
742 742
   TCCR1A &= ~(3<<COM1B0); 
743
-  TCCR1B = (TCCR1B & ~(0x07<<CS10)) | (2<<CS10); // 2MHz timer
743
+  
744
+  // Set the timer pre-scaler
745
+  // Generally we use a divider of 8, resulting in a 2MHz timer
746
+  // frequency on a 16MHz MCU. If you are going to change this, be
747
+  // sure to regenerate speed_lookuptable.h with
748
+  // create_speed_lookuptable.py
749
+  TCCR1B = (TCCR1B & ~(0x07<<CS10)) | (2<<CS10);
744 750
 
745 751
   OCR1A = 0x4000;
746 752
   TCNT1 = 0;

Loading…
Cancel
Save