summaryrefslogtreecommitdiff
path: root/tube-rotator
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2014-05-19 00:19:16 +0200
committerChristian Pointner <equinox@spreadspace.org>2014-05-19 00:19:16 +0200
commitab8daffc4114f0ba415f6ea026b2bf08ef01a642 (patch)
tree415133aa494c2044fe37f3baa19e8d4a6568f57c /tube-rotator
parenthigher stepper speed (diff)
decrease prescaler
Diffstat (limited to 'tube-rotator')
-rw-r--r--tube-rotator/stepper.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tube-rotator/stepper.c b/tube-rotator/stepper.c
index ff68072..6b2a4ef 100644
--- a/tube-rotator/stepper.c
+++ b/tube-rotator/stepper.c
@@ -56,15 +56,16 @@ void stepper_init(void)
{
STEPPER_PORT &= ~(0xF << STEPPER_FIRST_BIT | 1<<STEPPER_ENABLE_A_BIT | 1<<STEPPER_ENABLE_B_BIT);
STEPPER_DDR |= (0xF << STEPPER_FIRST_BIT) | (1<<STEPPER_ENABLE_A_BIT) | (1<<STEPPER_ENABLE_B_BIT);
+ stepper_stop();
}
void stepper_start(void)
{
STEPPER_PORT |= (1<<STEPPER_ENABLE_A_BIT) | (1<<STEPPER_ENABLE_B_BIT);
- TCCR1A = 0; // prescaler 1:256, WGM = 4 (CTC)
- TCCR1B = 1<<WGM12 | 1<<CS12; //
- OCR1A = 20;
TCNT1 = 0;
+ OCR1A = 80;
+ TCCR1A = 0; // prescaler 1:64, WGM = 4 (CTC)
+ TCCR1B = 1<<WGM12 | 1<<CS11 | 1<<CS10; //
TIMSK1 = 1<<OCIE1A;
}