gnupic: 16f877 A/D problems


Previous by date: 14 Nov 2002 18:28:52 -0000 Re: banksel macro, Craig Franklin
Next by date: 14 Nov 2002 18:28:52 -0000 17C44 erase, John Sanders
Previous in thread:
Next in thread: 14 Nov 2002 18:28:52 -0000 Re: 16f877 A/D problems, Declan Moriarty

Subject: 16f877 A/D problems
From: Declan Moriarty ####@####.####
Date: 14 Nov 2002 18:28:52 -0000
Message-Id: <02111418272000.01102@genius.chateau.dec>

	Everything will work for me except the A/D on my little project

It simulates and assembles fine.  When I clear ram and run the a/d, I get 
0x01 and 0x9a in ADRESH & ADRESL. On the board, I either get 0x00 or 0xFF. 
I am using one channel. Here's the voltages
Vdd 5V
-Vref ~1.5V 
Now with respect to -vref
	+Vref - 1.2V
	AN0 ~ 0.25V
I have gone over the software and swapped pics until I'm blue in the face. I 
took the steps from Microchip's 'f87 datasheet, page 113 in order. There is a 
delay of seven seconds in step 3.  This gave me 0x00 every time. 

Then I tried the code from the midrange manual (example 23-5, on page 23-17)
This gives me 0xff. I tried on channel one with a pot. It doesn't make a 
blind bit of difference what is out there - it just gives me 0xff or 0x00.

Can anyone point me at or provide a cast iron input stimulus file for this, 
or code which works. I'm presuming the error is mine.
  


-- 
	Regards,

	Declan Moriarty

Applied Researches - Ireland's Foremost Electronic Hardware Genius

	A Slightly Serious(TM) Company

Without the optimist, the pessimist wouldn't know how happy he isn't



Previous by date: 14 Nov 2002 18:28:52 -0000 Re: banksel macro, Craig Franklin
Next by date: 14 Nov 2002 18:28:52 -0000 17C44 erase, John Sanders
Previous in thread:
Next in thread: 14 Nov 2002 18:28:52 -0000 Re: 16f877 A/D problems, Declan Moriarty


Powered by ezmlm-browse 0.20.