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 support@ccsinfo.com

I have problem with this example....

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



Joined: 08 Oct 2003
Posts: 11
Location: BRAZIL

View user's profile Send private message

I have problem with this example....
PostPosted: Thu Oct 09, 2003 6:59 am     Reply with quote

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...
Pete Smith



Joined: 17 Sep 2003
Posts: 55
Location: Chester, UK

View user's profile Send private message Visit poster's website MSN Messenger ICQ Number

Re: I have problem with this example....
PostPosted: Thu Oct 09, 2003 7:21 am     Reply with quote

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 Shocked

Hope this helps,

Pete.
pitufos



Joined: 08 Oct 2003
Posts: 11
Location: BRAZIL

View user's profile Send private message

Re: I have problem with this example....
PostPosted: Thu Oct 09, 2003 7:31 am     Reply with quote

thank's Very Happy
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