I can't seem to find how to setup a reference voltage for A/D on the 4550.
Looking through the 18F4550.h file there isn't any way to do it?
Anyone have any ideas?
--Adam
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Fri May 16, 2008 1:25 pm
See this section in the .H file:
Code:
// The following may be OR'ed in with the above using |
#define VSS_VDD 0x00 // Range 0-Vdd
#define VREF_VREF 0x30 // Range VrefL-VrefH
#define VREF_VDD 0x20 // Range VrefL-Vdd
#define VSS_VREF 0x10 // Range 0-VrefH
adamgreg
Joined: 16 May 2008 Posts: 2
How do you specify which pin is the ref
Posted: Fri May 16, 2008 1:38 pm
Alright so I want Pin_A1 to be the Analog input and I want Pin_A3 to be the reference pin. How do you specify which pin is the ref pin?
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Fri May 16, 2008 1:56 pm
The A/D reference voltage pins are always on AN3 and AN2.
To use AN1 for A/D input and to use AN3 for Vref+, do this:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum