I'm building a shield for Arduino to test, then later will integrate the 328 in a single pcb with the drivers and LEDs.
After I finish the design I will dive into learning how to program the chip with IDE, it's all new to me. But before I finish the shield and take that on.
Is it possible to set the following PWM output as it's needed for how I set up my LED driver circuit to give me a 3000:1 dimming ration.
Can I set the switching frequency output from Uno to 2MHz with a min time of 2us and a max 9ms?
I've tried to program my mega2560 for a high frequency PWM output, but not an Uno. Though these two boards are using 16MHz crystal, I think my experience might help.
To achieve such a high frequency output, you may need to access the timer of the microcontroller. Here is how I do:
I'm building a shield for Arduino to test, then later will integrate the 328 in a single pcb with the drivers and LEDs.
After I finish the design I will dive into learning how to program the chip with IDE, it's all new to me. But before I finish the shield and take that on.
I think you have it in the wrong order.
May I and many forum members suggest you first learn how to program the 328 with the IDE. (The current and voltage parameters of the 328 and how it behaves to various inputs, outputs and biasing have to be learnt first)
Then when you are confident with your level of programming, begin your project.
When you have it working and proven in prototype form, then think about a PCB.
What is your electronics, programming, arduino, hardware experience?
As others have mentioned, attempting to first design the hardware and then learn how to program is not wise. Before attempting to design your own PCB with a microcontroller on it you should learn how to design something simpler and build a number of prototypes.
I'd be interested to know what LED s you are going to drive in what application. Designing a board/driver that can achieve a dimming ratio of 3000:1 is not a beginner project and the limited PWM resolution of the Atmel 8bit processors is not the only obstacle.
Why would you need a PWM frequency of 2MHz ? I am thinking you are mixing up the oscillating frequency of your constant current switch mode power supply to dive the LEDs with the actual PWM frequency to dim the LEDs.
If you follow the Links in my signature you can see a Arduino LED shield for High Power RGB LEDs with a dimming ratio of 3000:1 and 12 bit resolution.
Also dimming ratio is not the same as resolution. You can have 12 bit PWM resolution and still only have 1000:1 dimming ratio