Page 1 of 1
Z-Uno Gen2 and Fast PWM
Posted: 03 Oct 2021 20:51
by qqflx2
Hi,
Can you clarify the situation with Fast PWM on A0 on the gen2 board?
I'm getting:
sketch_oct03d.ino: In function 'void setup()':
sketch_oct03d:20:3: error: 'zunoFastPWMInit' was not declared in this scope
zunoFastPWMInit(0);
^~~~~~~~~~~~~~~
And I do not find any reference to zunoFastPWM*() functions in Z-Uno2 package too...
--
L.
Re: Z-Uno Gen2 and Fast PWM
Posted: 05 Oct 2021 10:43
by p0lyg0n1
Hi,
There is no division to "fast/slow" in Z-Uno2. All PWMs are fast in CortexM4. Thats why we didn't add zunoFastPWM* functions for Z-Uno2. What do you want to achive by means of "fast" PWM? You can use analogWrite() for most cases on any pins. At one moment you can use up to 4 channels of PWM.
Re: Z-Uno Gen2 and Fast PWM
Posted: 06 Oct 2021 10:53
by qqflx2
Ok, with analogWrite() I could specify duty cycle but how can I configure frequency on PWM* pins? Something similar to zunoFastPWMSet(low, high)?
I have 24V fan which speed can be controlled by 5V PWM duty cycle signal at ~25kHz.
Re: Z-Uno Gen2 and Fast PWM
Posted: 12 Oct 2021 15:54
by qqflx2
does the silence mean that gen2 not capable of 25khz pwm? I mean I tried gpt timers and digitalWrite() on multiple outputs too
but were not able to go higher than 8-9khz (measured by cheap multimeter) and it was not stable - duty cycle seemed to "jump around". Out of ideas
except to use somekind of external pwm generator.
Re: Z-Uno Gen2 and Fast PWM
Posted: 26 Nov 2021 23:08
by michap
Hi,
try analogWriteFrequency(freq)
freq: New PWM frequency in Hz units. The range is [488;8000000] Hz.
Michael