Log in

View Full Version : IOC on 18F2580?



PaulMaker
- 27th September 2024, 23:20
Hi guys,

I'm trying to figure out how to trigger a routine when a especific pin changes from digital low to high.
I can eventually create a jump to a short check on that pin and then return to the main program but my first though was to use an interrupt and leave the check task to it.

Interrupt on change (IOC) was my first guess but checking the 18F2580 datasheet I cannot find any IOC register.


Does this mean that I cannot use an interrupt for this task on this MCU?

richard
- 27th September 2024, 23:54
Does this mean that I cannot use an interrupt for this task on this MCU?

why not use one of the interrupt pins int0 int1 int2
alternatively
portb pins 4 to 7 have interrupt on change capability

read data sheet interrupt section and i/o port sections chapters 9 and 10

PaulMaker
- 29th September 2024, 10:18
Greetings Richard,

you are correct. I can use RBC interrupt.

The only limitation is that, between RB4 and RB7, the pins that will trigger the interrupt are the ones set as inputs.
If I only want one pin, I need to set the others as outputs.

Thank you so much for your help.

Best regards