Hello , im trying to use two external interrupts INT0,INT1 , just to use two limit switches but both dont work i dont know why ? here's the code i used.
void ex0_isr (void) interrupt 0 { Motor3_2=0; Motor3_3=0; } void ex1_isr (void) interrupt 1 { Motor1_2=0; Motor1_3=0; } void main(void) { // Initializations IT0 = 1; // Configure interrupt 0 for falling edge on /INT0 (P3.2) EX0 = 1; IT1 = 1; // Configure interrupt 0 for falling edge on /INT0 (P3.2) EX1 = 1; PX0 = 1; PX1 = 1; // Enable EX0 Interrupt EA = 1; // Enable Global Interrupt Flag Motor3_2=1; Motor3_3=0; Motor1_2=1; Motor1_3=0; while(1); }
... interrupt numbers...
also, why do you set the ints for high priority, as you have done it it makes no difference
it is bible time
Erik
here are the links to "the bible" Chapter 1 - 80C51 Family Architecture: www.nxp.com/.../80C51_FAM_ARCH_1.pdf
Chapter 2 - 80C51 Family Programmer’s Guide and Instruction Set: www.nxp.com/.../80C51_FAM_PROG_GUIDE_1.pdf
Chapter 3 - 80C51 Family Hardware Description: www.nxp.com/.../80C51_FAM_HARDWARE_1.pdf
Specifically: http://www.keil.com/support/man/docs/c51/c51_le_interruptfuncs.htm