• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Doomed.

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    Doomed.

    One of the esteemed customers just mentioned using interrupts in his PIC program.



    This is the oik who can't get polling to work.


    #2
    Get them to implement threads

    Comment


      #3
      Originally posted by zeitghost View Post
      One of the esteemed customers just mentioned using interrupts in his PIC program.



      This is the oik who can't get polling to work.

      Isn't interrupts a kind of polling anyway?

      Or did I just "Whoooooooooosh" that.
      Knock first as I might be balancing my chakras.

      Comment


        #4
        Originally posted by suityou01 View Post
        Isn't interrupts a kind of polling anyway?

        Or did I just "Whoooooooooosh" that.
        Very much whoosh

        Polling means the code occasionally has a look to see if a condition has occurred and, if so, does something about it.

        An interrupt involves the hardware, upon entering a certain state, sending a signal to the processor which causes it to stop whatever code it might happen to be executing at that instant, save its state, and go off and execute a special chunk of code designated for that purpose, called the interrupt handler. Once it returns from the interrupt handler, the processor restores its state, and goes back to whatever it was in the middle of when interrupted.

        In pseudocode: polling is like

        Code:
        .main 
                doSomething
                doSomethingElse
                if thingHasHappened:
                    doSpecialThing        # always happens here, implying known state after things done
                goto .main
        whereas interrupt-driven is like

        Code:
        .interruptHandler
            doSpecialThing
            returnFromInterrupt
        
        .main 
                doSomething           # interrupt could happen here
                doSomethingElse       # or here
                doThirdThing          # or here
                doFourthThing         # anywhere, really - state could be anything
                goto .main

        Comment

        Working...
        X