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

Problem with I2C and TMR0 int on 16F873

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







Problem with I2C and TMR0 int on 16F873
PostPosted: Fri Dec 13, 2002 10:33 am     Reply with quote

<font face="Courier New" size=-1>Hi,
I have a strange problem related to some I2C slave code I wrote for the 16F873.

Everything was working well, and then I decided to disable the INT0 interrupt which I had originally enabled and made a small interrupt routine for, as I didn't need it in my project.

After removing the first line below,

enable_interrupts(int_timer0); // enable timer0
enable_interrupts(int_timer1); // enable rx timer

enable_interrupts(INT_RB); // enable portB input change int
enable_interrupts(INT_SSP);
enable_interrupts(GLOBAL);


in the initialisation code for the processor, one of my I2C data responses to another processor fails with a clock stretch timeout.

All that's in the interrupt routine is this:


#int_timer0
timer0_int() // TMR0 overflow interrupt
{
// DEBUG_PIN = ~DEBUG_PIN; (this line not used now)
tmr0IntCtr++;
}

I don't have any idea what is causing this.

Does anyone have any ideas? I'm using PCM 3.104

Thanks

Mark






</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 10033
keith
Guest







Re: Problem with I2C and TMR0 int on 16F873
PostPosted: Mon Dec 16, 2002 10:32 am     Reply with quote

Hi Mark,

Did you solve your problem. I am having a i2c problems as well and was wondering what you may have leart from this problem.

thanks
Keith



:=<font face="Courier New" size=-1>Hi,
:=I have a strange problem related to some I2C slave code I wrote for the 16F873.
:=
:=Everything was working well, and then I decided to disable the INT0 interrupt which I had originally enabled and made a small interrupt routine for, as I didn't need it in my project.
:=
:=After removing the first line below,
:=
:= enable_interrupts(int_timer0); // enable timer0
:= enable_interrupts(int_timer1); // enable rx timer
:=
:= enable_interrupts(INT_RB); // enable portB input change int
:= enable_interrupts(INT_SSP);
:= enable_interrupts(GLOBAL);
:=
:=
:=in the initialisation code for the processor, one of my I2C data responses to another processor fails with a clock stretch timeout.
:=
:=All that's in the interrupt routine is this:
:=
:=
:=#int_timer0
:=timer0_int() // TMR0 overflow interrupt
:={
:= // DEBUG_PIN = ~DEBUG_PIN; (this line not used now)
:= tmr0IntCtr++;
:=}
:=
:=I don't have any idea what is causing this.
:=
:=Does anyone have any ideas? I'm using PCM 3.104
:=
:=Thanks
:=
:=Mark
:=
:=
:=
:=
:=
:=
:=</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 10068
Mark DSylva
Guest







Re: Problem with I2C and TMR0 int on 16F873
PostPosted: Mon Dec 16, 2002 2:39 pm     Reply with quote

:=Hi Mark,
:=
:=Did you solve your problem. I am having a i2c problems as well and was wondering what you may have leart from this problem.
:=
:=thanks
:=Keith

No I didn't solve it. I just kept the INT0 interrupt enabled for now, I'll have to re-visit this problem in a few days.


Mark
___________________________
This message was ported from CCS's old forum
Original Post ID: 10074
Derek
Guest







Re: Problem with I2C and TMR0 int on 16F873
PostPosted: Fri Jan 10, 2003 3:41 pm     Reply with quote

My I2C slave code does okay on a F877, but when I ported the code to the F873, the I2C intterupt only responds every other time.

Do you guys think this is related??

Derek






:=<font face="Courier New" size=-1>Hi,
:=I have a strange problem related to some I2C slave code I wrote for the 16F873.
:=
:=Everything was working well, and then I decided to disable the INT0 interrupt which I had originally enabled and made a small interrupt routine for, as I didn't need it in my project.
:=
:=After removing the first line below,
:=
:= enable_interrupts(int_timer0); // enable timer0
:= enable_interrupts(int_timer1); // enable rx timer
:=
:= enable_interrupts(INT_RB); // enable portB input change int
:= enable_interrupts(INT_SSP);
:= enable_interrupts(GLOBAL);
:=
:=
:=in the initialisation code for the processor, one of my I2C data responses to another processor fails with a clock stretch timeout.
:=
:=All that's in the interrupt routine is this:
:=
:=
:=#int_timer0
:=timer0_int() // TMR0 overflow interrupt
:={
:= // DEBUG_PIN = ~DEBUG_PIN; (this line not used now)
:= tmr0IntCtr++;
:=}
:=
:=I don't have any idea what is causing this.
:=
:=Does anyone have any ideas? I'm using PCM 3.104
:=
:=Thanks
:=
:=Mark
:=
:=
:=
:=
:=
:=
:=</font>
___________________________
This message was ported from CCS's old forum
Original Post ID: 10602
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