Why does INT2 in DT_INT-18 stop working after 30-40 interrupts?


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: Why does INT2 in DT_INT-18 stop working after 30-40 interrupts?

    Thanks, Sayzer, for this input. All three of your suggestions are logical and good. However, I implemented all three of your suggestions, and it still stops after exactly 23 interrupts on IN2.
    Any other ideas from anyone as to why this is happening? Would really appreciate an input from Darrel Taylor.
    John Ellis

  2. #2
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    969


    Did you find this post helpful? Yes | No

    Default Re: Why does INT2 in DT_INT-18 stop working after 30-40 interrupts?

    What is the interrupt rate? 1 per second? Or 1 every minute?

    I would recommend not to use heavy time consumers like LCDOUT and WRITE commands within the ISR as it can create problems.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: Why does INT2 in DT_INT-18 stop working after 30-40 interrupts?

    I would try to get rid of the WRITE in the ISR first, but yeah, rule #1... keep ISR as short as possible, set some flags and process the dutys in the main loop.

    Another thing.. get rid of all ENABLE/DISABLE DEBUG... for entertainment and testing purpose.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default Re: Why does INT2 in DT_INT-18 stop working after 30-40 interrupts?

    He has 2 seconds of pause in Int routine.
    So I assume that the code is written with a logic that allows such a long pause in there.

    Also, since there is an LCD, I would have a step number variable.
    And, at each line of code, I would number the step variable and show on LCD.
    This way, you will see where the program stops; so you can see the step number and check the code.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  5. #5
    Join Date
    Mar 2009
    Location
    Colorado
    Posts
    378


    Did you find this post helpful? Yes | No

    Default Re: Why does INT2 in DT_INT-18 stop working after 30-40 interrupts?

    Thanks to all of you. All were good suggestions and I have implemented them all. Replacing the WRITEs in the ISR with a FLAG that is polled in the main loop to determine whether to WRITE the time stamp to EEPROM, fixed the problem.

    Sayez's idea of using a step variable and LCD to troubelshoot where in code a problem exists is a great idea I had not heard before. Will definitely make use of it in future. Thanks!

    This forum is one of the greatest resources that exists in the microcontroller design world. Thanks to all of you for your great participation and contributions!
    John Ellis

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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