Again -
I think you would be FAR better off if you would just use Darrel's code as a starting point. Since you have two priorities, you need to put the following in your DEFINE block.
DEFINE USE_LOWPRIORITY 1
Then use Darrel's INCLUDE files as needed.
INCLUDE "DT_INTS-18.bas" ; Base Interrupt System
INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
INCLUDE "ReEnterPBP-18LP.bas" ; Include if using Low Pr. PBP INTS
Then define your variables in PBP. If you have enough space, you can define all of them as BankA SYSTEM. If you don't, make certain that you define all the ones that you want to pass between PBP and ASM as bankA System
The variables will be case-sensitive.
Set up all timer prescalers, clock sources and triggering edges first.
Now put in Darrel's interrupt control block -
Change the labels as necessary.
Code:
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR0_INT, SystemTimer, ASM, yes
INT_Handler RX1_INT, _GetCharPort1, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
INT_LIST_L macro ; IntSource, Label, Type, ResetFlag?
INT_Handler PIC_YOUR_INT, StepperControl, ASM,no
endm
INT_CREATE_L ; Creates the Low Priority interrupt processor
ENDASM
Goto OverInt
------------------------------------------
ASM
(Put all your ASM ISR code here)
@ INT_RETURN
ENDASM
-------------------------------------------
[Put all your PBP ISR code here]
@ INT_RETURN
---------------------------------------------
Overint:
(Clear INT flags)
@ INT_ENABLE (name of INT)
@ INT_ENABLE (name of other INT)
@ INT_ENABLE (name of other INT)
NothingLoop:
Goto NothingLoop ; do nothing until you get an int.
Hopefully, I haven't forgotten something. !
Doing things this way will not only likely get you to a running program much faster, it will make it easier for others to give you the help you need. After all, this IS a PBP forum, not an ASM forum.
Bookmarks