PDA

View Full Version : DT_INT problem in 676



financecatalyst
- 11th December 2010, 17:43
I have installed the latest DT_INT files but my following code is giving problem.
Without any variable declaration, it is showing out of memory....

Include "modedefs.bas"
INCLUDE "DT_INTS-14.bas" ; Base Interrupt System
INCLUDE "ReEnterPBP.bas" ; Include if using PBP interrupts
DEFINE NO_CLRWDT 1

@ __Config _LP_OSC & _WDT_OFF & _PWRTE_ON & _MCLRE_OFF & _BODEN & _CP & _CPD

PAUSE 50
TRISA = %000010
TRISC = %000000
CMCON = 7
ANSEL = 0
OPTION_REG = %10000111 ' RAPU = off, PS 1:256 to TMR0
PORTA=0
PORTC=0
wsave VAR BYTE $20 SYSTEM ' alternate save location for W

ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _counting, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM

@ INT_ENABLE TMR1_INT ; enable external (INT) interrupts

counting:

@ INT_RETURN

The error in the compiler window says:

ERROR: Unable to fit variable RS2_SaveHalting build on first failure as requested.
BUILD FAILED: Sat Dec 11 17:28:10 2010

Darrel Taylor
- 11th December 2010, 18:47
PicBasic Pro uses 24-26 bytes for System Variables. (can be more)
DT_INTS-14 needs 7 bytes to do ASM interrupts.

And if you want PBP type interrupts ...
ReEnterPBP needs to save all of PBP's system variables (26 bytes)
Plus it uses another 8 bytes, just in case PBP creates more T? system vars.

For a total of 65 bytes.
But the 16F676 only has 64 bytes.
__________________________________________________ _________________________

If you only use ASM type interrupts, you'll have 31 bytes left for your variables.

If you really need PBP type handlers, you can reduce the MaxTvars constant in ReEnterPBP which will get back a few bytes.
reducing MaxTvars from 4 to 3 will allow your example above to compile.

financecatalyst
- 11th December 2010, 19:12
Thanks Darrel, I have used your previous version of the INT as well without problems.
Now, unfortunately I have deleted those previous files. Is there any way I can have access to the previous version of your INT files?