Ian McLean wrote: > A combination of 100uH and 1mF seems good to me for an "off-the-shelf" > solution, without making the inductor too big. I cannot increase the > PWM frequency much above 5kHz at this stage in the design I am using > it in, because the PIC is only running at 4MHz. That doesn't make sense. A 4MHz clock results in a 1MHz instruction rate, which must be divided by 64 to get 8 bit PWM resolution, which results in 15.6KHz PWM rate. 8 bit resolution is certainly enough for closed loop control of a Peltier cooler. Actually, 6 bits is probably more than adequate. > Unfortunately, increasing crystal speed will require a > considerable amount of code revision to adjust timing, examples being > PWM registers, serial registers, bit-bashing clocking loops, and PID > timing loops. This should not be the case for well written code. You should always have an assembly constant the specifies the clock speed, then everything else computed from that. Take a look at my UART_BAUD and TIMER2_USEC macros in STD.INS.ASPIC at http://www.embedinc.com/pic for examples of how this can be done. Hard coding divider values and other timing parameters is just plain bad practise. > However, I have almost finished a dual PIC PID controller design, > runnning at 20MHz, and using interrupt driven bit-bashing to > communicate between PICs, using one PIC as the PID controller, and > the other as the master. This setup works really well. > > PS: Olin - 1mF??? Isn't that just 1000uF? The "m" stands for "milli" meaning 1/1000 and the "u" for "micro" meaning 1/1000000. In engineering notation, one tries to keep the mantissa part so that it has 1 to 3 digits left of the point. While 1000uF does express the value, 1mF is the preferred way to write it. For some reason the standard engineering notation convention was not followed for capacitance way back when. The milli and nano ranges were skipped so that everything was either micro or pico. This led to cumbersome values like .01uF or 10000pF. Lately this sillyness is being abandoned. I make it a point to use proper engineering notation for values, including capacitance. ***************************************************************** Embed Inc, embedded system specialists in Littleton Massachusetts (978) 742-9014, http://www.embedinc.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body