Hi All,
Probably another silly question and I wrote a program that works fine with a ceramic resonator running at 10 MHZ. Change the program to a 20 MHZ resonator (OSC) and it quits working! PIC is a 16F628A. I am so confused! Thanks, Ed

DEFINE LOADER_USED 1
DEFINE OSC 20
Include "Modedefs.bas"

CK VAR PortA.0 ' Clock from Pin 17 to Pin 7 of the 1298 yellow
DOUT VAR PortA.1 ' Data Out from Pin 18 to Pin 6 of the 1298 orange
DIN VAR PortB.6 ' Data In from Pin 12 to Pin 5 of the 1298 violet
CS VAR PortB.7 ' Chip Select From Pin 13 to Pin 1 of the 1298 blue
addr VAR BYTE ' Channel address / mode
result VAR WORD ' Reading from the A/D
Vbits VAR WORD ' Variable to store A/D volts reading
Abits VAR WORD ' Variable to store A/D Amps reading
REF VAR WORD ' 0.0 Amps reference point
AMPS VAR WORD ' Amps reading
VOLTS VAR WORD ' Volts reading
cmcon = 7 ' Set all the PIC inputs to be digital