View previous topic :: View next topic |
Author |
Message |
pitufos
Joined: 08 Oct 2003 Posts: 11 Location: BRAZIL
|
I have problem with this example.... |
Posted: Thu Oct 09, 2003 6:59 am |
|
|
Hi, look this example....
#include <16C84.H>
#fuses HS,NOWDT,NOPROTECT
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_A3, rcv=PIN_A2)
#define INTS_PER_SECOND 76 // (20000000/(4*256*256))
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
clock_isr() { // the RTCC (timer0) overflows (255->0).
// For this program this is apx 76 times
if(--int_count==0) { // per second.
++seconds;
int_count=INTS_PER_SECOND;
}
}
main() {
byte start;
int_count=INTS_PER_SECOND;
set_rtcc(0);
setup_counters( RTCC_INTERNAL, RTCC_DIV_256);
enable_interrupts(RTCC_ZERO);
enable_interrupts(GLOBAL);
do {
printf("Press any key to begin.\n\r");
getc();
start=seconds;
printf("Press any key to stop.\n\r");
getc();
printf("%u seconds.\n\r",seconds-start);
} while (TRUE);
}
when i compile program, haven this error ....
the variable RTCC_ZERO is not declared...
why ?
Thank's... |
|
![](templates/subSilver/images/spacer.gif) |
Pete Smith
Joined: 17 Sep 2003 Posts: 55 Location: Chester, UK
|
Re: I have problem with this example.... |
Posted: Thu Oct 09, 2003 7:21 am |
|
|
pitufos wrote: | Hi, look this example....
setup_counters( RTCC_INTERNAL, RTCC_DIV_256);
enable_interrupts(RTCC_ZERO);
|
Hi.
Your problem is that RTCC_ZERO is no longer supported as an interrupt type. You've got to replace it with INT_RTCC.
It changed a while ago in one of their updates, and my code promptly stopped compiling
Hope this helps,
Pete. |
|
![](templates/subSilver/images/spacer.gif) |
pitufos
Joined: 08 Oct 2003 Posts: 11 Location: BRAZIL
|
Re: I have problem with this example.... |
Posted: Thu Oct 09, 2003 7:31 am |
|
|
thank's ![Very Happy](images/smiles/icon_biggrin.gif) |
|
![](templates/subSilver/images/spacer.gif) |
|