summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-09-21 21:16:55 +0000
committerChristian Pointner <equinox@spreadspace.org>2013-09-21 21:16:55 +0000
commit73b634533948ee215edee742a5fb5df379134b60 (patch)
treed0b47a5613c16b9135e8c9da044c97ff6acfed69
parentless jitter for stepper (diff)
some timing fixed for stepper table
git-svn-id: https://svn.spreadspace.org/avr/trunk@225 aa12f405-d877-488e-9caf-2d797e2a1cc7
-rw-r--r--tuer-rfid/stepper.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/tuer-rfid/stepper.c b/tuer-rfid/stepper.c
index 256ad75..f267645 100644
--- a/tuer-rfid/stepper.c
+++ b/tuer-rfid/stepper.c
@@ -31,20 +31,20 @@
uint8_t step_table [] =
{
/* full steps */
- /* 10, // 1010 */
- /* 9, // 1001 */
- /* 5, // 0101 */
/* 6, // 0110 */
+ /* 5, // 0101 */
+ /* 9, // 1001 */
+ /* 10, // 1010 */
/* half steps */
- 10, // 1010
- 8, // 1000
- 9, // 1001
- 1, // 0001
- 5, // 0101
- 4, // 0100
- 6, // 0110
2, // 0010
+ 6, // 0110
+ 4, // 0100
+ 5, // 0101
+ 1, // 0001
+ 9, // 1001
+ 8, // 1000
+ 10, // 1010
};
#define STEPPER_PORT PORTF
@@ -56,8 +56,8 @@ uint8_t step_table [] =
#define STEPPER_OUTPUT_BITMASK (~(0xF << STEPPER_FIRST_BIT ))
volatile uint16_t step_cnt = 0;
-#define STEP_CNT_STOP (LENGTH_STEP_TABLE*800)
-#define STEP_CNT_OFF (STEP_CNT_STOP + 250)
+#define STEP_CNT_STOP (LENGTH_STEP_TABLE*210)
+#define STEP_CNT_OFF (STEP_CNT_STOP + 100)
stepper_direction_t step_direction = dir_open;
inline void stepper_stop(void)
@@ -114,7 +114,7 @@ uint8_t stepper_start(stepper_direction_t direction)
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 = 42; // this value should be between 40 and 85
+ OCR1A = 150;
TCNT1 = 0;
TIMSK1 = 1<<OCIE1A;