chipKIT® Development Platform

Inspired by Arduino™

max32 PWM shield?

Created Sun, 17 Nov 2013 19:02:47 +0000 by Endevor


Endevor

Sun, 17 Nov 2013 19:02:47 +0000

So I'm new to to the chipKIT boards, but I've been using Arduino boards for a while now. Have to say, I'm very impressed. My only complaint so far is the shortage of PWM pins on the max32. With the Arduino mega I always had a decent supply of PWM signals, so I never have built this, but I was curious if anyone had built a PWM shield?

I have a max32 proto board I plan on making my own I/O board for my project, and I also have 2 TLC5940NT IC LED led drivers:

http://www.ebay.com/itm/251243978439?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

I was curious if anyone had done it before or knows a schematic how to put these on a shield for the max32 so I can have access to more PWM signals?

Thanks,


majenko

Sun, 17 Nov 2013 19:27:21 +0000

The PIC32 is considerably faster than the AVR chips on the Mega, Uno, etc. When you have such a fast chip you don't need to worry too much about hardware PWM. Just do it in software.

If you have such tight PWM requirements you'd choose a chip that was geared towards PWM, such as the dsPIC33FJ128MU810, which also includes a DSP module to process the incoming signals to better control the PWM outputs.


Endevor

Sun, 17 Nov 2013 21:03:55 +0000

Maybe it'll be better to try accomplish my goal another way then. I'm running 8 led channels controlled by meanwell ldd 1000h drivers. Currently they're controlled by 8 different PWM pins on the Mega to be dimmed. Can you control the drivers through the digital pins so they still dim and if so, how?


majenko

Sun, 17 Nov 2013 21:57:06 +0000

PWM is just a digital pin turning on and off very fast. The duty cycle is the ratio of on-time to off-time.

The best way would be to use a timer to trigger an interrupt at the right time to toggle a digital pin to emulate PWM. Take a look at the SoftPWMServo library (included with MPIDE) to see how that does it.


Endevor

Sun, 17 Nov 2013 22:40:37 +0000

That worked beautifully. I didn't catch that library the first go around. Beautiful little board, I don't think I could go back to Arduino after this, haha