PIC Backup Camera Source Switcher for Lilliput
This has worked perfectly for over a year.
Original thread and idea here:
I am reposting as a new thread since the old started out with a cheesebox solution rather than a PIC solution.
I was able to finally get this working, it is installed in my car now. It pulses the input button once when you enter reverse and then waits for you to leave reverse at which time it pulses untill it detects that the LCD is in VGA mode
I am sceptical that the OP of this curcuit ever got his working. There were both software and hardware bugs that would have prevented his from working.
To find the VGA sensor on your LCD controller, look at this image.
This is a image of a 619 but mine was a 629 so it is a bit different. You should be able to find it with the info given though. Just use a volt meter and switch modes back and forth. I soldered onto the left side of that resistor.
Here is my final hardware version:
Schematic and PCB layout redone in PCBExpress
I have not tested this layout as I had no reason to make another board.
I did it just to see how to use the layout software.
It is a little more complicated than it needs to be and I'll list optional components as such so you can eliminate them if you want.
LM7805 (5V power supply)
C1 = .1uF
C2 = .22uF
C3 = >20pF but as close to 20 as you can get
C4 = 10uF (optional, it just stabalizes V a bit more)
C5 = .1uF (optional, it just stabalizes V a bit more)
K1 = 12V relay (dip package, get one with a diode across the coil) (Could be replaced with optio isolater (I am told))
K2 = 5V relay (dip package, get one with a diode across the coil)
D1 = 1N4148, Diode. Protects the 7805 when power gets shut off. Really needed if you use C4.
Q1 = transistor = BC547B (or similar spec)
R1 = 50K ohms
R2 = 2k2 = 2.2K ohms
R3 = 3k3 = 3.3K ohms
R4 = <40K ohms but something close to 40K
R5s = 50K ohms (each unused I/O pin gets tied to ground to prevent floating pins which can eventualy damage the PIC, each pin gets its own R5, may be optional)
R6 = 2k2 = 2.2K ohms
The R1/C3 combination are critical. They directly determine the oscilation frequency of the PIC. The original curcuit oscilated at 1Hz. Yes, 1Hz, too slow to do anything. The pic took ~10seconds to respond to input. Yeesh. This version is likely oscilating at ~266Khz.
I used a PIC16F84A but there are others that would be a better choice. Mainly, you want to pick a PIC that has no more I/O pins than you need. (I have since decided that the PIC16F676 is the best choice, the pinouts are different than the PIC16F84 though)
I did not create an etched board, I just soldered wires to each pin.
Pics of board:
You can see the programmer I used above the board.
I don't recommend this project for the faint of heart. It took me 3 weeks and tremendous work and studying to get it done. I didn't know anything about PICs and little electronics when I started and by the end I had to know a lot about both of those. If you take it on, though, I'll help you through it.
Make sure your project finds the p16f84.inc file. It is installed with your compiler.
Actual asm file (code)
Binary to burn to PIC
Test version of the code
This simply reads RA0(input) and puts RB0(output) high in response to RA0. i.e. it tracks RA0.
I used a cheap $13 PIC programmer off ebay. It worked fine/ok.
I don't recommend getting the pic from someone else and expecting it to work. That is what I was originaly thinking of doing. The problem is that you will likely need a test version of the code in your pic to debug your hardware, w/o that you may never get your hardware working.