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


Closed Thread
Results 1 to 17 of 17

Hybrid View

  1. #1
    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?

    Thank you Richard, for the suggestions. I will try and implement whatever I can.

    I haven't written any code in Asm so far. I guess, when it comes to using multiple interrupts, learning to code in Asm may be a necessity.

    What about using a second PIC for the Elapsed Timer with a common clock? Is it worth trying?

    - Bala

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,636


    Did you find this post helpful? Yes | No

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

    i doubt its really necessary , it still leaves the issue of transferring data between chips with lots of isr's running
    Warning I'm not a teacher

  3. #3
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

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

    The tricky part as I see it, under Richard's directions, is the processing of ir in the foreground. But states will help, as long as your routines are fast enough.

    Better start with one task at the time and if it works ok, add another. All together might complex things and prevent debugging.

    Ioannis
    Last edited by Ioannis; - 9th May 2020 at 10:24.

  4. #4
    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?

  5. #5
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    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

  6. #6
    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

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    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

  8. #8
    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 : 1

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