On Fri, 5 Dec 2003, D Yates wrote: > ----- Original Message ----- > From: "harshit suri" > > I have never worked with PICs before. But do know they > > are cheap and simple > > devices to work with > > 1)Pls suggest a chip : any chip which can do the > > above. and has minimal I/o > > and is cheap :-) > > Sounds like any chip with more than 8 I/O pins could do it in some form or > fashion. 200khz of bandwidth (4x50khz) takes up only 4% of the available > instruction cycles on a pic running at 20mhz, leaving quite a few cycles to > sample your input, do some math, then generate PWM on the output. > Transferring 32 bits of resolution into the chip through a serial interface > would probably be one of the biggest time consumers, but it won't break the > project by any means. Actually, it's a little tougher than that. The 50kHz is the PWM carrier whose pulses are modulated in 256 steps. With a PIC clocked at 20MHz this routine will generate 8 8-bit PWMs with a frequency of about 750Hz: http://www.dattalo.com/technical/software/pic/pwm8.asm Now, if you reduce the number of outputs to 4, then you might can get 1.5kHz. To get 50kHz, all you need to do is overclock the PIC to 700MHz or so! :) Scott -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.