Boost converter using a PIC16F1503? - Page 1
Forum section: electronics / general

author: void_error
author_rank: Frequent Contributor
timestamp: January 02, 2017, 06:55:41 am
content: I'm hacking one of those 10W LED projectors to have adjustable brightness so I can use it as a bench light which means ripping out the 230V AC input current source SMPS and building a 12V input boost converter as the 10W LED has 9 series LEDs.Because the space for the electronics is limited - roughly 40x70mm - and I don't want to design and etch a PCB I'm planning to build it on a protoboard which means mostly through-hole parts except maybe a few passives. I also want to control the brightness using two pushbuttons and have undervoltage lockout and switch current limiting.What's the best approach using the PIC's built-in hardware modules? I might have room on the board for an extra dual comparator too if needed.Datasheethere.

author: JPortici
author_rank: Super Contributor
timestamp: January 02, 2017, 07:29:21 am
content: stop right there!use 16f1823 for developement. same part, but with integrated debugger. you'll thank me later.if you check the 16f177x series page (for example: 16f1776) you'll find a lot of app notes on the subject

author: void_error
author_rank: Frequent Contributor
timestamp: January 02, 2017, 08:01:28 am
content: I've previously used the 16F1824 & 1825 with the debugger but for a completely different application which allowed freezing code execution, so I think I'll be just fine without an integrated debugger as long as I use a GPIO pin as a debug output and scope it with my crappy analog scope. Can't stop the code execution here because i'll probably blow my mosfet up.Found one of theapp notes.Perhaps I should switch to the16F1704? It has 2 op amps which might make current sensing a bit easier. I'm quite clueless here.

author: void_error
author_rank: Frequent Contributor
timestamp: January 02, 2017, 11:55:27 am
content: I've been screwing around with MCC (nope, I'm not going to use it to generate code) to see what could be done with a 16F1704 and here's what I managed to come up with so far:Use two ADC channels to monitor input voltage (for UVLO) and output voltage and maybe trigger the conversion using one of the available timers.Use one of the op amps to amplify the voltage across the switching MOSFET's current sense resistor and feed it into one of the comparators which will be used to trigger the auto shutdown of the COG module used to drive the gate. This comparator will have the other input connected to the internal voltage reference.The other comparator will be used for the constant current loop regulating the current through the LED, monitoring the voltage across a low-side shunt while having its other input connected to the DAC output internally.I'm wondering if I can assign the same pin to both the op amp output and comparator input, that would be handy.Does this look like it's not going to work?EDIT: Might use the CLC module too if I want the COG auto-shutdown to be triggered from multiple sources which might result in a simpler control loop.

author: void_error
author_rank: Frequent Contributor
timestamp: January 03, 2017, 12:44:56 pm
content: After more screwing around trying to find a solution to avoid some unpleasant situations where the MCU might get powered via the input protection diodes I decided to go with buck-boost converter. This means one extra MOSFET and diode.I also settled for the 16F1704 and UVLO and switch current limiting will be using the comparators while the CV (output voltage limit) and CC (LED constant current more) will be using the ADC.This might seem overkill but look at it as a learning exercise.