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
Posted: Thu Jun 07, 2007 5:07 pm
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.
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