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?

    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

  2. #2


    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?

  3. #3
    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