Instant Interrupts - Revisited


Results 1 to 40 of 791

Threaded View

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

    Default Instant Interrupts - Revisited

    This is a series of include files that simplify the process of creating interrupt driven programs for PicBasic Pro. MPASM required.

    Once you try this, you may never use ON INTERRUPT again.

    Features:
    Assembly language Interrupts
    Basic language Interrupts
    Both ASM and Basic interrupts in the same program
    Service Multiple Interrupt sources
    Prioritized execution order
    Very easy to use


    No ON INTERRUPT "Code Bloat"
    No ON INTERRUPT " I'll service your interrupt whenever I feel like it." mentality.
    .
    One of the best things about this system, is that you don't have to remember where all the Enable bits and Interrupt flags are located.

    Each interrupt "source" is given a unique name that is used to reference it.
    The system "Looks Up" the correct bit locations for that name. Reducing those RTFM sessions to a minimum.
    The following table lists the Named Interrupts.
    Note: More interrupts have been added .. please visit http://darreltaylor.com/DT_INTS-14/intro.html

    Available Interrupt Sources 14-bit
    Code:
     INT_INT -- INT External Interrupt
     RBC_INT -- RB Port Change Interrupt
     TMR0_INT -- TMR0 Overflow Interrupt 16F
     TMR1_INT -- TMR1 Overflow Interrupt
     TMR2_INT -- TMR2 to PR2 Match Interrupt
     TX_INT -- USART Transmit Interrupt
     RX_INT -- USART Receive Interrupt
     CMP_INT -- Comparator Interrupt
     EE_INT -- EEPROM/FLASH Write Operation Interrupt
     BUS_INT -- Bus Collision Interrupt
     PSP_INT -- Parallel Slave Port Read/Write Interrupt
     AD_INT -- A/D Converter Interrupt
     SSP_INT -- Master Synchronous Serial Port Interrupt
     CCP1_INT -- CCP1 Interrupt
     CCP2_INT -- CCP2 Interrupt
    Here's a simple example of toggling an LED using the external interrupt (INT). (Hello World)
    Code:
    LED1   VAR  PORTB.1
    
    INCLUDE "DT_INTS-14.bas"     ' Base Interrupt System
    INCLUDE "ReEnterPBP.bas"     ' Include if using PBP interrupts
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler    INT_INT,  _ToggleLED1,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    
        INT_ENABLE   INT_INT     ; enable external (INT) interrupts
    ENDASM
    
    Main:
      PAUSE 1
    GOTO Main
    
    '---[INT - interrupt handler]---------------------------------------------------
    ToggleLED1:
         TOGGLE LED1
    @ INT_RETURN
    Code Size = 234 words

    This project, and it's associated files, have been moved.
    Please download them from my website.
    DT_INTS-14 (12F-16F)
    http://darreltaylor.com/DT_INTS-14/intro.html

    DT_INTS-18 (18F)
    http://darreltaylor.com/DT_INTS-18/home.html

    .
    Last edited by Darrel Taylor; - 21st January 2014 at 19:20.

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, 06:32
  5. Replies: 1
    Last Post: - 1st November 2006, 04:11

Members who have read this thread : 34

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