well, I didn't quite understand what you mean, because I haven't tried using these techniques before.
can you put a simple schematic picture describing your idea?
this pump is the most thing i didn't understand really... the PIC pin to be connected to - terminal of the triac driver can be made, but the + terminal where to connect it? "switched rail voltage"?
I began to imagine what you mean... is it like some voltage detector ICs?
I'm interested in your idea... so please put some schematics and so. << maybe I'm tiring you with me but I can't understand everything you said ^_^
The charge pump ensures that your PIC and its software must operate correctly before critical output control signals are enabled. This kind of circuit is often used in CNC machine control done via PC parallel port, because after boot the parport signals can be all over the place before the control software is active. You don't want a big fast machine going berserk on you...
Attached is a circuit in simulation, and a virtual scope capture. What you see in the schematic is this:
- Source V1 is (your PIC) power supply, 5 V in this simulation but whatever you actually use.
- Sources V3 and V2 are simulations of the incoming pulse train. V2 is a voltage controlled square wave oscillator, control range 0-1V == 0-20kHz at 3.5 V output amplitude. V3 is a sawtooth generator producing a voltage ramps 0 to 1V in 50 ms, thus driving source V2 from 0 to 20 kHz in the 50 ms period.
- The actual charge pump is everything between, and connecting the coloured wires on top, is a virtual 4 channel oscilloscope. The trace of that one is shown in the next picture.
The charge pump works like this:
- the incoming square wave is pumped into C3 using C2 and diodes D1,D2 (google how that works). R4 is there to quickly discharge C3 when the pulses stop.
- Rising pump voltage in C3 eventually turns on FET Q3 that in turn pulls down the voltage accumulated in C1 via R3. This then turns on the P-FET Q1, causing R5 - the load - to get supply voltage.
So your opto diode anodes should be connected to FET Q1 in place of R3, and the cathodes to PIC outputs. When the output is low, current will flow through the diode, provided the pump is on.
To turn the pump on, you need to provide a min. 12 kHz square wave signal to C2 (Vin) from the PIC, generated in your code to make sure the code is actually running.
What you see in the other picture, the virtual scope trace:
- The color of the trace corresponds to the color of the connection in the schematic. Thus yellow = incoming pulse train 0 - 20 kHz, green is the Q3 drain voltage, red is Q1 gate voltage and blue is the actual pump output.
- All traces are 5 V / div, each offset 5V from the next to make the picture clearer. So all signal swings are actually 0-5V in their "lanes". The X direction is 10 ms/div. So you can see almost 2 complete cycles of the V3 driving generator.
- The frequency (yellow) increases linearly from 0 to 20 kHz during one cycle of source V3. You can see that at 30 ms point in the trace, the blue output voltage is fully up, and at that point the input frequency will be at 12 kHz (since it is a linear ramp).
- At 50 ms the Source V3 output drops to 0, as does the pump input frequency. You can see that the pump output drops to 0 volts almost instantly. Then the cycle begins again. This means that the pump must be driven by a square wave of at least 12 kHz to enable the output. Make the FET Q1 a robust one and it can supply most circuits where this kind of safeguard is needed.
Clear? If not just ask and i will give more details.