Sougata,
Thanks for your suggestion which I will test shortly.
In the meantime, I have found a way of producing an effective 16 bit PWM output on the 18F452 by combining the PWM outputs of the two CCP1 and CCP2 channels. Both channels are driven at the same frequency, as required by the PIC specification: this is 2KHz in my system and the outputs are used to drive each of the 2 bridges in an L293 chip. CCP1 is assigned to the lower byte of the 16bit Word (and then out to bridge 1) and CCP2 to the upper byte (then out to bridge 2). The maximum current from CCP2 is set to 1/256th of CCP1 by a series resistor. The summed current from the 2 bridges is then 16bit. Easy!
Two MOSFETs could be used instead of the L293 to produce a 16bit controlled DC supply. However, in my application I need to reverse the current to produce a controlled AC. Since the polarity is being switched in this instance, we effectively have 17bit current control!
The same method could be used on any other PIC with two CCP registers.




Bookmarks