> How about a PIC that moniters the horiz and vert sync, and simply > inserts its own signal into the video? Basically the psuedo code might > be the following: > > 7. wait for horiz pulse > > The PIC clock needs to synchronize to the incoming video, I was planning > to do that by using software to compare the sync pulses with the state of > the program, and output pulses to a varicap diode that adjusts the > frequency of the PIC oscillator. Anyone tried this before? Just > synchronizing the software will let the text jitter (maybe slowly, maybe > quickly) one pixel or so back and forth. Also a custom crystal would be > required. So I'd really like to synchronize the oscillator itself. Four approaches you could consider here: [1] Use a 20MHz crystal and hook /sync to /int0. This would leave you with 200ns of jitter: ugly but it would probably be okay if you're outpitting huge stuff. [2] Use the RC oscillator, with an external open-collector NAND gate tied to it; one input of the NAND should be a port pin (with a passive pulldown so the NAND's output will float while the PIC is in reset) and the other should be /SYNC. To wait for a sync pulse, the PIC can do: bsf WaitSync ; WaitSync is that port pin bcf WaitSync The first "bsf" operation will stop the PIC's oscillator until the sync pulse arives; the "bcf" will ensure that the PIC keeps running when the SYNC is done. This method would probably be good except for one thing: the PIC's RC oscillator isn't very stable without some external C, and it can't run very fast with an external C. [3] Use the PIC's RC oscillator, but use SLEEP mode to shut it off while awaiting the next scan line. Startup time may not be quite as consistent as with method [2] but provided there's a reasonable amount of time (2 or 3 clocks is plenty) for the cap to charge fully to the rail it should be good enough. [4] Use an external gated RC oscillator; these could probably be adjusted more accurately than the PIC's and run faster. This would probably be my recommendation. Note that you may elect to give the PIC some control over the oscillator speed and run it closed-cloop; I'd suggest having the oscillator reset each scan line, though, to ensure consistent phase.