ISRRX and Timer simultaneously?

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
User avatar
JWinters
Posts: 106
Joined: Mon Feb 04, 2008 4:56 pm
Location: North Carolina, USA
Contact:

ISRRX and Timer simultaneously?

Post by JWinters » Fri Apr 03, 2009 10:01 pm

Can ISSRX.bas and Timer.bas coexist in the same program? I've set one to high priority and the other to low priority, but I still can't get them working at the same time.

Doj
Posts: 362
Joined: Wed Apr 11, 2007 10:18 pm
Location: East Sussex

Post by Doj » Fri Apr 03, 2009 10:37 pm

I use my own serial interrupt routine(very simple) as high priority and a 1ms timer on low priority.

In my routine I use the#option ISR_SHADOW = false

In high priority interrupt I use Save (FSR0, PRODL)
In low priority I use Save(0)

I disable all interrupts before starting initialisation then enable low priority followed by high priority, finally turn on the interrupts as the last thing.

I am not sure which chip you are using but you have to explicitly turn on the priority with RCON.7=1.

This is the first phase of the initialisation

Code: Select all

INTCON=%00000000                                'Global Interrupt Enable(GIE, bit7) OFF
    IPR1=%00100000                                  'interrupt priority, only EUSART is high priority, all others low priority
    IPR2=%00000000                                  'all other peripherals are low priority
    RCON.7=1                                        'enable interrupt priority

I can not post more as its all aliased names in my project and would not make much sense.

Hope that helps a little.

Post Reply