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 problem...

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



Joined: 05 May 2009
Posts: 5

View user's profile Send private message

FUSES problem...
PostPosted: Wed May 06, 2009 3:55 pm     Reply with quote

I'm using the 30F2010 in a ADC 12 bits project, and I configured a custom project in CCS. CCS created a lot of FUSES, like:
#FUSES WDT128
I commented it with // , and the error got to
setup_adc_ports(AN0|VREF_VREF);
error: undefined identifier. (AN0)

Some one could help me with it? Thanks!
bungee-



Joined: 27 Jun 2007
Posts: 206

View user's profile Send private message

PostPosted: Wed May 06, 2009 4:22 pm     Reply with quote

You probably commented out

#include <30F2010.h>

FUses and other lines in start of program are there for a reason. Wink
dyeatman



Joined: 06 Sep 2003
Posts: 1934
Location: Norman, OK

View user's profile Send private message

PostPosted: Wed May 06, 2009 4:43 pm     Reply with quote

Quote:
error: undefined identifier. (AN0)


See this post for information on your problem.

http://www.ccsinfo.com/forum/viewtopic.php?p=86666
maurolarrat



Joined: 05 May 2009
Posts: 5

View user's profile Send private message

PostPosted: Thu May 07, 2009 10:35 am     Reply with quote

There whmeade has a half the same problem that me...doesn't help :\

but , a simple ADC with dsPIC30F2010 shouldn't be hard to find out here.

I do need just to do a simple read ADC 12 bits, nothing more. Could you help me?
thxs Shocked
FvM



Joined: 27 Aug 2008
Posts: 2337
Location: Germany

View user's profile Send private message

PostPosted: Thu May 07, 2009 3:41 pm     Reply with quote

Quote:
doesn't help
The said post answers your question regarding AN0 - so what's your problem?

dsPIC30F2010 however has a 10-Bit rather than 12-Bit ADC. You would need e.g. a dsPIC30F2011.
maurolarrat



Joined: 05 May 2009
Posts: 5

View user's profile Send private message

PostPosted: Fri May 08, 2009 9:50 am     Reply with quote

Sorry my fault FvM, you are right. I really will use the 2011.
thanks!
maurolarrat



Joined: 05 May 2009
Posts: 5

View user's profile Send private message

PostPosted: Fri May 08, 2009 12:59 pm     Reply with quote

I made like this:
Code:

#include <30F2011.h>
#device adc=12
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES HS                       //High speed Osc (> 4mhz)
#FUSES NOPUT                    //No Power Up Timer
#FUSES BROWNOUT                 //Reset when brownout detected
#FUSES BORV27                   //Brownout reset at 2.7V

#use delay(clock=20000000)

void main()
{

   setup_adc_ports(sAN0|VSS_VDD);
   setup_spi(SPI_SS_DISABLED);
   SETUP_TIMER1(TMR_DISABLED);
   SETUP_TIMER2(TMR_DISABLED);


//Setup_Oscillator parameter not selected from Intr Oscillator Config tab

   // TODO: USER CODE!!
   while(1);

}

I only want use the ADC of 30F2011, if the code has some fuses or setup that I forgot to put there, please could you correct to me? But it compiled good enough.
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