| Kada 
 
 
 Joined: 22 Nov 2004
 Posts: 4
 
 
 
			      
 
 | 
			
				| #FUSES ,  AN4  and LVDIN  ( PIC18F6720 ) |  
				|  Posted: Tue Nov 23, 2004 5:38 am |   |  
				| 
 |  
				| How can I define AN4 as an  analog input? 
 ...............
 setup_adc_ports(ALL_ANALOG|VSS_VDD);
 setup_adc(ADC_CLOCK_DIV_64);
 setup_vref(FALSE);
 .......
 
 but still have problems with channel 4, it seems that it is not an analog input.
 
 #OPT 5                       // optimization level 0-9
 #device ICD=TRUE
 #device ADC=10
 #use delay(clock=9830400,RESTART_WDT)
 #fuses H4                  // Crystal osc(2,457600MHz) * 4
 #fuses NOOSCSEN     // Oscillator switching is disabled
 #fuses PUT               // Power Up Timer, ca. 72 mS.
 #fuses BROWNOUT    // Reset when brownout detected
 #fuses BORV25         // Brownout reset at 2.5V
 #fuses WRT  	// Writting to flash from a program
 #fuses NOLVP            // No low voltage prgming, B3 used for I/O
 #fuses WDT128          // Watch Dog Timer uses 1:128 Postscale
 #fuses NOWRTC	 // No writing to the configuration registers
 #fuses NOPROTECT    // Code not protected from reading
 #fuses NOEBTR	// Memory not protected from table reads
 #fuses NOCPD	// No EE protection
 #fuses NODEBUG       // No Debug mode for ICD
 #fuses STVREN          // Stack full/underflow will cause reset
 #fuses CCP2C1         // CCP2 input/output multiplexed with RC1
 #fuses NOCPB           // No Boot Block code protection
 #fuses NOWRTD        // Data EEPROM not write protected
 #fuses NOWRTB        // Boot block not write protected
 _________________
 Best Regards Kada
 |  |