|
|
View previous topic :: View next topic |
Author |
Message |
dipen
Joined: 18 Feb 2004 Posts: 5
|
AD CONVERTION USING PIC452 |
Posted: Wed Feb 18, 2004 6:43 pm |
|
|
im using mplab 6.3v with ccs compiler 3.155v with a pic18f452, and
im trying to complete A/d convertions on 7 channels. im getting these errors
*** Error 76 "ADC2.c" Line 65(15,23): Expect ;
*** Error 76 "ADC2.c" Line 70(15,23): Expect ;
which is my read adc statement for acc6, and acc7 which are port e..E0,E1.
is there something that im missing regarding those parts in my code
listed below. if i dont use port e, the project builds. Please help thank you
#define INTS_PER_SECOND 8 // (4000000/(4*2*65536))
byte seconds; // A running seconds counter
byte int_count; // Number of interrupts left before a second has elapsed
#int_rtcc // This function is called every time
rtcc_isr() { // the RTCC (timer0) overflows (255->0).
// For this program this is apx 15 times
if(--int_count==0) { // per second.
++seconds;
int_count=INTS_PER_SECOND;
}
}
void main() {
byte start;
int16 acc1, acc2, acc3, acc4, acc5, acc6, acc7;
setup_adc_ports( ALL_ANALOG );
setup_adc( ADC_CLOCK_INTERNAL );
setup_spi(FALSE);
setup_psp(PSP_DISABLED);
enable_interrupts(INT_RTCC);
enable_interrupts(GLOBAL);
int_count=INTS_PER_SECOND;
setup_counters( RTCC_INTERNAL, RTCC_DIV_2);
set_rtcc(0);
do{
set_adc_channel( 0 );
delay_us(15);
acc1 = Read_ADC();
printf("1%2X ",acc1);
set_adc_channel( 1 );
delay_us(15);
acc2 = Read_ADC();
printf("2%2X ",acc2);
.
.
.
.
etc
start=seconds;
printf("T%u ",start);
}while(true);
could it be that something is wrong with my timing??? not sure right now _________________ nick |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Feb 19, 2004 6:18 pm |
|
|
Quote: | im using mplab 6.3v with ccs compiler 3.155v with a pic18f452, and
im trying to complete A/d convertions on 7 channels. im getting these errors
*** Error 76 "ADC2.c" Line 65(15,23): Expect ;
*** Error 76 "ADC2.c" Line 70(15,23): Expect ; |
The problem could be due to the compiler version, 3.155.
See the following thread.
http://www.ccsinfo.com/forum/viewtopic.php?t=4499&highlight=155 |
|
|
|
|
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
|