Universal PIC switchmode status report
I wrote a large part of the software, much could be just cut and paste from other projects, like swr_pic:
This adds the following functionality to the 'universal PIC PWM controller'. LCD display with:
1) input voltage 2) output voltage setpoint 3) output voltage 4) output current setpoint 5) output current 6) real time clockThe clock can be used in software to make for example a battery charger timer, etc.
3 free pins for for example: menu select, up, down. That is enough to do most things.RS232 interface, typing 's' shows all parameters. setpoints can be set via RS232 Setpoints are automatically saved to EEPROM when changed. Manual setting of PWM possible (overrides anything, be careful, just for testing perhaps).
So, that is the software side, the PIC is a 16F690. The software will be published on my site when usable, still have to do the feedback and current limit. The LCD is not needed, just RS232 will do, you can either comment out the 'define USE_LCD' in the asm, or connect a pin to ground to simulate 'LCD ready' Or you can program it one time with the required values for output voltage and current limit, and use the PIC stand alone.
So, now the hardware.
Joerg was so kind to publish a SEPIC design here yesterday, and after looking at that, I thought: 'Why not make this universal PIC controller a SEPIC, as then I can make any voltage (well almost) from any input voltage.' Already started thinking about a new name for the project, like SE-PIC, or SEPIC_PIC or PIC-SEPIC, or even SEE_PIC :-) But I already made directories and files with 'power_pic', so the source is called pwr.asm. _But_ that SEPIC design has *2* inductors. I looked and thought: 'Why not use a transformer, 1:1', (and actually the SEPIC design solves the problem of switching in the negative too, as the ground is simply ground, good for in the car), somebody must have thought of that too', so I typed 'SEPIC 'transformer' in google, and it turned up some nice links, and THIS one really set me going:
Now there is one remark this person makes:
One simplification is to use a 1:1 transformer, such as a low-cost, commodity, common-mode power-line input-filter choke, < end quote>
So, yesterday I had this old PC supply, that I use for scrap parts, and noticed that transformer / choke. I thought 'shall I take it out?', but I cannot do anything with it, reluctantly put it back carefully. SO, after reading that remark, went back, soldered it out, put the PIC in the programmer, it already has the RS232 interface, programmed it, 100% OK first time, tried to set the PWM, worked first time, got the scope, looked at the pulses, OK first time.
Wired up that little mains filter as transformer, connected a fast schottky rectifier, the MOSFET, a filter cap, and the SEPIC coupling cap, and a 4W 12 V lightbulb, and 12V DC for test. Worked first time ! ftp://panteltje.com/pub/power_pic/pwr_pic_pwm_20_img_0876.jpg
More images at: ftp://panteltje.com/pub/power_pic/ The toroids at the top are the ones I did not need for this :-) And the board on the left is the 'noppp' (modifed) PIC programmer, the PIC does not leave the programmer until the project is complete, grnd, PWM, and other control signals simply soldered on the PIC.
This is a fun project. Where are you now, dedicated expensive chip manufacturers, do you have a LCD driver, do you have RS232? Do you have EEPROM?
I love it when a plan works (stolen from the A team). Ich liebe es wen ein Plan funktioniert!