Interrupt status?


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: Interrupt status?

    Quote Originally Posted by circuitpro View Post
    Have I overlooked something about the INT_INT constants? Where to find out more on this?
    No, you haven't missed anything.
    I was just thinking about how I could make the interrupt bits available using the INT_INT constants. They've never been needed so far since the person writing the program is turning them on and off to begin with.

    What I came up with is pretty ugly and confusing, so probably won't help.

    But if you only have 4 interrupt sources, and they are interferring with each other ...
    You are probably trying to do too much in the handler.

    Interrupt rule number one.
    Get into the handler, do only what is necessary to service the interrupt and get out as fast as possible. No pauses, no serial input or output, no waiting for something else to happen.
    Anything that takes time should be done in the main loop.
    DT

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default uart and interrupts

    Quote Originally Posted by Darrel Taylor View Post
    Interrupt rule number one.
    Get into the handler, do only what is necessary to service the interrupt and get out as fast as possible. No pauses, no serial input or output, no waiting for something else to happen.
    Anything that takes time should be done in the main loop.
    Hey Darrel, I have a question about the rules. Would it break the rules if inside the interrupt handler you sent one or two bytes out at a time using the uart, as it would fit in the buffer?

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: uart and interrupts

    Quote Originally Posted by scalerobotics View Post
    Hey Darrel, I have a question about the rules. Would it break the rules if inside the interrupt handler you sent one or two bytes out at a time using the uart, as it would fit in the buffer?
    Sure, interfacing with the hardware is fine, then the hardware goes off and does the time consumming tasks.

    USART, MSSP, Timers, CCP modules, A/D converter etc. ... YES.

    SERIN/OUT(2), DEBUGIN/OUT, PULSIN/OUT, RCTIME, PAUSE, FREQOUT etc ... NO
    DT

  4. #4
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default Re: Interrupt status?

    Very good reminder in #7.

    I think I'll just need to go through the (INT0) handler and just pare the heck out of it.

  5. #5
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default Re: Interrupt status?

    I know about not using serial port/s during an interrupt, but how time consuming is something like this?

    ARRAYWRITE TEMP,[DEC2 HOST,".",DEC2 ADDRESS,".","125",".",DEC2 V,".","*",13,10]

    (I guess this would be considered 'hardware' and therefore probably permissible, right?)
    Last edited by circuitpro; - 27th February 2011 at 19:53.

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Interrupt status?

    Dave
    Always wear safety glasses while programming.

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