Hello,
I have a quick question if somebody can help me.
I am writing a program for 16f628 in C. In this project I want to use the timer0 overflow interrupt for several purposes. So lets assume this is my program
So somehow I have to store the value of the function I want to be called in a variable so when the interrupt occurs that function will be called.
I hope you understand!!! Thank you!
I have a quick question if somebody can help me.
I am writing a program for 16f628 in C. In this project I want to use the timer0 overflow interrupt for several purposes. So lets assume this is my program
Code:
Timer0_Interrupt
{
if timer was started by [turnon_lights] then call turnoff_lights
if timer was started by [turnon_TV] then call turnoff_TV
}
turnon_lights
{
portb=0xFF;
Start Timer0;
}
turnoff_lights
{
prortb=0x00;
}
turnon_TV
{
porta=0xff;
Start Timer0
}
turnoff_TV
{
porta=0x00;
}
So somehow I have to store the value of the function I want to be called in a variable so when the interrupt occurs that function will be called.
I hope you understand!!! Thank you!