Instant Interrupts - Revisited


Results 1 to 40 of 773

Threaded View

  1. #11
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default

    Darrel,

    How about this one? I have one interrupt to generate a USB Service, that part works fine. I'd like to add another interrupt for USB reception, is that what USB_INT is for?

    Here is a snip of code:


    Code:
    ;----[High Priority Interrupts]-----------------------------------------------
    ASM
    INT_LIST  macro    ; IntSource,        Label,      Type, ResetFlag?
            INT_Handler   TMR1_INT,  _ServiceUSB,    PBP,  yes
            INT_Handler   USB_INT,    _ReceiveUSB,   PBP,  yes
        endm
        INT_CREATE               ; Creates the High priority interrupt processor
    ENDASM
    
    '---[USB - interrupt handler]------------------------------------------------
    ReceiveUSB:
       @ INT_DISABLE TMR1_INT   ; disable USB service interrupt
       USBBufferCount = USBBufferSizeRX 
    DoUSBIn:
       USBservice ; Generate USB Service manually
       USBIn 1, USBBuffer, USBBufferCount, DoUSBIn
       varUsbIn = conByteHigh  ' Set flag data has arrived
    @ INT_ENABLE  TMR1_INT   ; enable USB Service interrupts
    @ INT_RETURN
    
    '---[TMR1 - interrupt handler]--------------------------------------------------
    ServiceUSB:
        USBservice
    @ INT_RETURN
    Does that make sense? Or can I leave the USB Service interrupt enabled throughout the USB Reception interrupt?

    Robert
    Last edited by Darrel Taylor; - 15th August 2006 at 08:45. Reason: added [code][/code] tags
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

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

Members who have read this thread : 4

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