PDA

View Full Version : Ping Darrel Taylor - Timer0 Instant Interrupt



JEC
- 5th January 2007, 04:30
(Instant Interrupt Timer0 Question)

Hi Darrel,

I just downloaded a fresh copy of the DT_INTS-14 and ReEnterPBP files from your website and intalled them in a new directory, along with my program file.

I have PBP 2.46 and the newest version of MPASM (5.03) running inside MicroCode Studio.

My target processor is a 16F88 @ 20 MHz.

I'm attempting to use a TMR0 interrupt.

The relevant PBP code looks like this:

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

When I compile, PBP tells me that T0IF can't be found and the program won't compile.

So I opened up the MPASM's .inc file for the 16F88 and discovered that T0IF and T0IE aren't mentioned anywhere. Rather, it's TMR0IF and TMR0IE.

So I made these two changes to the DT-INTS-14.bas file:

ifdef T0IF ;----{ TMR0 Overflow Interrupt }-------------[INTCON, TMR0IF]---

;INT_Source INTCON, T0IF, INTCON, T0IE
INT_Source INTCON, TMR0IF, INTCON, TMR0IE

endif

;#define TMR0_INT INTCON,T0IF ;-- TMR0 Overflow Interrupt 16F
#define TMR0_INT INTCON,TMR0IF ;-- TMR0 Overflow Interrupt 16F


------------

And now I get the error 'Interrupt source INTCON, TMR0IF not found.'

I've checked to make sure that zeros are used instead of the letter 'O' everywhere.

The errors are the same using a pervious version of MPASM - 3.90 I think.

Any ideas?

John

HenrikOlsson
- 5th January 2007, 07:23
Hi,
See post #141 in this thread:
http://www.picbasic.co.uk/forum/showthread.php?t=3251&page=4&highlight=instant+interrupts

/Henrik Olsson.

JEC
- 5th January 2007, 17:54
Thanks - that fixed the problem and I'm able to compile.

By the way, what's up with entering a CAPTCHA when searching the forum these days?

Pedro Santos
- 9th January 2007, 10:27
Hello Darrel

the line
@ INT_ENABLE INT_INT ; enable external (INT) interrupts

and how can i desable the interrupt?

Thanks

Regards
Pedro

HenrikOlsson
- 9th January 2007, 11:20
Hi,
Darrel will most definetly correct me if I'm wrong but I think you do:


@INT_DISABLE INT_INT


/Henrik Olsson.