Hardware PWM in CubeCell-1/2AA

Hello. I want to use the hardware PWM from HelTecAutomation/ASR650x-Arduino/cores/asr650x/cores/PWM1.h on a CubeCell-1/2AA board, but I get an “undefined reference to `PWM1_Init()” compilation error. Do these functions need any special compiler settings?
Actually, with all functions from PWM1.h the same error.

hi,

could you update your Development environment and try this code:

Thanks for the answer. In this example, I don’t understand how to set the desired PWM frequency and how to set the duty cycle. I need a frequency of 50 kHz and a duty cycle of 2-98%. Yes, I did an Development environment update via git

for example:

setPWM_Frequency(a);
setPWM_ComparePeriod(b);
analogWrite(PWM1,c);

the PWM frequency is a/b. c used for set dutycycle, it’s value can be 0-b;

I get an error when I try to upload this code

error: ‘setPWM_Frequency’ was not declared in this scope
setPWM_Frequency(PWM_CLK_FREQ_12M);

I am using Arduino 1.8.13 Any idea as to why?

hi,

I have tested it. it work fine.

maybe you can updated your Development environment(git vesion).