> -----Original Message----- > From: Roman Black [SMTP:fastvid@EZY.NET.AU] > Sent: Wednesday, December 20, 2000 3:57 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: fast easy DAC with PIC > > Hi, I need to implement 2 DAC with one PIC, > preferably a 16F84, and I need reasonably > fine resolution, at least 64 levels, pref > 128. > > I have tried the PWM options, but I need more > speed, like the ability to adjust from full > to zero output 32,000 times/sec. Using 20MHz > PIC and home made PWM I can't even come close. > > So, any suggestions on getting 2x analogue > output from a small PIC at high speed?? > :o) > -Roman > Hmm..quite a high bit rate. If you use (say) an 8 bit SPI DAC, readily available in dual packages this will work out to 8 x 2 x 32000 = 512kbits/s. Most SPI DACs will be easily able to handle this. I wrote a bit bashed SPI routine in HiTech C and using 20Mhz clock gave around 700Kbits/s. Even assuming this could be optimised in ASM, you aren't going to have an awfull lot of CPU time left for anything else. If you choose a PIC with an SSP module you can offload a LOT of cpu time. A lower resolution DAC woul eas the problem slightly, but I'm not aware of anything below 8 bits with an SPI interface, maybe someone else does? A better solution would be you use a straight parallel DAC if you can afford the pins. Mike -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.