Does variable value change being transferred to code running in interrupt loop?


Results 1 to 28 of 28

Threaded View

  1. #7
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Does variable value change being transferred to code running in interrupt loop?

    If that code is in your interrupt, the interrupt can never exit and you might as well have put this in your main program.
    You can’t run a continuous loop. The ISR is always a call i.e.. GOSUB, and you always have to return from interrupt or your main code will never run.
    What is currently triggering the interrupt?

    Also, it looks like you want PWM at 50% duty cycle, but if more than one condition is true, it will break all of them.

    There is a thread a little below about frequency counters. Darrel didn’t want to shove his own timer code down someone’s throat,
    but it was really the answer to the problem. To his merit, he gave advice about a less efficient manner the OP was already working on.
    Similarly DT’s code is the answer to your problem.
    Last edited by Art; - 7th April 2015 at 11:30.

Similar Threads

  1. Can not change variable while using DT_INT?
    By hvguy0 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 30th March 2013, 00:05
  2. Altering a variable in a loop.
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 18th September 2012, 07:24
  3. Change a variable to the opposite?
    By Hylan in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 21st June 2012, 08:00
  4. Change variable allocation to save code space
    By aberco in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 5th September 2011, 02:28
  5. 16f84a running interrupt PICBASIC code
    By divaker in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 31st July 2008, 16:49

Members who have read this thread : 0

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