Here's the GM diagnostics for p0502, P0503 is basically the same. It sounds like you have a wire problem somewhere. Is this code on all the time? Does it come right back on when it's cleared? I would check the engine bay and under the vehicle for any broken/chaffed/suspicious looking wires. Let us know what you find.
I take it you have access to a multi meter and a jack? Then follow the steps and if the answer to the step is yes follow the y- to the corresponding step if its no follow the n-. The number of the step is above it. Good luck.
Place transmission in Neutral or a drive gear (must not be in Park).
Turn the ignition switch to the OFF position.
Disconnect PCM connector C1.
Connect a digital multimeter (DMM) to terminals 64 and 65 of the PCM connector C1.
Select AC volts on the DMM.
Rotate the Right drive wheel manually and rapidly, and observe the DMM.
Is the measured voltage greater than the specified value?
0.4 V
y- Go to Step 13
n- Go to Step 4
4
Select ohms on the DMM.
Is the resistance between terminals 64 and 65 greater than the specified value?
1,864 ohms
y-Go to Step 5
n- Go to Step 6
5
Inspect circuits 400 and 401 for an open.
Repair the circuits if necessary.
Refer to General Electrical Diagnosis in Wiring Systems.
Was a condition found?
--
y Go to Step 14
n Go to Step 10
6
Does the DMM display a value less than the resistance specified?
981 ohms
y Go to Step 7
n Go to Step 8
7
Inspect circuits 400 and 401 for a short together.
Refer to General Electrical Diagnosis in Wiring Systems.
Was a condition found?
--
y Go to Step 14
n Go to Step 10
8
Connect one lead of the DMM to a good ground.
Connect the other lead to terminal 64, then terminal 65.
Is either resistance lower than the specified value?
50 K ohms
y Go to Step 9
n Go to Step 11
9
Inspect circuits 400 and 401 for a short to ground.
Refer to General Electrical Diagnosis in Wiring Systems.
Was a condition found?
--
y Go to Step 14
n Go to Step 10
10
Disconnect the VSS and connect a DMM from terminal A to terminal B of the VSS.
Is the measured resistance within the specified range?
981-1,864 ohms
y Go to Step 11
n Go to Step 12
11
Remove the VSS and inspect the sensor rotor on the final drive carrier assembly for damage, looseness or misalignment.
Refer to Unit Repair.
Was a condition found and corrected?
--
n Go to Diagnostic Aids
12
Replace the vehicle speed sensor.
Refer to Vehicle Speed Sensor Replacement .
Is the replacement complete?
--
--
13
Replace the PCM.
Refer to Powertrain Control Module Replacement/Programming in Engine Controls.
Is the replacement complete?
--
--
14
Repair the wiring as needed.
Refer to Wiring Repairs in Wiring Systems.
Is the repair complete?