How to resolve light flickering in Arduino PWM design

Hello everyone,

I would like to know if anyone can help me with the problem I am having with my PWM design with Arduino nano.

I want to design a PWM dimmer with 20KHz on Pin 9 of Arduino nano 328. I want the resolution to be 256. I also want to use PWM on other pins using “analog write” instruction.

I am using “Arduino PWM frequency Library V_04” library. During the testing, it works properly, but when it is used in the main firmware, it stops working and constantly gets the micro-controller locked.

I guess this might be due to some inconsistencies in using the hardware and the timer. I am using the following instructions:

wire-delay()

analogwrite()

Serial.Read()

Seiral.Println

Can you guide me what the problem might be?

Regards,

Norman

Well, there seems to be a more recent version of it:

https://code.google.com/archive/p/ardui … /downloads

However, how do you expect to find help in fixing the lockup with none of your code provided?