DT-Interrupts - Is there a clash between ExtInt and IntOnChange?


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: DT-Interrupts - Is there a clash between ExtInt and IntOnChange?

    Here's a crazy thought; if you have 2 interrupts doing virtually the same thing, why not do both functions with only 1 interrupt? If your 100 Hz mains interrupt is clocking the same as your Timer 1, can you put your Timer 1 code in your ExtInt interrupt?

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: DT-Interrupts - Is there a clash between ExtInt and IntOnChange?

    With 100Hz, I think there is a lot of time for this. Have done much worse things in ISR!

    Ioannis

  3. #3
    Join Date
    May 2011
    Location
    Bangalore, India
    Posts
    33


    Did you find this post helpful? Yes | No

    Default Re: DT-Interrupts - Is there a clash between ExtInt and IntOnChange?

    Quote Originally Posted by Ioannis View Post
    With 100Hz, I think there is a lot of time for this. Have done much worse things in ISR!

    Ioannis
    You are right Ioannis. With 100Hz, there is a lot of time. It's all a question of what needs to be done by the ISR and how quickly it can be done.

    - Bala

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: DT-Interrupts - Is there a clash between ExtInt and IntOnChange?

    The ISR will be triggered by the Z.C. detector and set a flag. I do not see what else should be there.

    The other stuff is not critical for being in the ISR

    Ioannis

  5. #5
    Join Date
    May 2011
    Location
    Bangalore, India
    Posts
    33


    Did you find this post helpful? Yes | No

    Default Re: DT-Interrupts - Is there a clash between ExtInt and IntOnChange?

    Quote Originally Posted by mpgmike View Post
    Here's a crazy thought; if you have 2 interrupts doing virtually the same thing, why not do both functions with only 1 interrupt? If your 100 Hz mains interrupt is clocking the same as your Timer 1, can you put your Timer 1 code in your ExtInt interrupt?
    Your thought is not at all crazy; it's quite logical.

    Both IOC Int for firing the triac and Timer1 Int for the Elapsed Timer occur 100 times per second. But I cannot use the Timer1 Int for the triac since the timing should be in sync with the zero crossings of the mains. It is possible to use the zero crossings for keeping time, but the timing accuracy may not be satisfactory.

    But coming to think of it, if the timer accuracy is + or - 10% it is still good enough for me.
    Thanks mpgmike. Based on your suggestion, I will try out using IOC Int for both firing the triac and the Elapsed Timer.

    - Bala

Similar Threads

  1. External Interrupts Vs. RB/KBI Interrupts?
    By kevj in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st September 2008, 07:52
  2. help: TMR0 interrupts disabling PORTAchange interrupts???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 19th August 2008, 15:10
  3. Need help with INTerrupts
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd August 2007, 00:53
  4. Why use Interrupts
    By lerameur in forum General
    Replies: 4
    Last Post: - 13th May 2007, 22:12
  5. too many interrupts
    By trying in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd February 2006, 13:38

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts