12F683 and DT Instant Interrupts


Closed Thread
Results 1 to 27 of 27

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default

    Thank you for the reply. Unfortunately, I have all three lines commented out and now I get "Unable to fit wsave" .

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


    Did you find this post helpful? Yes | No

    Default

    From that error, it looks like you're still compiling for the 12F635.

    If using MicroCode Studio, make sure the device dropdown box says 12F683.

    For the 683, you'll need both wsave and wsave1.

    Or you can use the alternate wsave location $70, and comment the other 3.
    <br>
    DT

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Thank you Darrel. Yes , the drop-down was incorrect. The program doesn't work, but that's because it's still Halloween!

  4. #4
    Join Date
    Nov 2008
    Posts
    96


    Did you find this post helpful? Yes | No

    Default 12f683 messages too...

    I'm trying to get my head across the DT Interrupt code for a small new RC modeling project and I'm trying a test example first (the blinky LED) , compiling with MCS. I have 12f683 selected in MCS and MPASM being used.

    but I get an odd warning message from MCS thus :
    Warning[219] d:\pbp code\pbp\pbppic14.lib 336 : Invalid RAM location specified
    Warning[219] d:\pbp code\pbp\pbppic14.lib 892 : Invalid RAM location specified

    Anybody know why and if I should just disregard it ?

    I commented out the wsave lines as required (which led me here BTW)

    My code

    Code:
    LED1   VAR  PORTB.1
    
    INCLUDE "DT_INTS-14.bas"     ' Base Interrupt System
    INCLUDE "ReEnterPBP.bas"     ' Include if using PBP interrupts
    
    ASM
    RBIF = GPIF
    RBIE = GPIE
    
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR1_INT,  _ToggleLED1,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    T1CON = $31                ; Prescaler = 8, TMR1ON
    @ INT_ENABLE  TMR1_INT     ; enable Timer 1 interrupts
    
    Main:
      PAUSE 1
    GOTO Main
    
    '---[TMR1 - interrupt handler]--------------------------------------------------
    ToggleLED1:
         TOGGLE LED1
    @ INT_RETURN
    My project is quite simple. A 22.5mS interrupt timer (TMR1 I guess) and toggle a few pins then wait for the next interrupt.
    Martin

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


    Did you find this post helpful? Yes | No

    Default

    Try ...

    ;LED1 VAR PORTB.1

    LED1 VAR GPIO.1

    <br>
    DT

  6. #6
    Join Date
    Nov 2008
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    Try ...

    ;LED1 VAR PORTB.1

    LED1 VAR GPIO.1

    <br>
    Yeah.... I forgot about port pins on the smaller PIC's (again).
    Ta, Martin

  7. #7
    Join Date
    Nov 2008
    Posts
    96


    Did you find this post helpful? Yes | No

    Default Reload the TMR1H:TMR1L properly ?

    Now my code compiles fine thankyou, barring a overwriting previous address warning from my config settings (I understand why that is). But I have a small question regarding reloading the timer for anyone.

    Must I stop the timer while reloading it with a hex value of A823 in the interrupt handler code (which is all it needs to do) ?

    T1CON = %0
    TMR1H = $A8
    TMR1L = $23
    T1CON = %1

    Or can I ignore the stop-start safely. Given I can tweak the timer value by trial and error to get my 22.5mS @ 4Mhz ?

    The only examples I've dug out on the forum are using ASM code and I'm not strong on interpreting it.

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 23:14

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