You have nine bits in this line.
adcon1=%100000010
That's probably the reason for the strange behaviour.
You have nine bits in this line.
adcon1=%100000010
That's probably the reason for the strange behaviour.
Sorry! thats a typing error in my post, actual code is correct.
It seems so simple I can't understand why it dosen't work.
Don't you need to change your command to ADCIN 4, adval to get AN4?
I personally have been using Melanies direct method reading analog values that can be seen in this thread
http://www.picbasic.co.uk/forum/show...ghlight=adcon0
Its pretty straight forward and I can understand what is going on.
Defines should be in uppercase.
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 50
Thanks modifyit, I'll try this when I get back to work on Monday and let you know how I get on.
Ingvar, I didn't think these were case sensitive, it worked OK lower case for 8 bit ADC but I will also try this on Monday.
Thanks both.
Your defines didn't do anything atall since they were the default values.
So if they are default values Then shouldn't the prog work?
The rest of the code works when set up for 8 Bits, can't see what else is wrong, confused!.
BG
Bookmarks