I have a Timer1 interrupt which is generating 20mSec
pulse with 30% duty cycle.
And I have one buttun, and the code for identifying
button press is put inside the main()-->while() loop.
Now when ever I press the Mode Button for some seconds
then Timer1 generating one big pulse instead of the
20mSec pulse.
Even though the Timer1 is an interrupt, why it is not
generating the exact pulses.
The code is as below:
-----------------------------------------------------
signed int8 count1,DCOnDuty=30;
void UpButton()
{
// Some code for Up Button press.
//If we press this button for some seconds,it should
//not change the interrupt time for Timer1. But is it
//affecting it...why..???
}
void main() {
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
Posted: Wed Sep 29, 2004 11:21 pm
You might need to post your full code as a few important questions can't be answered by looking at what you have posted. Such as
-How are you setting up the Timer and the interrupts?
-Is the button-checking code also interrupt driven?
-Does the button-checking code disable the interrupts by any chance?
-The variables count1 and DCOnDuty are globals. Is there any chance that they get modified by UpButton() ?
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