CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

#FUSES , AN4 and LVDIN ( PIC18F6720 )

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Kada



Joined: 22 Nov 2004
Posts: 4

View user's profile Send private message Send e-mail

#FUSES , AN4 and LVDIN ( PIC18F6720 )
PostPosted: Tue Nov 23, 2004 5:38 am     Reply with quote

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
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Nov 23, 2004 7:15 am     Reply with quote

Note that AN4 is NOT pin A4 but pin A5 on the micro.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group