DT Instant Interrupts - Clarification?


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    Hi Henrik,

    Yes, I had already changed the ANSEL register
    I had changed the TRISIO register too.
    Attached is my full code listing for reference.

    Now what? I am sure it is only something simple but I just can't figure it out...PICSprayer.bas

    Cheers
    Barry

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


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    [ code] remove the spaces in the brackets [ /code]
    Code:
     remove the spaces in the brackets
    It will save folks from having to download your code to look at it.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    Unless I am not following your changes right, It seems in your ISR you are still waiting while gpio.2 is high. since that is now an analog input (I think) it might just be zooming right through the ISR making it look as though it was never called.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  4. #4
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    Yes, it was the GPOI.2 statement in the ISR that was causing the problem.
    All fixed now

    Code:
    This is a Code Space Test
    Hey, I even got the code space thing happening - I'm on fire!!!

    Thanks for all your help guys - really appreciate it.
    I will post details of the final project once it is all up and running - code, circuit diagram, PCB and some pretty pictures of the finished product.

    Cheers
    Barry

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    Just continuing on from this thread i have my own question about DT Interrupts for the 12F683.

    Having looked at the example given by darrell for the generic timer the code below seems unecessary if we know what the values are for the prescaler etc?

    Code:
    ;---[TMR1 reload - interrupt handler]-----------------------------------------
    ASM ; Calculate Timer Reload Constant
    ReloadInst = 8; # of Intructions used to reload timer
    if ((Prescaler == 1)||(Prescaler == 2)||(Prescaler == 4)||(Prescaler == 8))
    MaxCount = 65536 + (ReloadInst / Prescaler)
    TimerReload = MaxCount - (OSC*1000000/4/Prescaler/Freq)
    if ((TimerReload < 0) || (TimerReload > (65535-ReloadInst)))
    error Invalid Timer Values - check "OSC", "Freq" and "Prescaler"
    endif
    else
    error Invalid Prescaler
    endif
    ENDASM
    
    Do we need this error checking if we know and are happy with osc/prescaler/freq etc or am i missing something else. It looks like it might take a fair bit of code space?

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


    Did you find this post helpful? Yes | No

    Default Re: DT Instant Interrupts - Clarification?

    That snip perform calculations at compilation time and doesn't take ANY codespace. 'course you can remove it. It's there for convenience and ease of use.
    Steve

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

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