Hi guys, my issue is this.
I am using 16F1847 and want to use a tmr0 interrupt to check an I2C RTC and display a message in LCD.
My problem is that some routines are shared between code and ISR. So when my main loop is calling an I2C routine for doing something else and a TMR0 is triggered, everything is screwed. I am searching of a delicant way to overcome this.
I am thinking of creating a software int by utilizing an unused hardware int. So instead of calling the I2C procedure from my code, I would just trigger the unused int and then it would call the I2C procedure. This way I2C would be only be called from inside ISR and there would be no chance that an other int could pause the routine.
How does this sounds? Do I have any other alternative when there are shared procedures between main code and ISRs?
I am using 16F1847 and want to use a tmr0 interrupt to check an I2C RTC and display a message in LCD.
My problem is that some routines are shared between code and ISR. So when my main loop is calling an I2C routine for doing something else and a TMR0 is triggered, everything is screwed. I am searching of a delicant way to overcome this.
I am thinking of creating a software int by utilizing an unused hardware int. So instead of calling the I2C procedure from my code, I would just trigger the unused int and then it would call the I2C procedure. This way I2C would be only be called from inside ISR and there would be no chance that an other int could pause the routine.
How does this sounds? Do I have any other alternative when there are shared procedures between main code and ISRs?