Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 11th August 2004, 06:38 PM   (permalink)
Default Interrupts, edge or change?

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
Thorpydo is offline  
Old 11th August 2004, 07:05 PM   (permalink)
Default

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.
Exo is offline  
Old 11th August 2004, 07:44 PM   (permalink)
Default

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...
e is offline  
Old 11th August 2004, 10:03 PM   (permalink)
Default

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 is offline  
Old 12th August 2004, 02:53 AM   (permalink)
Default

Quote:
Originally Posted by Oznog
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.
StupidDum is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 04:01 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker