NXP LPC804 PLU Step Up Converter

Topics in this post will be:

  • Step up (Boost) voltage converter with PLU and analog comparator.
  • KISS specification to describe state machines.
  • A state machine will be used to drive the step up converter.

Step Up (Boost) Converter

A step up converter circuit generates a higher voltage out of a given lower voltage. This circuit is controlled by an input signal: As long as the input signal toggles between 0 and 3.3 Volt (in this case), then the output voltage will increase. If this signal is 0 Volt, then the step up converter output voltage also drops towards 0 Volt.

The output voltage can be controlled by monitoring the output voltage and applying either this alternating or constant 0V signal.

PIO0_9: The LPC804 PLU subsystem will generate the alternating/constant signal for the step up converter.

PIO0_1: The LPC804 analog comparator input which will monitor the generated voltage.

Schematic for the LPC804 Step Up (Boost) Converter

Details on the Step Up Converter

For this step up converter example I have just used components, which I already found in my lab. Goal was to light up three LEDs in a series connection. This requires at least 6V (each of the three LEDs has a forward voltage of 2 Volt), which must be generated out of the available 3.3V.

The step up core circuit contains the 330uH inductor, the rectifier 1N5818 and the MOSFET IRLU120N. This circuit does not measure the output voltage after the 1N5818, but instead measures the current through the LEDs. This current should be 20mA (or lesser) and is measured with the 22 Ohm resistor (see above picture). The expected voltage over the 22 Ohm resistor must not be higher than 20 mA * 22 Ohm = 440 mV. The 1 kOhm and 1 uF is a lowpass filter so that the LPC804 can read the voltage more reliable via analog comparator at PIO0_1. The PLU output signal at LPC804 PIO0_9 is directly connected to the gate of the MOSFET. During startup of the LPC804, all GPIOs are configured as high with weak pull up resistors. The pulldown 10kOhm resistor at PIO0_9 instead will ensure a logic 0 level so that the MOSFET is switched off during reset and startup of the LPC804.

LPC804 Step Up Converter (Prototype)

State machine for the step up converter (KISS format)

  • Change conditions and output values are described with a sequence of 0 and 1 values in the KISS format.
  • For the state graph, the output value is written in the blue disc, the KISS format expects the output value for each transition.
  • A KISS machine can go from one state to another state without condition (this is the biggest difference to the BMS format mentioned in the previous posts). However, this requires extra care, because the KISS format expects, that the condition is precisely described under which the state machine stays in a particular state (see the “idle” state in this example).
State Machine for the LPC 804 PLU Step Up (Boost) Converter

The step up converter receives an alternating signal as long as the output of the LPC804 analog comperator is 0 (the current is too less for the LEDs): The state machine will jump between HIGH and LOW states, increasing the voltage and the current for the LEDs. If the current is high enough, the output of the analog comparator will be 1 and the state machine will go to the IDLE state. The IDLE state will deliver a constant 0 output and the MOSFET is constantly turned off: The step up converter will stop working and the current will decrease until it goes beyond the analog comparator threshold. The comparator output will become 0, the state machine goes back to HIGH and the alternating signal will increase the current again.

The KISS file for the above state machine will look like this:

.ilb acomp
.ob mosfet
.r idle
0 idle high 1
0 high low 0
0 low high 1
1 high idle 0
1 low idle 0
1 idle idle 0
  • “.ilb” command: Space separated list of input signals for the state machne
  • “.ob” command: Space separated list of output signals
  • “.r” command: The name of the inital state (reset state)
  • Each line describes a transition from one state to another state. It is a sequence of the input condition, the source state, the destination state and the output values.
  • The input condition is a list of “0”, “1” and “-” chars in the same sequence as described by the “.ilb” command. The input condition is a logical “and” of all values which are not “-“.
  • For this example the input value “0” just means “acomp is equal to 0”
  • The output is described as a list of “0” and “1” values for all the signals given in the “.ob” command.
  • The output value “0” in the above example means: Assign “0” to the “mosfet” variable (which will be the gate input signal of the MOSFET).

A BEX file (see previous posts) is used to connect the state machine to the LPC804:

PIO0_9 <= mosfet;
acomp <= COMP0_OUT;
PLU_CLKIN <= CLKOUT;

“pluc” can connect the comparator output to the state machine (“acomp <= COMP0_OUT;”), but it can not connect the GPIO PIO0_1 as input to the comparator. This has to be done manually in the code: “LPC_SWM->PINENABLE0 &= ~ACMP_I2;”.

The generated state machine will be clocked with a 50kHz signal, which is derived from the 1 MHz low power oscillator. The options for “pluc” will be:

-lposc  -clkdiv 20

Analog Comparator

“pluc” will setup the plu with the state machine and will also connect to the analog comparator output. This is the remaining setup for the analog comparator (which has to happen in the C code):

Enable_Periph_Clock(CLK_ACMP);     /* enable clock */
LPC_SYSCON->PDRUNCFG &= ~ACMP_PD;  /* power up analog comparator */
LPC_SWM->PINENABLE0 &= ~ACMP_I2;   /* enable ACMP input at PIN0_1 */
LPC_CMP->LAD = 1 | (2<<1); /* compare against 2*3.3V/31 = 0.213V */
LPC_CMP->CTRL =
    ( 1 << COMPSA ) |	           /* sync with bus clock */
    (ACOMP_IN2 << COMP_VP_SEL) |   /* positive input */
    (V_LADDER_OUT << COMP_VM_SEL); /* negative input */

Conclusion

  • The implementation of a step up converter only requires the analog comparator and the PLU.
  • The KISS state machine description format can be used to generate suitable signal waveforms.
  • This example is available on github here.

Next post: NXP LPC804 PLU WS2812b Controller

One thought on “NXP LPC804 PLU Step Up Converter

Leave a comment