My apologies, I stripped out some linesfrom my program (ie a list of what I have attached to all the pins), to condense the code & make it eaasier to read , it seems I got carried away with the delete key when posting
Code:
TRISA = %11001010 'RA2 hpwm out therefore output needed
ANSELA =%00000010 'SIG in (RA1) NEED TO BE ANALOGUE.
....that above bit missing from my original code.
I'll try increasing the sampling time (but not sure why it would be 'signal level' sensitive....ie above a few millivolts right up to VCC, the ADC reads fine)
Walter....oh dear, not what I wanted to hear (re your problems). I did read the errata sheet, but that seems to relate more to ADC not completing (hanging?) under certain circumstances.... whereas this appears to be working as it should my readings are totally fine above 008 upto 255 ....just can't get under 008...even short to the PIC's ground pin.
I've only recently progressed from using ADCIN ...I'm just using it here cos it's quick!
Edit: just tried setting the Fosc to Frc ....hmmm, I won one bit back ...my ADC now reads between 007 & 255!
Bookmarks