Instant Interrupts - Revisited - Page 2


Closed Thread
Page 2 of 2 FirstFirst 12
Results 41 to 80 of 773

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    I tried to compile my application with Darrels interrups, i get the compiler errors:
    Error[113] c:\pbp\pbppic18.lib 1200 : Symbol not previously defined(INT_ENTRY_H)
    Error[113] c:\pbp\pbppic18.lib 1214 : Symbol not previously defined(INT_ENTRY_L)
    Message[301] d:\embedded\......... test.asm : MESSAGE: (Temp variables exceeding T7)

    Can someone help ???

    Pic is a 18F6722

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


    Did you find this post helpful? Yes | No

    Default

    For the first two, you probably haven't defined the interrupt sources or handlers.

    See this page for an example.
    http://darreltaylor.com/DT_INTS-18/hello.html

    For the T7 warning, read this ...
    http://www.picbasic.co.uk/forum/show...&postcount=348
    <br>
    DT

  3. #3
    Join Date
    Nov 2008
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Hello Darrel,
    thanks, it works now, but there are coming up some more problems:

    When the timer makes 1 second tick, i call a subroutine which has several
    serin2 and serout2 commands to read and set data from some other modules.
    It seems to come to write and read errors (time out comes in the serin2 and serout2 commands).
    Also reading and writing to the 12c bus with I2CREAD and I2CWRITE to
    a display doesn't work any more correct.

    I enabled tmr0, tmr1, rx1 and rx2

    Regards,
    Ralf

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


    Did you find this post helpful? Yes | No

    Default

    If you've enable RX1_INT and RX2_INT, then what is the SERIN/OUT for?

    Aren't you using the USARTS?
    <br>
    DT

  5. #5
    Join Date
    Nov 2008
    Posts
    48


    Did you find this post helpful? Yes | No

    Default

    Sure, i am using both uarts of the Pic, but i have one more serial port accessing
    via serin/serout some more serial devices also (a eight devices bus). The status
    and some controls of these eight modules accessed via serin/serout are
    controlled by the two uarts to a rs232 and a ethernet board.

  6. #6
    Join Date
    Jan 2014
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    hi to all,
    I'm a beginner , so I need your help , please! .I want to play with 3 LEDs with pwm control . For begin I tried to compile a example from Darrel Taylor's page : http://www.darreltaylor.com/DT_INTS-14/SPWM.html .
    the compilation was succesfull for 18F's and work perfectly.
    I use MCS 3.0.7.0 and MAPSM v5.42 compiler . I want to compile the sorce code for 12F683 and I have this error:

    Error[101] C:\LUCRU\TEST_SPWM_INT.ASM 238 : ERROR: (wsave variable not found,)
    Error[101] C:\LUCRU\TEST_SPWM_INT.ASM 204 : ERROR: (" Add:" wsave VAR BYTE $20 SYSTEM)
    Error[101] C:\LUCRU\TEST_SPWM_INT.ASM 259 : ERROR: (Chip has RAM in BANK1, but wsave1 was not found.)
    Error[101] C:\LUCRU\TEST_SPWM_INT.ASM 211 : ERROR: (" Add:" wsave1 VAR BYTE $A0 SYSTEM)


    I use this code :

    '************************************************* ***************
    '* Name : Test_SPWM.pbp *
    '* Author : Darrel Taylor *
    '* Date : 9/30/2006 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '************************************************* ***************
    ; Initialize your hardware first

    DEFINE OSC 20
    CLEAR

    INCLUDE "..\DT_INTS-14.bas" ; Base Interrupt System
    INCLUDE "SPWM_INT.bas" ; Software PWM module

    DEFINE SPWM_FREQ 40 ; SPWM Frequency
    DEFINE SPWM_RES 256 ; SPWM Resolution

    DutyVars VAR BYTE[3] ; DutyCycle Variables
    DutyVar1 VAR DutyVars[0] ; group them in an array for easy access
    DutyVar2 VAR DutyVars[1] ; with FOR loops etc.
    DutyVar3 VAR DutyVars[2]

    ASM
    SPWM_LIST macro ; Define PIN's to use for SPWM
    SPWM_PIN GPIO, 0, _DutyVar1
    SPWM_PIN GPIO, 1, _DutyVar2
    SPWM_PIN GPIO, 2, _DutyVar3
    endm
    SPWM_INIT SPWM_LIST ; Initialize the Pins
    ENDASM

    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
    INT_Handler TMR1_INT, SPWMhandler, ASM, yes
    endm
    INT_CREATE ; Creates the interrupt processor
    ENDASM

    @ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts

    ;_________________________________________________ ____________________________

    RandVar VAR WORD : RandVar = 12345
    LoopCount VAR WORD

    Main: ; Simple Demo to fade/flash some LED's
    DutyVar1 = 5 ; Start with 3 LED's at different
    DutyVar2 = 50 ; brightness
    DutyVar3 = 150
    pause 3000

    FOR LoopCount = 1 to 4 ; Reapeat 4 times
    for DutyVar1 = 0 to 150 ; Fade LED1 UP
    pause 10
    RANDOM RandVar
    DutyVar3 = RandVar & $3F ; Give LED3 a random dutycycle
    next DutyVar1

    for DutyVar1 = 150 to 0 STEP -1 ; Fade LED1 Down
    pause 10
    RANDOM RandVar
    DutyVar2 = RandVar & $3F ; Give LED2 a random dutycycle
    next DutyVar1
    NEXT LoopCount
    GOTO Main




    Can somedody help me to finish my ideea ?

    1000xthx

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    The answer is in the Error messages:

    Quote Originally Posted by midali View Post
    hi to all,
    Error[101] C:\LUCRU\TEST_SPWM_INT.ASM 238 : ERROR: (wsave variable not found,)
    Error[101] C:\LUCRU\TEST_SPWM_INT.ASM 204 : ERROR: (" Add:" wsave VAR BYTE $20 SYSTEM)
    Error[101] C:\LUCRU\TEST_SPWM_INT.ASM 259 : ERROR: (Chip has RAM in BANK1, but wsave1 was not found.)
    Error[101] C:\LUCRU\TEST_SPWM_INT.ASM 211 : ERROR: (" Add:" wsave1 VAR BYTE $A0 SYSTEM)
    It says, " Add:" wsave VAR BYTE $20 SYSTEM
    and also " Add:" wsave1 VAR BYTE $A0 SYSTEM

    So, your code might look like this now:

    Code:
    '****************************************************************
    '*  Name    : Test_SPWM.pbp                                     *
    '*  Author  : Darrel Taylor                                     *
    '*  Date    : 9/30/2006                                         *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    ; Initialize your hardware first
    
    DEFINE OSC 20
    CLEAR
    
    INCLUDE "..\DT_INTS-14.bas"         ; Base Interrupt System
    INCLUDE "SPWM_INT.bas"              ; Software PWM module
    
    wsave     VAR BYTE $20 SYSTEM
    wsave1    VAR BYTE $A0 SYSTEM
    
    DEFINE SPWM_FREQ  40                ; SPWM Frequency
    DEFINE SPWM_RES   256               ; SPWM Resolution
    
    DutyVars   VAR BYTE[3]              ; DutyCycle Variables
      DutyVar1 VAR DutyVars[0]          ; group them in an array for easy access
      DutyVar2 VAR DutyVars[1]          ; with FOR loops etc.
      DutyVar3 VAR DutyVars[2]
    
    ASM
    SPWM_LIST  macro                    ; Define PIN's to use for SPWM
         SPWM_PIN  GPIO, 0, _DutyVar1
         SPWM_PIN  GPIO, 1, _DutyVar2
         SPWM_PIN  GPIO, 2, _DutyVar3
      endm
      SPWM_INIT  SPWM_LIST              ; Initialize the Pins
    ENDASM
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler   TMR1_INT,  SPWMhandler,  ASM,  yes
        endm
        INT_CREATE                      ; Creates the interrupt processor
    ENDASM
    
    @ INT_ENABLE  TMR1_INT              ; enable Timer 1 interrupts
    
    ;_____________________________________________________________________________
    
    RandVar   VAR WORD : RandVar = 12345
    LoopCount VAR WORD
    
    Main:                               ; Simple Demo to fade/flash some LED's
        DutyVar1 = 5                        ; Start with 3 LED's at different
        DutyVar2 = 50                       ; brightness
        DutyVar3 = 150
        pause 3000
         
        FOR LoopCount = 1 to 4              ; Reapeat 4 times
            for DutyVar1 = 0 to 150         ; Fade LED1 UP
                pause 10
                RANDOM  RandVar             
                DutyVar3 = RandVar & $3F          ; Give LED3 a random dutycycle
            next DutyVar1
             
            for DutyVar1 = 150 to 0 STEP -1 ; Fade LED1 Down
                pause 10
                RANDOM  RandVar
                DutyVar2 = RandVar & $3F         ; Give LED2 a random dutycycle
            next DutyVar1
        NEXT LoopCount     
    GOTO Main
    Ioannis

  8. #8
    Join Date
    Jan 2014
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    1000 X Ioannis ! Now its ok !

  9. #9
    Join Date
    Jan 2014
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Hi,
    in the last four days I spend my time with play of this code, but now I'm need to your help. I repeat, im begginer and at this time I dont know how work the intrerrupts.
    The Darrel Tylor code blink 3 leds at different intensity. I want to turn on 3 leds in background at different intensity without blinking. i tried this code, but leds blinks....where I'm wrong?


    Main: ; Simple Demo to fade/flash some LED's
    DutyVar1 = 5 ; Start with 3 LED's at different
    DutyVar2 = 50 ; brightness
    DutyVar3 = 150
    GOTO Main

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


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    That is not enough code to make a whole program.
    Please post your entire code.

    Also include the PIC you are using and the compiler version.
    DT

  11. #11
    Join Date
    Jan 2014
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    I work with 12F683 and MPASM v5.42.

    1000 x thx

    Code :

    '************************************************* ***************
    '* Name : Test_SPWM.pbp *
    '* Author : Darrel Taylor *
    '* Date : 9/30/2006 *
    '* Version : 1.0 *
    '* Notes : *
    '* : *
    '************************************************* ***************
    ; Initialize your hardware first

    DEFINE OSC 20
    CLEAR

    INCLUDE "..\DT_INTS-14.bas" ; Base Interrupt System
    INCLUDE "SPWM_INT.bas" ; Software PWM module
    wsave VAR BYTE $20 SYSTEM
    wsave1 VAR BYTE $A0 SYSTEM

    DEFINE SPWM_FREQ 40 ; SPWM Frequency
    DEFINE SPWM_RES 256 ; SPWM Resolution

    DutyVars VAR BYTE[3] ; DutyCycle Variables
    DutyVar1 VAR DutyVars[0] ; group them in an array for easy access
    DutyVar2 VAR DutyVars[1] ; with FOR loops etc.
    DutyVar3 VAR DutyVars[2]

    ASM
    SPWM_LIST macro ; Define PIN's to use for SPWM
    SPWM_PIN GPIO, 0, _DutyVar1
    SPWM_PIN GPIO, 1, _DutyVar2
    SPWM_PIN GPIO, 2, _DutyVar3
    endm
    SPWM_INIT SPWM_LIST ; Initialize the Pins
    ENDASM

    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
    INT_Handler TMR1_INT, SPWMhandler, ASM, yes
    endm
    INT_CREATE ; Creates the interrupt processor
    ENDASM

    @ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts

    ;_________________________________________________ ____________________________

    RandVar VAR WORD : RandVar = 12345
    LoopCount VAR WORD

    Main:
    DutyVar1 = 5
    DutyVar2 = 50
    DutyVar3 = 150

    GOTO Main

  12. #12
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    How fast is the led blinking?

    Ioannis

  13. #13
    Join Date
    Jan 2014
    Posts
    84


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    I apreciate 4-5 blinks/sec

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 : 6

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