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

adc with porta & port b as digital on pic18f4550

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



Joined: 26 Oct 2006
Posts: 10
Location: delhi -india

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

adc with porta & port b as digital on pic18f4550
PostPosted: Mon Oct 30, 2006 1:04 am     Reply with quote

hi, i am using pic18f4550 microcontroller , i have to use port a pins ra0,ra1 as a analog and all port b pins as digital ,can anybody help me how to do it.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 31, 2006 1:26 am     Reply with quote

Quote:
I am using pic18f4550 microcontroller , I have to use port
pins ra0, ra1 as analog and all port b pins as digital.

Look at the 18F4550.H file. The file is in this directory:
c:\Program Files\Picc\Devices

Scroll down near the end of the file. You'll see a section with this title:
Code:

// Constants used in SETUP_ADC_PORTS() are:

These are the settings that are used to configure pins as digital or Analog.
You said you're looking for a setting that will make pins A0 and A1 into
analog pins. Look in the list in the .H file. There is a setting for that.
Use that setting as a parameter in the setup_adc_ports() function.


If you want the Analog pins on Port B to be configured as digital pins
upon power-on reset, there is a fuse setting to do this. Add the setting
shown in bold below.
Quote:

#include <18F4550.h>
#fuses XT,NOWDT,NOPROTECT,BROWNOUT,PUT, NOLVP,NOPBADEN
#use delay(clock=4000000)
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