PIC (MikroC) (MPLAB)/Interrupt (Mikroc용)
MikroC용 Interrupt
ElectricShock
2016. 6. 29. 20:56
https://electrosome.com/interrupt-pic-microcontroller/
void main() { TRISC = 0; // To configure PORTC as output port OPTION_REG.INTEDG = 1; // Set Rising Edge Trigger for INT INTCON.GIE = 1; // Global Interrupt Enable INTCON.INTE = 1; // INT Enable while(1) { PORTC = 0x00; //Set some value at PortD }
} void interrupt() // ISR { INTCON.INTF=0; // Clear the interrupt 0 flag PORTC=~PORTC; // Invert (Toggle) the value at PortD Delay_ms(1000); // Delay for 1 sec }