Funny, I was just thinking about something like this... WARNING! This will most likely be another of my weird, half-assed, screwy ideas that has some fatal flaw. I was remembering some work done by http://www.teslaco.com where they combined a buck and boost stage into one unit with a coupling cap and a special inductor and got 90 percent efficiency and virtually eliminated ripple. Worth looking at anyway. I think that you can just connect one input of the comparitor on an SX18 (or any of the PIC processors with a comparitor built in) to a reference (input waveform, zener diode for constant voltage reference, or to the output of a small DAC from the PIC) and the other to a resistor ladder (possibly a pot for variable gain) which scales down the output of the inverter to a 0-5v level and use the output to switch the mosfets. The advantages are: 1. the PIC can measure the relative on-time to off-time and average that to monitor the amount of current being drawn by the load for overload protection. 2. the frequency of the ISR that updates the output based on the comparison at a regular interval can be tuned to match the transformers over varying loads and gains (since real world inductors do not respond equally over all current variations). 3. A DAC generated waveform would allow the PIC to function as a variable gain, high current, fsk function generator, extending the concept layedout in Tom Napier's article "Digital Frequency Synthesis" http://www.edtn.com/embapps/emba057.htm in issue 99 (October 1998) of Circuit Cellar INK and adapted to the SX by Richard Ottosen http://www.brouhaha.com/~eric/scenix/sxnco/ 4. the ability to switch the reference between an external waveform, an internal reference voltage and a DAV would allow the same device to function as an amplifier, current monitoring power supply and function generator. The "Magic Sinewave" stuff from Don Landcaster http://www.tinaja.com may also apply. End wacky ramblings. James Newton, webmaster http://get.to/techref jamesnewton@geocities.com 1-619-652-0593 phone > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Glen > Sent: Friday, July 09, 1999 10:33 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: monitoring current > > > hi , thanks for your time. > > i have an inverter ( supplied by 4x4ah d cells)which i would like to > monitor the current drain . > the circuit is push/pull (centre tap primary) with 2 mosfets switching > alternatively.(35-45khz) > originally i was going to put a sense resistor to gnd & read each > current pulse as a voltage drop across it. > i was going to use a controller ic , like an LM3524 but there are some > ather things i want to add to it. > i don't want to start having a lot of discreet components so i would > rather use a pic instead to do the lot. > -switch the mosfets > -monitor the primary current > -a few other pins to do the other tasks ! > > i am aiming for a current drain of about 2A so that i can get the unit > to operate for about 2 hrs > > problem is that with battery vdc = 4.8v .the voltage across the sense > resistor would have to be small & hence an op amp needed. > > what is the best way to attack this problem? > what would be a good pic to use ? > whats the best way to monitor the current in this situation? > an a/d converter would be good as i would like to have a reasonable > accuracy. > the pic doesn't have to have an a/d converter as i could just dedicate a > pin & use some code > Is this feasable? > using one sense resistor to gnd seems the easiest way but i don't > particularly want to use an op amp !? > i appreciate your input > thanks > glen >