[quote author="ian"] I tested this by drilling the trace from the CPLD to the transistor to remove it. It did change the behaviour: OLD) LED on dimly until target attached, then on bright forever NEW) LED off until target attached, then on bright forever
I think it is coming from the bank power supply pin. I read 0.62 volts at the transistor base (target power supply) after power on. [/quote]
That sounds a lot better.
The base/emitter resistor is too large, change it from 100 k to 10k, the base resistor should be increased to 22k.
Right now, the CPLD pin is providing a weak connection to ground, causing current to flow through the LED, bypassing the transistor. By adding a diode between CPLD pin and the collector (like this: CPLD_Pin--->|----collector) this path is blocked and the LED will only light up when a target is connected.
IR receivers similar to the TSOP17xx series can be found in most infrared remote controlled consumer electronics, maybe you can salvage these parts from electronics junk.
You are using AVR-GCC, I guess? You need a wrapper function to handle the data transfer to the UART for printf() to work. There is an example in the avr-libc documentation, copy&paste it.
At the bottom of the page is a simple charge pump, it produces a negative auxilliary voltage to power the opamp. It needs to be driven by a toggling GPIO pin. It needs no further software, we'll only need to setup a timer during startup to toggle a pin at a few 10s of kHz.
The circuitry around the opamp forms a differential amplifier, which allows us to use the MIC5205 voltage regulator for voltages close to 0 V (usually the minimum voltage would be 1.242 V). The two diodes in series form a basic voltage reference, giving approx. 1.2-1.3 V.
The voltage is set by the MCU using PWM, which is filtered to obtain an adjustable voltage. Please note, the voltage control is completely done by the MIC5205 voltage regulator, the PIC just commands the output voltage, so there is no need to implement a control loop in software.
With this circuit the voltage range is 0-5 V.
One half of the LMV358 is unused and could be used in the second power supply channel, the 2 diode-voltage reference and the charge pump are only needed once can be reused as well.
My circuit is not based on a switch mode converter, it will use the MIC5205 by feeding a control voltage into the ADJ input. The control voltage is produced using PWM and a low pass filter.
OK, when hardware design is nearly ready for production it's not a good moment to add this and start all over again. I will draw up some schematics and post them here.
how about adjustable power supplies for the target section in BPv4?
It's quite easy to accomplish, all we need is a dual rail-to-rail opamp, some resistors and capacitors and two GPIOs with PWM output. When using the MIC5205 in its adjustable version, the minimum output voltage would be 1,24xx V, by adding two diodes, two capacitors and one additional GPIO pin toggling at a few 10 kHz to build a charge pump based voltage inverter we could even have adjustable power supplies starting from 0 V.