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 CCS Technical Support

TickInit()

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



Joined: 18 Nov 2013
Posts: 160

View user's profile Send private message

TickInit()
PostPosted: Mon Dec 08, 2014 4:42 pm     Reply with quote

Using an 18F87J60, with Ethernet.
TickInit() configures timer0 and it enables timer0 interrupts. Do I need to do anything for an interrupt routine? I don't see the purpose of enabling interrupts since the timer is used for measuring elapsed based on tick counts.

Steve
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 08, 2014 5:53 pm     Reply with quote

I don't know what version of the CCS stack you have. But this version
shows that tick.c has a timer0 interrupt routine in it.
http://read.pudn.com/downloads165/sourcecode/internet/tcp_ip/756725/TCP-IP/drivers/Tick.c__.htm
SeeCwriter



Joined: 18 Nov 2013
Posts: 160

View user's profile Send private message

PostPosted: Tue Dec 09, 2014 9:29 am     Reply with quote

My version of tick.c has no interrupt handler. The last history entry is by Howard Schlunder on 6/13/07.
SeeCwriter



Joined: 18 Nov 2013
Posts: 160

View user's profile Send private message

PostPosted: Tue Dec 09, 2014 9:53 am     Reply with quote

Looking through Tick.c I found function TickUpdate(). The description says it "Updates the tick value when an interrupt occurs."

But since it's not declared as an interrupt routine, and it resets the interrupt flag of timer0, I'm assuming I need to create an isr and call this function from it. But clearing an interrupt flag from a non-interrupt function seems risky.

In any case, I think I answered my own question.

Steve
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