JochiSt / OpenFlowMeter

Measuring Flow
GNU General Public License v3.0
6 stars 0 forks source link

Increase PWM resolution #28

Closed JochiSt closed 1 year ago

JochiSt commented 1 year ago

Increase the PWM for a finer regulation.

By increasing the timer period to 4096, the effective PWM frequency gets quartered. On the other hand the resolution increases by a factor 4.

JochiSt commented 1 year ago

It is possible to increase the resolution of setting the current by a factor four.

grafik

The result for 1mA is as expected: 4 x 33 (see https://github.com/JochiSt/OpenFlowMeter/issues/22#issuecomment-1370697264) = 132. Here it is 135 LSB for 1mA, which is in good agreement.

Which this higher resolution, 1 LSB of the DAC is equal to a bit more than 7 uA.