It also makes it near impossible to get through FCC because you have a very wide band of frequencies to annihilate. Andy Roman Black on 12/27/2000 02:32:27 AM Please respond to pic microcontroller discussion list To: PICLIST@MITVMA.MIT.EDU cc: (bcc: Andrew Kunz/TDI_NOTES) Subject: Re: [PIC]: fast easy DAC with PIC From: Dan Michaels Roman Black wrote: > >My new design is up and running, and getting 150kHz >2 channels with a 16F84. And rock solid! :o) >-Roman > how many bits of resolution? [4, maybe :)] Actually, resolution is very good, similar to 10bit for my purposes. Everyone thinks FIXED FREQUENCY when they think PWM. It was just that type of limited thinking that stumped me for 4 days on what was essentially a two hour job. My PWM is generated by tight hard coded loops. Since it is filtered by RC circuit the freq is NOT important, as long as it is above about 100kHz. My slowest loop is about 150kHz, the fastest about 250kHz. Being able to adjust the ON and the OFF period each as a separate hard-coded few cycles, means you can get very fine PWM adjustment with only 35 cycles or so. Each hard coded loop runs both phases of the stepper motor, and even runs all 4 h-bridge drives so I have almost no external circuitry needed. Some people might initially think that varying PWM AND frequency to get the exact ratios might sound like butchery, but why not do it? It allows very fast PWM frequencies and very fine adjustment with quite a crude PIC. :o) -Roman -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu