Interrupt at pinswitch problem

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Here I am again... :oops:

I have a circuit with LED's, and when an timer1 interrupt occurs sometimes I see the LED's switch on and off very fast.
Now I use cli to disable the interrupts before switching and sei to enable the interrupt again.
Now this fenomen is gone.
Is there an option/trick so that the interrupt cannot occurs only when a pin is switching?

:?:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So, the timer1 interrupt is controlling the LEDs or what?
If not, just use cli/sei... it should be fine.
Ok, another "trick" is to disable ONLY the timer1 interrupt and then to re-enable the timer1 interrupt (after you finish switching).

But, anyway... what is the cause of this strange behaviour?

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

RoBSki,
Post some code and we can better evaluate what is happening. It might not be interrupts that are causing the problem. Hard to say without more details and the code.
-Will

Last Edited: Tue. Dec 6, 2005 - 09:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Hard to say with more details and the code.

Rather easier... ? :wink:

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you using the pin change interupt for other code?

-Curiosity may have killed the cat
-But that's why they have nine lives