I don't know why there is two PWM's libraries ????? There is no any explanation in help file why is so, except this:
This is confusing, even PWM is well described as techology.Note: Not all the AVR MCUs support both PWM and PWM1 library.
However, beside this I have found that library only support 2 PWM modes except 16! Let me clear. From help file:
What is wrong here? This:Parameter wave_mode is a desired PWM mode. There are two modes: Phase Correct and Fast PWM.
Take, for example, datasheet for most popular AVR, Mega8 or Mega32, what ever you like. Open page 97 (mega8), or 107 (Mega32), and what you we can see? Lots and lost of modes, or to be precise 16.
And if you look more precise and READ ALL datasheet information, you should notice that there is 8,9 and 10 bits for both Phase Correct and Fast PWM modes. I also like to note for very usefull mode 15 which alow more precise control over PWM frequency.
I know (!) and you too, this is very easy for you to support all PWM modes since this is only manipulating 4 bits on two register, and include more definitions in some files in defs folder.
So, can you consider to make PWM libraries support all modes according to MCU's datasheet?
Regards!
Mladen Bruck
Mostar