Button and Instant interrupts
Hello Darrel !
I´m using your Instat interrupts to work with TIMER1, TIMER2 and CCP1 with a 16F877 @ 4Mhz, like this :
ASM
;T0IF = TMR0IF
;T0IE = TMR0IE
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler CCP1_INT, _Capture, PBP, yes
INT_Handler TMR1_INT, _Timer1, PBP, yes
INT_Handler TMR2_INT, _tick, PBP, yes
endm
INT_CREATE ; Cria a interrupção
ENDASM
Everything is working very, very well.
I´m doing a On-board computer for my small Opel Corsa, and this interrupts are just great !
Me and Sirvo (remember him ?) are doing almost the same on-board computer.
But now, I would like to implement 4 Buttons to my application (Start, Stop, Pause, Funcition Keys).
I´m trying to do that with the button statement without success / good results.
I read your sample (hello word for instant interrupts) but the INT_INT read just the RB0/INT right ?
Is that possible to use the Instant Interrupts to create/read, let´s say, 4 different buttons on PORTC ?
Tahank You very much !
bye
Sérgio Pinheiro
Instant Interrupts and Internal Comparators
Hi Darrel,
I have been using your wonderful instant interrupts routine, i have experienced a hiccup and cannot work out what I am doing wrong.
I wonder anybody may be able to help direct me to a solution.
I am using a 18F4520 with 2.5 and masm401. I have checked that I have your latest version which I beleive to be 3.2 (dated 28/8/07).
when I compile the following code:
define OSC 16
INCLUDE "DT_INTS-18.bas"
INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler CMP1_INT, _HopOut, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
TRISA = %00111111'
TRISD = %00000000
Z var bit
x var byte
CMCON = %00000010
@ INT_ENABLE CMP1_INT
Start:
PORTD.4 = 0
z = 0
Waiting:
if z = 0 then waiting
for x = 1 to 20
pause 50
toggle PORTD.4
next x
goto start
HopOut:
z = 1
@ INT_RETURN
end
I recieve the following complie errors
Error[128]........: Missing argument(s)
Error[113]........: Symbol not previously defined(IntFlagReg)
Error[113]........: Symbol not previously defined(IntFlagBit)
Error[113]........: Symbol not previously defined(IntFlagReg)
Error[113]........: Symbol not previously defined(IntFlagBit)
Error[101]........: ERROR:(Interrupt Source(IntFlagReg,IntFlagBit)not found)
Error[128]........: Missing argument(s)
Error[101]........: ERROR:(INT_ENABLE -Interupt Source not Found!)
If I change the CMP1 to CMP2 I receive errors
If I change the CMP1 to CMP then it compiles okay.
Any thoughts... should I be looking to set the registers manually maybe? I was planning to use both comparators independantly.
Thanks
POT & RCTIME works with DT_INTS-14.bas?
Hi Darrel,
this is my first post on this comunity. First of all I would thanks for the fantastic DT_INTS-14.bas background PWM routine.
I have uset your SW on a 16F628 in order to drive some LED with different brightness an WORK PEFECTLY. Darrel YOU ARE GREAT!!!!!
Now I need to use a potentiometer so set at run time the brightnes value for the LEDs, and after reading tons of html page and googled for hours, I have the founded suspect that the PBP instruction POT and RCTIME do not work with DT_INTS-14.bas.
Can you please confirm?
Ciao
Leo
POT & RCTIME works with DT_INTS-14.bas?
Many thanks tenaja for your prompt reply.
Ciao
Leo
Instant interrupts PIC12F675 (12f675)
For the record (partial pasted from other thread):
Quote:
Originally Posted by
wlundonly
Hi all, I've been trying to get Darrel Taylor's Instant interrupts to work with a 12f675 with no luck. Will they work with a 12f675?
I just get the following error message when I try to compile it:
ERROR: Variable wsave3 position request 416 beyond RAM_END 95.
ERROR: Variable wsave2 position request 288 beyond RAM_END 95.
ERROR: Variable wsave1 position request 160 beyond RAM_END 95.
ERROR: Unable to fit variable RS2_Save
<..snip...>
Thanks for any help.
Bill
See Darrel’s solution:
“To get Instant interrupts with Basic Language working on a 12F675 ...”
Open the DT_INTS-14.bas file and comment out the wsave lines. The 675 doesn't have any usable RAM in banks 1,2 or 3
Code:
' --- IF any of these three lines cause an error ?? ----------------------------
' Comment them out to fix the problem ----
' -- It depends on which Chip you are using, as to which variables are needed --
;wsave1 var byte $A0 SYSTEM ' location for W if in bank1
;wsave2 var byte $120 SYSTEM ' location for W if in bank2
;wsave3 var byte $1A0 SYSTEM ' location for W if in bank3
' ------------------------------------------------------------------------------
Then in the ReEnterPBP.bas file comment the T?_save variables.
Code:
; T1_Save VAR WORD
; T2_Save VAR WORD
; T3_Save VAR WORD
; T4_Save VAR WORD
Just remember that if you use Instant Interrupts on a different chip later, you will need to un-comment those lines.
HTH,
__________________
DT
http://www.picbasic.co.uk/forum/show...9510#post49510