GewoonGijs / VID28

17 stars 11 forks source link

One pointer is more noisy than the other pointer - timer0 issue? #8

Open timostr opened 2 years ago

timostr commented 2 years ago

Hi,

very inventive libriary to run VID28 steppers directly from atmege386p. Is setting prescaler for timer0 to 1 really needed to get smooth movements?

Two questions:

  1. One pointer is more noisy than the other pointer. Is this related to run timer0 in fast-pwm-mode and not in phase-correct-pwm-mode like timer1 and timer2?
  2. I noticed in my code no difference, if I patch wiring.c with your code. Is it actually needed, if I don't use anything like delay(), millis()? This is somehow strange, because you are using micros() in your code.
  3. Is it possible to leave the arduino framework as it is and still use prescaler 1 for timer0, if a correction factor to micros is applied (i.e. millis() / 64)?

Thanks, Timo

timostr commented 2 years ago

Btw. yes - I used the correct pins --> stepper 1: MotorVID28(4320, true, 6, 5, 3) --> stepper 2: MotorVID28(4320, true, 11, 10, 9)