Hi
Received my z-uno today and are trying to control a fan that has pwm speed regulation. It need 25khz pwm.
I guess the best approach would be Fast PWM?
Does anyone have an example with comments? I have some trouble understanding zunoFastPWMSet
Br
Mats
Help with Fast PWM
Re: Help with Fast PWM
Based on the reference i expected the below code to give 50% at 25khz, but the fan does not behave as it should. I don't have an oscillometer.
4mhz / 25khz = 160
The fan runs fine on a Arduino (with modified PWM frequency)
4mhz / 25khz = 160
Code: Select all
pinMode(PWM3, OUTPUT);
zunoFastPWMInit(0); // 0 for 4 MHz (tick is 0.25 μs) and ZUNO_GPT_SCALE1024 for 31.25 kHz (tick is 32 μs)
zunoFastPWMSet(80, 80); // Low and high level time in timer ticks.
zunoFastPWMEnable(1); // Start
Re: Help with Fast PWM
Please note that FastPWM is on PWM0 pin.