Thought I'd drop in as I'm making a copper jellyfish with four banks of LEDs that need PWMing... and all I have in my toolbox is a 20X2, a 20M2, and some 08M2s. THe four banks operate LEDs on the tentacles, and I want them to pulse at different rates, rather than all fading up and down together.This is a diagram I created of how the 28X2 PWM / HPWM single mode configuration is -
HPWM is not a PWM generator in its own right, but a router for PWM#4. PWMA-PWMD can be individually enabled, allowing up to four things to be separately controlled, but what is output on PWMA-PWMD comes from the same PWM#4 source.Code:.--------. | PWM #1 |--------------------------------> B.0 `--------' .--------. | PWM #2 |--------------------------------> B.5 `--------' .--------. | PWM #3 |--------------------------------> C.1 `--------' .--------. | PWM #4 |---.----------------------o `--------' | .---. \o---> C.2 | | |---> HPWMA ---o |___| |---> HPWMB ---------> B.2 | |---> HPWMC ---------> B.1 | |---> HPWMD ---------> B.4 `---'
It is like a car with a single engine and a clever selector which can drive just the front wheels, back wheels, both front and back together, or none. Each set of wheels is separately controlled, front and back can be driven or not, but both sets of wheels cannot be driven at the same time at different speeds.
Also, when HPWM mode is not used, C.2 is driven by PWM#4. Once HPWM is enabled, PWM#4 (PWMOUT C.2) is no longer available because PWM#4 is allocated to HPWM use.
Hence the description that not all of the PWMOUT channels are available when HPWM is used; N x PWMOUT, or N-1 x PWMOUT + HPWM.
Sounds like my cheeky get-out-of-jail with the four x HPWM on the 20x2 isn't going to work... a bit wasteful, but I guess I could use one 08m2 per bank??