Rev 32 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 32 | Rev 34 | ||
---|---|---|---|
Line 59... | Line 59... | ||
59 | 59 | ||
60 | // with a dwell angle of 45 degrees , 4 cylinders and a maximum RPM of 5000 |
60 | // with a dwell angle of 45 degrees , 4 cylinders and a maximum RPM of 5000 |
61 | // freq = 5000/60 * 2 = 166Hz. |
61 | // freq = 5000/60 * 2 = 166Hz. |
62 | // the TIM2 counter counts in 10uS increments, |
62 | // the TIM2 counter counts in 10uS increments, |
63 | // TODO this is wrong algo. Accept FIRST pulse, skip shorter pulses |
63 | // TODO this is wrong algo. Accept FIRST pulse, skip shorter pulses |
64 | // Accept the first pulse with over 1mS duration as the closure |
64 | // Accept the first pulse with over 2.5mS (1/400 sec) duration as the closure |
65 | #define BREAKER_MIN (RPM_COUNT_RATE/1000) |
65 | #define BREAKER_MIN (RPM_COUNT_RATE/400) |
66 | 66 | ||
67 | #define RPM_AVERAGE 4 |
67 | #define RPM_AVERAGE 4 |
68 | 68 | ||
69 | // wait for about 1 second to decide whether or not starter is on |
69 | // wait for about 1 second to decide whether or not starter is on |
70 | 70 |