Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Mar 2006
    Posts
    41


    Did you find this post helpful? Yes | No

    Default Turn Interrupt on/off

    Hello;
    I'm Ryan form the Philippines I must admit DTS-14 ints rules!!! i'd like to know how can i turn the interrupt on and off for USART continues recepton I'm using PIC16f877a toggling register PIE.5 doesn't seem to work

    Thanks

    PS.

    Part of my project i'm paying my tuition continue college again OSY for sometime now hehe (",)

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Check out this post, esp. post 5, http://www.picbasic.co.uk/forum/showthread.php?t=3251
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

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


    Did you find this post helpful? Yes | No

    Default

    you can use
    @ INT_ENABLE RX_INT

    and

    @ INT_DISABLE RX_INT
    Steve

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

  4. #4
    Join Date
    Mar 2006
    Posts
    41


    Did you find this post helpful? Yes | No

    Wink fixed it

    ahhh thanks guys

    fixed it toggling both
    ' CREN = 0
    ' SPEN = 0

    I didn't bother with the interrupts just disabled the Port input thanks I appreciate it!!!

  5. #5
    Join Date
    Dec 2007
    Location
    Cd. Juarez, Mexico
    Posts
    8


    Did you find this post helpful? Yes | No

    Default

    Hi Darrell, I tried to use your great rutines without any luck. I'm using a 18F248 sending CAN messages and I want to use a timer interrupt to send it.
    Just to test the rutines I tried to compile the example you post for timer interrupt and DT_INTS-18.bas rutines. But I got some errors on the compilation. Attached you will find a screen shot of what i'm talking about. If anybody can tell me what I'm doing wrong, it will be a great help for me.

    Thanks in advance for all yor help

    Alfredo
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    Hi Alfredo,

    Well apparently, not all CAN modules are the same.
    There are 2 types, CAN and ECAN.

    I didn't consider the plain CAN module when I wrote it.

    I'll have to make a way for it to detect which module is available and only use the interrupts for it. Then I'll post an update.

    But for now, you can just comment out the interrupt Sources that aren't available.
    In the DT_INTS-18.bas file, comment out the following lines in the CAN Module section ...
    Code:
    asm  ; -- CAN Module --
      ifdef WAKIF  
                   ;----{ CAN bus Error }------------------------[PIR3, ERRIF]---
          INT_Source  CAN_ERR_INT, PIE3,ERRIE, IPR3,ERRIP
      
                   ;----{ Invalid Received Message }-------------[PIR3, IRXIF]---
          INT_Source  CAN_IRX_INT, PIE3,IRXIE, IPR3,IRXIP
      
                   ;----{ Receive Buffer 0 }------Mode 0--------[PIR3, RXB0IF]---
          INT_Source  CAN_RXB0_INT, PIE3,RXB0IE, IPR3,RXB0IP
                   ;----{ FIFO Watermark }--------Mode 1, 2---[PIR3, FIFOWMIF]---
    ;      INT_Source  CAN_FIFOWM_INT, PIE3,FIFOWMIE, IPR3,FIFOWMIP
      
                   ;----{ Receive Buffer 1 }------Mode 0--------[PIR3, RXB1IF]---
          INT_Source  CAN_RXB1_INT, PIE3,RXB1IE, IPR3,RXB1IP
                   ;----{ Any Receive Buffer }----Mode 1, 2-----[PIR3, RXBnIF]---
    ;      INT_Source  CAN_RXBn_INT, PIE3,RXBnIE, IPR3,RXBnIP
      
                   ;----{ Transmit Buffer 0 }-------------------[PIR3, TXB0IF]---
          INT_Source  CAN_TXB0_INT, PIE3,TXB0IE, IPR3,TXB0IP
      
                   ;----{ Transmit Buffer 1 }-------------------[PIR3, TXB1IF]---
          INT_Source  CAN_TXB1_INT, PIE3,TXB1IE, IPR3,TXB1IP
      
                   ;----{ Transmit Buffer 2 }-----Mode 0=-------[PIR3, TXB2IF]---
          INT_Source  CAN_TXB2_INT, PIE3,TXB2IE, IPR3,TXB2IP
                   ;----{ Any Transmit Buffer }---Mode 1, 2-----[PIR3, TXBnIF]---
    ;      INT_Source  CAN_TXBn_INT, PIE3,TXBnIE, IPR3,TXBnIP
      
                   ;----{ CAN bus Activity Wake-up }-------------[PIR3, WAKIF]---
          INT_Source  CAN_WAKE_INT, PIE3,WAKIE, IPR3,WAKIP
      endif
      
      list
        endm
      list  
    ENDASM
    Thanks for the info!
    DT

  7. #7
    Join Date
    Dec 2007
    Location
    Cd. Juarez, Mexico
    Posts
    8


    Did you find this post helpful? Yes | No

    Thumbs up

    WOOOOW!
    Thank you very much for the info, now I can use your rutines!!! Your info fix my problem

    Thanks again!!!

    Alfredo

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


    Did you find this post helpful? Yes | No

    Default

    .Damn.. way to slow this time

    my solution was..
    Code:
    asm
    RXBnIF=RXB1IF
    TXBnIF=TXB2IF
    FIFOWMIF=RXB0IF
    INT_LIST    MACRO
        INT_Handler TMR1_INT, _ToggleLED1, PBP, yes
        endm
        INT_CREATE
       endasm
    From p18f8680.inc file...
    Code:
    ;----- PIR3 Bits -----------------------------------------------------
    RXB0IF           EQU  H'0000'
    RXB1IF           EQU  H'0001'
    TXB0IF           EQU  H'0002'
    TXB1IF           EQU  H'0003'
    TXB2IF           EQU  H'0004'
    ERRIF            EQU  H'0005'
    WAKIF            EQU  H'0006'
    IRXIF            EQU  H'0007'
    
    FIFOWMIF         EQU  H'0000'
    RXBnIF           EQU  H'0001'
    TXBnIF           EQU  H'0004'
    On another hand... seems odd...
    Last edited by mister_e; - 30th May 2008 at 23:33.
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Good one Steve. That would have worked too.

    Since they're actually the same bit's, but with different Names depending on the mode, that might be an easy way for me to fix it. Maybe.
    <br>
    DT

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

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