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

Set up of Timer1?

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



Joined: 09 Jul 2004
Posts: 70

View user's profile Send private message

Set up of Timer1?
PostPosted: Thu Jun 07, 2007 12:08 pm     Reply with quote

I am trying to use the Timer1 to reset my SSP module in my program. This is necessary because the PIC16F819 has a silicon error that causes problems of locking up the I2C when in slave mode. I would like to have the timer1 start when i first enter the int_ssp and then if it does not complete in the set time frame, the timer1 will over flow and reset the SSPEN bit of the SSPCON1 register. I have tried some things here, but i am not sure how to have the timer1 only on during the int_ssp and not on the rest of the time. Does anyone have suggestions on what would be the best way of setting this up?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jun 07, 2007 5:07 pm     Reply with quote

You can't do nested interrupts with CCS and the 16F series PICs.
You could start the timer and then poll to see when the interrupt flag
is set (due to the timer overflowing). I don't know if that will help you.
You may be calling CCS functions that are stuck in a polling loop, inside
the function. If that's true, you'll have to write your own i2c code for
use inside the ISR. Then you can put in timeouts, either hardware with a
timer, or software.
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