Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

how to activate interupt 1 and 2 on a 18f2550

Status
Not open for further replies.

pe1riv

New Member
Hi all,

Got a problem how to get the interups 1 and 2 working.

Interupt 0 is working fine with the demo.

But i need more interupts how to do that ?

this code is what i use now for testing the interups:

------------------------------------------------------------------
Dim x As Byte
x = 255
TRISA = 0
PORTA = x
INTCON.INT0IE = 1
Enable High
End

On High Interrupt
x = x - 1
PORTA = x
INTCON.INT0IF = 0
Resume
----------------------------------------------------------------

if I change INTCON.INT0IE to INTCON.INT1IE (checkt the 0 or the 1) it will licht up blue but if I compile it gives an error "constant argument can not be used here"

I need 2 interupts for my project the 2550 has 3 (0,1,2) > pin 21,22,23

Can someone help me out ?
 
Last edited:
The two interrupt flags for INT1 and INT2 are in INTCON3 register

So set the interrupt bits 4 and 3

INTCON3.INT2IE
INTCON3.INT1IE

Flags are bit 1 and 0

INTCON3.INT2IF
INTCON3.INT1IF

You can also set the priority High or Low
 
tnx for the fast reply....

tried it out and it works perfect.

These are the things I'm missing in the manual....
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top