
From the design, we know the output voltage of the boost converter's given by:

So for the tens of volts we want to drive the VFD with, we want duty cycles around 0.6 to 0.82. All well and good. We also know that the switch in the boost converter's driven directly by the microcontroller off pin 12 (PD6) off the microcontroller. So we look in the code and we find that pin 12 on the microcontroller is OC0A, and controlled by fast PWM:
- Code: Select all
// fast PWM, set OC0A (boost output pin) on match
TCCR0A = _BV(WGM00) | _BV(WGM01);
// Use the fastest clock
TCCR0B = _BV(CS00);
TCCR0A |= _BV(COM0A1);
TIMSK0 |= _BV(TOIE0); // turn on the interrupt for muxing
Great. Only problem is we don't appear to be driving that pin with that duty cycle. The duty cycle of FPWM is controlled by OCR0A and is given by D = 1 - OCR0A/TOP (because the HEXFET conducts when it's LOW, not high) where TOP is always 255 in fast PWM:
- Code: Select all
if (brightness <= 30) {
OCR0A = 30;
} else if (brightness <= 35) {
OCR0A = 35;
} else if (brightness <= 40) {
OCR0A = 40;
} else if (brightness <= 45) {
OCR0A = 45;
} else if (brightness <= 50) {
OCR0A = 50;
} else if (brightness <= 55) {
OCR0A = 55;
} else if (brightness <= 60) {
OCR0A = 60;
} else if (brightness <= 65) {
OCR0A = 65;
} else if (brightness <= 70) {
OCR0A = 70;
} else if (brightness <= 75) {
OCR0A = 75;
} else if (brightness <= 80) {
OCR0A = 80;
} else if (brightness <= 85) {
OCR0A = 85;
} else if (brightness <= 90) {
OCR0A = 90;
} else {
OCR0A = 30;
}
All this is in the design already, and I think I understand it. Here's the problem: When I increase the brightness, the duty cycle decreases, but the output voltage of the boost converter and the commensurate brightness of the VFD increases.
What am I missing?

