~i-dan-3/flashlight-firmware/pwm-strobe

Viewing all changes in revision 238.

  • Committer: Dan Stahlke
  • Date: 2019-11-13 06:11:02 UTC
  • Revision ID: dstahlke@psi-20191113061102-m67gzxg20zgzbsbw
Added accurate 16-bit PWM strobe modes

Disabled by default.  Only supported on CPUs having a 16-bit PWM, which means only attiny1634, which means only Emisar D4v2 and D4Sv2.  I don't have a D4Sv2 to test, so currently it's only implemented on D4v2.  The relevant functions could probably be directly copied from hwdef-Emisar_D4v2.h to hwdef-Emisar_D4Sv2.h.

Strobe rate can be continuously varied from 1Hz to 500Hz.  Theoretically it could run faster, but this is already enough to freeze something that's spinning at 30000 RPM.  Uses full brightness (1x7135 plus FET) with a 1:256 duty cycle (party strobe) or 1:4 duty cycle (tactical strobe).  Rate adjustment has acceleration, going twice as fast after 1 second and 4x as fast after 2 seconds.  It still takes about 10 seconds to traverse the whole range from 1Hz to 500Hz.

With this I was able to freeze my Proxon drill (similar to Dremel) running at 20000 RPM.  Unfortunately the flash rate fluctuates by about 0.1%, probably due to the CPU's RC oscillator.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: