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.

Interrupts, edge or change?

Status
Not open for further replies.

Thorpydo

New Member
Hey,

I'm running a 12F629 and was wondering if there are and advantages to using the edge interrupt as opposed to the pin change interrupt. Thanks
 
The int pin (edge) allows you to only interrupt on 1 edge (for example, only interrupt on positive edge) while interrupt on change will cause an interrupt on any change...

also, interrupt on change interrupts on a change of more then 1 pin (entire port B on the 18 pin chips, dont know for a 12f629). if you only have 1 interrupt source its better to use the int pin.
 
I have used both on the 12Fs, the pin int is nice but only available on 1 pin. But you can always use the int on change just the same by filtering the rising or falling edge in the service routine, makes it nice to have more than 1 pin interrupt...
 
The int-on-port-change is potentially confusing. Which pin was it? If it's only a short pulse on the pin, you may look at the bus, compare to what you copied off it last time, and see no change. Lost data, bummer. This is particularly likely if you've got a lot of interrupt code going on which may extend the time it takes to execute your portB change interrupt code.
 
Oznog said:
The int-on-port-change is potentially confusing. Which pin was it? If it's only a short pulse on the pin, you may look at the bus, compare to what you copied off it last time, and see no change. Lost data, bummer. This is particularly likely if you've got a lot of interrupt code going on which may extend the time it takes to execute your portB change interrupt code.

The "int-on-port-change" is especially useful for 4X4 keypad.
Whenever the keypad is pressed, this will generate an interrupt. Then you can start polling the lines' status.

Without this feature, you'd probably need to connect the 4 input lines to some logic gates to generate an interrupt on any pin change.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top