PWM with CubeCell Board


is it possible to get a sample code around a digital I/O-PIN to configure variable PWM. I need to use high PWM frequency and an adjustable duty ratio with a resolution greater than 255 (1024).



Here is a PWM example:

Thank you supporter.

Yes, this is the PWM implementation that applies to all Arduino boards.

However, I would like to be able to determine the parameters myself, i.e. configure the internal timer for the PWM myself.

E.g. varable a or b should not go from 0-255, it should go from 0-1023

Ideally, the base frequency of the PWM should also be configurable.

Kind regards


Don’t have such a function now…

Anyway, do you have some other example with the function you wanted? That will make a directly sense to me.

Ok, here my idea:

#include "Arduino.h"

void setup() {
  // put your setup code here, to run once:
       **setPWM_frequency = 100000; // example 100000 Hz**

**uint16_t a=0**; // possible 0 -1023 or greater, the internal timer for PWM should be a 16 Bit-Timer
**uint16_t b=0;**

void loop() {
  // put your main code here, to run repeatedly:

Kind regards



You will see this function in next release.

Thank you!

Kind regards

Any updates on this PWM function?

The PWM frequency updated to 65535.

It is updated in git. If install by arduino IDE, it is not updated yet

Just checked out the git. Looks like the frequency of the PWM isn’t adjustable/settable still. Is that correct?