CPU pin out
Here's the plan for a 40 pin DIL cpu:
CPU Pin Id Ext Pin Description Polarity
1 MCLR CPU reset and programming volts. This is problematic as the original system provides a nice reset line but this won't buffer into the programming voltages very well. It may just end up with a 10K resister to Vcc and a push to boot switch. 0 = Reset
2 AN0 23 Analogue input. Front Right height sensor. offset, inverted and amplified
3 AN1 5 Analogue input. Front Left height sensor. ditto
4 AN2 22 Analogue input. Rear Right height sensor. ditto
5 RA3 It is an Analogue input but it is also used as a light output by the USB programming system so I drive LED1. 1 = LED on
6 RA4 ditto driving LED2. 1 = LED on
7 AN5 4 Analogue input. Rear Left height sensor. offset, inverted and amplified
8 RE0 32 Digital input. Ride height switch 'UP' switch. Switch pressed = 0
9 RE1 33 Digital input. Ride height switch 'DOWN' switch. Switch pressed = 0
10 RE2 15 Digital input. Dashboard 'INHIBIT' switch. Switch pressed = 0
11 Vdd Ground.
12 Vss 5 volt power.
13 OSC1 20MHz crystal input.
14 OSC2 20MHz crystal output.
15 RC0 34 Digital input. Special power up mode input? Logical true but no clue
16 CCP2 12 Pulse rate input. Engine speed. True
17 CCP1 30 Pulse rate input. Road speed. True
18 VUSB 1uF Capacitor to ground for the USB system.
19 RD0 27 Digital output. Front Right air valve. A '1' from the CPU turns on a 12V supply
20 RD1 10 Digital output. Front Left air valve. ditto
21 RD2 28 Digital output. Rear Right air valve. ditto
22 RD3 11 Digital output. Rear Left air valve. ditto
23 D- USB port.
24 D+ USB port.
25 TX 35 Serial Out. Datalink Tx. Inverted
26 RX 17 Serial In. Datalink Rx. Inverted
27 RD4 9 Digital output. Exhaust air valve. A '1' from the CPU turns on a 12V supply
28 RD5 26 Digital output. Inlet air valve. ditto
29 RD6 16 Digital input. Compressor overheat. 1=overheat
30 RD6 13 Digital input. Pressure switch. 1 for >10 bar, 0 for <8.5 bar
31 Vss 5 volt power.
32 Vdd Ground.
33 RB0 7 Digital output. Ride height switch data. Inverted
34 RB1 25 Digital output. Ride height switch clock. Inverted
35 RB2 31 Digital input. Foot brake. 1=Brakes depressed
36 RB3 14 Digital input. Gear and handbrake. True
37 RB4 Digital input. Reprogram on USB at reboot switch input. Also used as a 'special' mode selection when running. 0 = switch pressed
38 RB5/PGM 8 Digital output. Compressor. This is also a programming pin but as I will never be using IC-programming in the car this shouldn't be a problem. 1=compressor on
39 PGC Digital input. IC-Programming.
40 PGD Digital input. IC-Programming.