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

TMR0 ON 16F877A

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







TMR0 ON 16F877A
PostPosted: Tue May 18, 2004 5:18 am     Reply with quote

Is there a way to force the tmr0 to increment every instruction cycle?
when using set_up_timer0(RTCC_INTERNAL) the timer increments every 2 instruction cycles. This is because the prescaler is assigned to it. When i try to assigne the prescaler to the WDT nothing works. I've tried the asm sequence shown in the midrange PIC manual to no avail. the code reccomended by microchip for doing this is shown below. Any help would be appreciated

void timer01to1(void)
{
#define RP0 5
#define RP1 6

#byte TMR0=0x101
#byte STATUS=0x03
#byte OPTION_REG=0x81

#asm
bsf STATUS,RP0;
movlw 0xc7;
movwf OPTION_REG;
bcf STATUS,RP0;
clrf TMR0;
bsf status,RP1;
movlw 0xcf;
movwf OPTION_REG;
clrwdt;
movlw 0xc8;
movwf OPTION_REG;
bcf STATUS,RP0;
#endasm
}

thanks
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Tue May 18, 2004 7:57 am     Reply with quote

Try this

setup_counters (RTCC_INTERNAL, WDT_2304MS);
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