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
.
Bookmarks