Alright so the underlying usage might be a bit backwards here. I have a MEGA that controls about 45 lights using 45 mosfets. The lights can be dimmed so I need to use a PWM signal to drive em with a brightness values. The reason I went with a MEGA is because the amount of pins it has on board pretty much provides enough output pins and then some to do the job. Only problem is that not all of them are PWM pins. So naturally I went with the SoftPWM library (which doesn't work on DUE's which I own about 9 of and had to use the MEGA of which I own 2, 1 already engaged in a project) Anyways. I've discovered that the soft PWM refuses to engage pins after a certain pin number (haven't tested which one yet.) In the set up, I've created a For loop which set all the pins to outputs and set all the PWM pins using the softPWM pin setup command.
So is this some sort of hardware limitation on the Mega? or is the library just not programmed to set-up about 45 PWM pins. I know all the engineering veterans are angrily slamming on the keyboards right about now, telling me that I can't use all digital pins as PWM pins. I know, sort of. I only really need to use about 7 PWM pins at once at a time. But I do need to have about 45 of them present. I'm aware of actual LED driver ICs out there, I just don't own any of them in the shop atm and the Mega has so many pins that I figured I'd try to see if that would be enough.
For the sake of testing, if I swap the PWM driving functions with a simple digitalWrite function, the pins light up, it works fine. It's just the softPWM that refuses to drive anything above pin 20 or 18 (or something along those lines, again, haven't done a definitive test). Someone said that you can code your own code in exchange for processing cycles. Something to do with tracking delta time.
Now should I not be able to do this using just the MEGA, I'll either have to settle for simple ON - OFF states or wait a couple of weeks to order some LED drivers like the TLC5940 or LM3915. And realistically speaking, if I go with these ICs, I can just use an UNO instead of a MEGA for this too.
Can I still get away with just using the Megas on-board pins? It has more than enough for me to work with.