Well I have it working now, thanks for all of your help.
I decided to take PBP out of the equation. I no am using:
TRISA = 255
ADCON0 = %00000001 'Vref = Vss Vdd, turn on A/D
ADCON1 = %11111110 'Only Channel 0 analog
ADCON2 = %10001010 'Right justified, 2 TAD, TOSC/32 (for 20MHz)
For the A/D conversion:
ADCON0.1 = 1 'Start A/D conversion
while ADCON0.1 = 1 'Wait for it to finish
wend
adresult.highbyte = ADRESH
adresult.lowbyte = ADRESL
This works a treat. Now on to the next problem, trying to get the thiristors firing in the correct way.
Regards
Bob...
Bookmarks