I want to use external interrupts on Pin P1.2 & p1.3 for frequancy measurement When Positive transition occours on pin External interrupt should be occour And in interrupt vector I want to increment one count time base is generated by timer 0 for ).1 seconds.
My probelm is even thouh frquancy of 1 Khz is applied to Pin P1.2 interrupt is not generate.
I want to know regisier detail configurations of resigistrs so that externl interrupt will generate
You don't have to set much to get the interrupts.
Here is some very basic code.
#include <reg517a.h> volatile char events_cc2; volatile char events_cc3; void T2_CC2(void) interrupt 12 { events_cc2++; } void T2_CC3(void) interrupt 13 { events_cc3++; } void main(void) { EAL = 1; /* globally enable interrupts */ T2CON |= 0x11; /* timer with auto-reload */ EX5 = 1; /* CC2/ext5 interrupt is enabled */ EX6 = 1; /* CC3/ext6 interrupt is enabled */ /* Capture on positive transition at pin P1.3/CC3 * Capture on positive transition at pin P1.2/CC2 */ CCEN = 0x50; for(;;) { } }