View previous topic :: View next topic |
Author |
Message |
maurolarrat
Joined: 05 May 2009 Posts: 5
|
FUSES problem... |
Posted: Wed May 06, 2009 3:55 pm |
|
|
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
|
|
Posted: Wed May 06, 2009 4:22 pm |
|
|
You probably commented out
#include <30F2010.h>
FUses and other lines in start of program are there for a reason. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1933 Location: Norman, OK
|
|
|
maurolarrat
Joined: 05 May 2009 Posts: 5
|
|
Posted: Thu May 07, 2009 10:35 am |
|
|
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 |
|
|
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Thu May 07, 2009 3:41 pm |
|
|
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
|
|
Posted: Fri May 08, 2009 9:50 am |
|
|
Sorry my fault FvM, you are right. I really will use the 2011.
thanks! |
|
|
maurolarrat
Joined: 05 May 2009 Posts: 5
|
|
Posted: Fri May 08, 2009 12:59 pm |
|
|
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. |
|
|
|