Z-Uno Gen2 and Fast PWM

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
qqflx2
Posts: 5
Joined: 03 Oct 2021 20:47

Z-Uno Gen2 and Fast PWM

Post 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.
p0lyg0n1
Posts: 242
Joined: 04 Aug 2016 07:14

Re: Z-Uno Gen2 and Fast PWM

Post 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.
qqflx2
Posts: 5
Joined: 03 Oct 2021 20:47

Re: Z-Uno Gen2 and Fast PWM

Post 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.
qqflx2
Posts: 5
Joined: 03 Oct 2021 20:47

Re: Z-Uno Gen2 and Fast PWM

Post 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.
michap
Posts: 437
Joined: 26 Mar 2013 10:35
Contact:

Re: Z-Uno Gen2 and Fast PWM

Post by michap »

Hi,

try analogWriteFrequency(freq)

freq: New PWM frequency in Hz units. The range is [488;8000000] Hz.

Michael
Post Reply