Multiple PWM

Go To Last Post
13 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just wondering if anyone knows of a IC that has multiple PWM outputs (ie>=12)? (not the Phillips PCA9530 range)

I know PWM can be generated by software, but the processor I'm using already has to deal with a continuous 250k DMX signal (which sends the PWM information). So the less the processor has to do other stuff the better (let alone software PWM).

I thought perhaps a chip that can do something like this could be used in the control industry? Mabey someone from that field could have some suggestions?)

Next to this I was thinking that using 2 microcontrollers could be the best option- 1 for DMX RX and one for PWM generation. Perhaps getting them to talk to one another on the i2c bus.

250kDMX===>[ATMEGA8(DMX)][ATMEGA8(PWM)]

What do you people think?

Look foward to some suggestions.

oddbudman.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

you could also create the PWM's using a CPLD.

I'm sure you can find PWM IC's out there, but I would be surprised if you found anything above a quad in a single package. That's not to say that they don't exist.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"anyone knows of a IC that has multiple PWM outputs (ie>=12)?"

I've done 16 level lamp dimming at 60 hz in sw... you just need a 60x16 interrupt (960 Hz, 1.04 ms). Interrupt counts 0 to 15, turn all outputs off on 0, each tick turn on any outputs that have their dimming level set to the tick count.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"anyone knows of a IC that has multiple PWM outputs (ie>=12)?"

I've done 16 level lamp dimming at 60 hz in sw... you just need a 60x16 interrupt (960 Hz, 1.04 ms). Interrupt counts 0 to 15, turn all outputs off on 0, each tick turn on any outputs that have their dimming level set to the tick count.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you doing PWM, or mains AC dimming? If you're doing real PWM, then the serial interconnect sounds really good. With SPI or I2C, the trick would be that the PWM chip would ask for instructions when it's not too 'busy'.

For AC, I did 16 level dimming in SW for 16 channels in SW on an 8051 (~1 MIPS), while receiving DMX. Since the Mega8 is 16X faster, I suspect you'll actually have plenty of time. On the 8051, my biggest limitation was RAM (because I used tables to achieve speed).

I received the incoming DMX on RX interrupt. (After BRK, I tested the first byte, then skipped the first N-1 bytes, then captured the next 16 bytes where N is the first channel that belongs to 'me'. Then I skipped until the next BRK.) So I stuffed only the bytes I wanted into a 16-byte buffer without further processing. Those bytes got processed later on a time-available basis. The post-processing built a 32-word table of values for the 16 triac output bits. These were output as pairs of bytes to the ports every 8.33/32 mS (about 260 uS) on a timer. As with my philosophy about interrupts, the outputting of data was all that the routine did.

The post-processing acted continuously on the incoming data, even if there weren't any changes. The incoming data overwrote the old data without telling anyone. The same principle applied to post-processing; the table was continuously rebuilt even if nothing ever changed.

If the DMX would have been sent at full speed without any gaps between frames, the post-processing would have gotten behind (without crashing I hope)... but I'm told nobody actually drives DMX without gaps.

I think I saw a standalone one channel (8-pin) DMX chip for sale on the net; matching pinouts etc. revealed it was probably 3C509.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To clarify things,

I am dimming LEDs, so it is DC switching application. Basically just switching 24vdc from the pwm outputs via some transistors :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would go with the extra AVR solution. But that's because I already have made a software 20 channel, 256 level, 100 Hz PWM in a single Mega8.
It does load the Mega8 (@16MHz) quite a bit, but there shoule be plenty of time for some communication with another AVR.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've just read the last post (the LED dimming thing). I am using my 20 channel PWM for the exact same thing. Take a look here for what I've used it for (especially the video clip):
http://www.ejberg.dk/foglight/in...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Todd!
I did multiple PWMs in software on 2313 at 8MHz. I think it's possible up to 8 channels. In case of ATmega8 at 16 MHZ the number of channels will be 2 times more.
Regards!

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There should be no problem to receive DMX beside a software PWM, since the UART was 3 times buffered.

I see no advantage, to insert an additional data bus to a second AVR. In opposition, this schould it only make more complicated.

Peter

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What else will the processor be doing?

At 16 MHz, there are at least 704 instructions between received DMX bytes. If you PWM at 100 Hz and 256 different levels, there will be 625 instructions between timer ticks.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I believe that some of the newer TI DSPs have 12 PWM outputs.
boB

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I usually suggest using a http://www.al-williams.com/pak5.htm PAKV coprocessor.
It's easy to interface to using simply TTL serial data. It runs up to 8 PWM channels for you. I think he uses Scenix/Ubicom processors that run at 50mhz for this.
A more advanced system is to use a www.newmicros.com ISOPOD which can run up to 26 PWM channels, should you want even more than 8. The ISOPOD uses a DSP processor that runs at 80mhz, which gives it really good performance.