Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Sep 2010
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    hi all, i face a problem here.

    why when im trying to compile the dt_ints-18 file without changing anything, it shows

    Error[113] c:\picbas~1.47\pbppic18.lib 1170 : symbol not previously defined (int_entry_H)

    im using 18f2680

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,144


    Did you find this post helpful? Yes | No

    Default

    I suppose you did commend the 4 lines starting with __CONFIG in the xxx.inc file inside your PBP directory, right?

    Ioannis

  3. #3
    Join Date
    Sep 2010
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    huh?? do you means 18f2680.inc ? but i dint change anything with it..below is the inc file

    ;************************************************* ***************
    ;* 18F2680.INC *
    ;* *
    ;* By : Leonard Zerman, Jeff Schmoyer *
    ;* Notice : Copyright (c) 2006 microEngineering Labs, Inc. *
    ;* All Rights Reserved *
    ;* Date : 06/05/06 *
    ;* Version : 2.47 *
    ;* Notes : *
    ;************************************************* ***************
    NOLIST
    ifdef PM_USED
    LIST
    "Error: PM does not support this device. Use MPASM."
    NOLIST
    else
    LIST
    LIST p = 18F2680, r = dec, w = -311, w = -230, f = inhx32
    INCLUDE "P18F2680.INC" ; MPASM Header
    __CONFIG _CONFIG1H, _OSC_XT_1H
    __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    __CONFIG _CONFIG3H, _MCLRE_ON_3H & _PBADEN_OFF_3H
    __CONFIG _CONFIG4L, _XINST_OFF_4L & _LVP_OFF_4L
    NOLIST
    endif
    LIST
    EEPROM_START EQU 0F00000h
    BLOCK_SIZE EQU 64

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


    Did you find this post helpful? Yes | No

    Default

    That is awesome, just opened a ton of possibilities with the speed of ASM, and the ease of DT_INTS and N-Bit Math. Thanks Darrel!
    http://www.scalerobotics.com

  5. #5
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Just a quickie, re IOC interrupts....how do I know which one to use? (previously I was using IOC with a 16f690 & used RABC_INT then, but the PIC I'm using now doesn't have a PORT B)

    From DT's site...

    Several new interrupt sources have been added in version 1.00. GPC_INT, IOC_INT, RAC_INT, RABC_INT and the original RBC_INT are all forms of Port Change Interrupts. The chip being programmed determines which one you need to use.

    Where do I look to establish this info?

    I'm using one of the newer 14 pin 16F1823 PICs.

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


    Did you find this post helpful? Yes | No

    Default

    The key is to look in the INTCON register.

    For the 16F690, INTCON.0 is RABIF. So you would use RABC_INT.

    With the 16F1823, INTCON.0 is IOCIF, so it's IOC_INT.

    I could probably make it so IOC_INT works for all of them.
    They are all "Interrupt On Change".
    DT

  7. #7
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Many thanks Darrel.

    I have a problemetette - my program runs fine, but then when I press a switch (to generate an IOC), an interrupt *is* triggered, but it then seems to loop in my interrupt handler (it's actually becuase the INTCON.0 bit seems to be staying at 1, which keeps it jumping to the interrupt handler constantly)

    Any ideas, why the IOC_FLAG = 0 entry towards the end of the interrupt handler doesn't appear to be taking affect?

    Code:
    IOC_FLAG VAR INTCON.0 ' Alias RABIF interrupt flag bit
    debug_out var byte
    SW1    VAR PORTA.5
    on_status var byte
    Green_LED VAR PortC.1 
    
    ASM
    INT_LIST  macro ; IntSource,    Label,         Type, ResetFlag?
        INT_Handler  IOC_INT,  _Switch_Interrupt,  PBP,  YES 
        endm
        INT_CREATE       ; Creates the interrupt processor
    ENDASM
    
    Check:                        
      'Check switches before enabling/re-enabling IOC   
      WHILE SW1 = 0 : WEND  ' Wait until all switch inputs = 1 
     IOC_FLAG = 0          ' Clear the int-on-change flag bit
    
    @ INT_ENABLE IOC_INT   ; Enable 'Int On Change' interrupts
    on_status = 0
    Low GREEN_LED
    
    
    '+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Switch_Interrupt:
    hserout ["trap ", dec IOC_FLAG, 13, 10]
    
    @ INT_DISABLE IOC_INT  ; Disable further IOC interrupts
    
    
            pause 10
            IF sw1 = 0 THEN
            if on_status = 1 then 
            on_status =0
            Low GREEN_LED
            else
    
            High GREEN_LED
            on_status =1
            endif
            endif
            pause 20
    
    
            WHILE SW1 = 0 : WEND
            pause 25
            IOC_FLAG = 0
    @ INT_ENABLE IOC_INT
    @ INT_RETURN

    This is almost certainly something I'm doing wrong, but then again, it's pretty much a direct what was working fine my functioning 16F690 IOC routine?
    Last edited by HankMcSpank; - 21st November 2010 at 17:10.

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


    Did you find this post helpful? Yes | No

    Default

    On these Enhanced chips, the Interrupt On Change works much better than on the older chips.

    You can specify wether you want Rising edges, Falling edges or both by enabling them in the IOCAP and IOCAN.

    Then each Pin has it's own interrupt flag in IOCAF. And you need to clear those bits.

    It's described better in section 13.0 in the datasheet.
    http://ww1.microchip.com/downloads/e...Doc/41413A.pdf
    DT

  9. #9
    Join Date
    May 2012
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Thank you for quick reply!

    Yes i have, this is configuration for my pic



    ADCON1 = $0F
    CMCON = 7
    UCFG.3 = 1
    PORTA = 0
    PORTB = 0
    PORTC = 0

  10. #10
    Join Date
    May 2012
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Just want to add,when I turn off TRM1 before reading i2c, rtc is operating normally, but problem is with LED strips on PWM channel they strart flashing.

    T1CON.0=0
    I2CRead sda,scl,$D0,$00,[RTCSec,RTCMin,RTCHour,RTCDay,RTCDate,RTCMonth,RTCY ear]
    T1CON.0=1
    Last edited by DaTiNs; - 31st May 2012 at 13:09.

  11. #11
    Join Date
    May 2012
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Hello good people,


    I follow this forum for a long time, it is excellent! I found a lot of good stuff on it.


    Now I have a problem with the code from Mr. Darrel Taylor.


    Thus, I use pic18f2550 and connect DS1307z and 4 PWM channels to PORTA


    SDA Var PORTA.1
    SCL Var PORTA.0


    ASM
    SPWM_LIST macro
    SPWM_PIN PORTA, 2, _CH1
    SPWM_PIN PORTA, 3, _CH2
    SPWM_PIN PORTA, 4, _CH3
    SPWM_PIN PORTA, 5, _CH4
    endm
    SPWM_INIT SPWM_LIST


    INT_LIST macro
    INT_Handler TMR1_INT, SPWMhandler, ASM, yes
    endm
    INT_CREATE
    ENDASM
    @ INT_ENABLE TMR1_INT


    Now i got problem with this configuration. When i enable SPWM_LIST then RTC stop working, in fact he working but value he give, its not good. When i disable software pwm, RTC is working good.


    I hope that you understande what is my problem and that one of you has a solution for this problem.


    Sory for my english


    Thanks a lot, Damir

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


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Do you have this in your program ... ?

    Code:
    ADCON1 = 15
    DT

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by reik6149 View Post
    hi all, i face a problem here.

    why when im trying to compile the dt_ints-18 file without changing anything, it shows

    Error[113] c:\picbas~1.47\pbppic18.lib 1170 : symbol not previously defined (int_entry_H)

    im using 18f2680
    It's not really clear, but it sounds like you might be trying to compile the include file, rather than including it in your code. You are supposed to compile something like this:

    Code:
    LED1   VAR  PORTB.1
    
    INCLUDE "DT_INTS-18.bas"     ' Base Interrupt System
    INCLUDE "ReEnterPBP-18.bas"     ' Include if using PBP interrupts
    
    ASM
    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
    Last edited by ScaleRobotics; - 13th September 2010 at 08:21.
    http://www.scalerobotics.com

  14. #14
    Join Date
    Sep 2010
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    yea !! it works !!!! thank you very much ! im too busy body and trying to compile the file each of it.zzzz

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 20:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 20:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 06:32
  5. Replies: 1
    Last Post: - 1st November 2006, 03:11

Members who have read this thread : 5

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts