Microchip Technology Inc
Menu

PIC12F752 AC/DC LED Driver (Proof of Concept)

Design Highlights:

AC/DC Flyback Power Supply
  • ~85% Efficiency
  • 90 VAC – 240 VAC Input
    • Single hardware platform
    • Firmware based configuration
  • 20 VDC / 375mA Output
PIC12F752-ACDC-LED-Driver-400x267

Click image to enlarge

PIC12F752 Controlled Topology

  • Core Independent Peripheral Integration
    • 5-bit DAC
    • Complementary Output Generator (COG)
    • High Performance Comparators
    • Hardware Limit Timer (HLT)

MCP1416 FET Driver
TRIAC Dimmable

Theory of Operation

This proof of concept design is a critical conduction, peak current mode flyback power supply with PFC.

  1. The system begins to run as soon as the bootstrap voltage rises above 5V turning ON the MCP1416 FET driver.
  2. When the voltage is high enough the PIC12F752 initializes the HLT, COG, DAC and comparators as shown in the system diagram.
theory-of-operation-720x509

Click image to enlarge

Tabs / Intelligent Lighting & Control
Products
Documents
Software
Development Tools

The software in this section is subject to the U.S. Export Administration Regulations and other U.S. law, and may not be exported or re-exported to certain countries or to persons or entities prohibited from receiving U.S. exports (including Denied Parties, entities on the Bureau of Export Administration Entity List, and Specially Designated Nationals).

Application Notes

Document Number Title
AN1138 A Digital Constant Current Power LED Driver
AN1050 A Technique to Increase the Frequency Resolution of PICmicro MCU PWM Modules
AN239 Bit Banged LIN Slave Node for PIC16 & PIC18
AN874 Buck Configuration High-Power LED Driver
AN1476 Combining the CLC and NCO to Implement a High Resolution PWM
AN1487 DALI Control Gear
AN980 Designing a Boost-Switching Regulator with the MCP1650
AN1035 Designing with HV Microcontrollers
AN1465 Digitally Addressable Lighting Interface (DALI) Communication
TB094 Dimming AC Incandescent Lamps Using A PIC10F200
AN1261 Dimming Power LEDs Using a SEPIC Converter and MCP1631 PIC Attach PWM Controller
AN948 Efficiently Powering Nine White LEDs with the MCP1650
AN1427 High Efficiency Solutions for Portable LED Lighting
AN1211 Maximum Power Solar Converter
AN1271 Offline Power Converter for High-Brightness LEDs Using the PIC16HV785 Microcontroller
AN1074 Software PWM Generation for LED Dimming and RGB Color Applications
AN1074-Setup Software PWM Generation for LED Dimming and RGB Color Applications
AN954 Transformerless Power Supplies: Resistive and Capacitive
AN-H48 HV9910B: Buck-based LED Driver
AN-H50 HV9910B: Constant, Off-time, Buck-based LED Driver
AN-H64 Compatibility and Functional Differences between the HV9961 and HV9910B LED Drivers
DN-H02 Isolated Constant Power Converter Using the HV9922
DN-H03 Alternate Use of the HV9922 as an Off-line, Non-isolated, 50 to 100 mA Auxiliary Power Supply
AN-H51 Designing a Boost-Buck converter with the HV9930
AN-H58 Improving the Efficiency of a HV9930/AT9933 Boost-Buck Converter

The software in this section is subject to the U.S. Export Administration Regulations and other U.S. law, and may not be exported or re-exported to certain countries or to persons or entities prohibited from receiving U.S. exports (including Denied Parties, entities on the Bureau of Export Administration Entity List, and Specially Designated Nationals).

Software

Title Document Type
DALI Code Library and Demonstration Code Software
DMX512A Code Library and Demonstration Code Software
Lighting Communications Development Platform Highlights & Demonstration Overview Collateral
Lighting Communications Development Platform Schematics Software
Lighting Communications Development Platform Users Guide Collateral
MiWi™ Wireless Networking Protocol to WiFi® Gateway DemonstrationKit (DM182018) Software
MiWi™ Wireless Networking Protocol to WiFi® Gateway Lighting Demonstration Code Software
PIC12F752 AC/DC LED Driver Demonstration Code Software
PIC12F752 AC/DC LED Driver Schematics Software
PIC16F1508 DALI Dimmable Fluorescent Ballast Demonstration Code Software
PIC16F1508 DALI Dimmable Fluorescent Ballast Schematics Software
PIC16F1509 Solar Powered LED Security Lamp Demonstration Code Software
PIC16F1509 Solar Powered LED Security Lamp Schematics Software
PIC16F1788 Wireless DC/DC LED Driver Demonstration Code Software
PIC16F1788 Wireless DC/DC LED Driver Schematics Software
PIC16F1947 Lighting Control Console DALI Demonstration Code (coming soon) Software
PIC16F1947 Lighting Control Console DMX512 Demonstration Code Software
PIC16F1947 Lighting Control Console Schematics Software
Stand-Alone RGBW Demonstration Code Software

Select:

  1. The Hardware Limit Timer (HLT) emits a pulse train at 50 kHz setting the output of the COG high. This pulse train is interruptible by the reset input. The HLT starts the power supply in the absence of a zero current pulse from the comparator. Reference the PIC12F752 datasheet for more details.
  2. The HLT sets the COG which drives the transistor ON allowing current to flow from the supply through the primary side of the inductor. In the case of a leading edge (TRIAC) dimmer this current may simply be biasing the TRIAC but not enough current to trip the peak current comparator.
  3. Eventually the current rises to the comparator trip point set by the resistive DAC. In the case of a TRIAC dimmer, the TRIAC finally conducts and the current rises quickly. The resistive DAC is attached to the supply voltage so that the DAC set point (peak current set point) follows the supply voltage forcing the peak current to be synchronized and proportional to the voltage – this is the active PFC function.
  4. When the peak current is reached the COG is turned OFF. The COG has a pair of comparator blanking timers that count off a few clock cycles to prevent switching noise from causing a false trigger.
  5. When the primary is turned OFF the voltage in the secondary and the bias rise until the primary current is able to be transferred into the secondary.
  6. The peak voltage on the bias is generally proportional to the peak voltage on the secondary. The diode/capacitor circuit captures and filters this peak voltage and presents it to the ADC so the firmware can regulate the output voltage.
  7. As the current in the primary falls the voltage at the bias will drop until a zero volt crossing occurs at zero current. The zero volt crossing triggers the next rising edge on the COG, resets the HLT and the process repeats at step 4.
Reducing the voltage at the supply will reduce the peak current set point at the ADC and reduce the power delivered unless the DAC is adjusted to compensate. Phase cutting the supply voltage will also reduce the power delivered unless the DAC is adjusted to compensate.

Regulation Algorithms

  • The simplest regulation for this design is simply to use feed forward to set the DAC at a level appropriate for the average line voltage. If the DAC value is fixed at a suitable level then dimming is "free" and requires no firmware.
  • If the line regulation is sloppy and feedback is required a simple PI control can be implemented to adjust the DAC to maintain a voltage on the secondary. DAC adjustments required every few zero crossings so the computational performance is not a limiting factor.
  • Phase Cut or supply voltage adjustments need to be factored into the regulation as a feed forward term. This will allow the regulation set point to be adjusted to account for specific dimming behavior.
  • When dimming below 10% a cycle skipping algorithm may be required to minimize flicker while transferring the very low power levels into the LED's.
  • PFC is affected by the EMI filter. Be careful in the EMI filter design so that the filter does not cause an undesirable phase shift in the voltage applied to the DAC.
  • The bootstrap supply and the snubber can be more efficient if they are optimized for the supply voltage in a given region. The TVS snubber causes audible noise in the transformer so that may be undesirable in some applications.
  • The ADC can also be used to measure the voltage applied to the top of the DAC. This is used to determine the phase cut angle, zero crossing, and peak voltage for feed forward

Contact your local sales representative to see a working demonstration of the AC/DC LED Driver.

For comments or suggestions on Microchip's Lighting Solutions - please email us at lighting@microchip.com