Dear Sir,
Please help me to get multiple interrupt on Same Port, I have written code for Single port interrupt, And here i have inserted whatever i have written for port interrupt code.
#include <msp430g2553.h>
void main(void) {
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P1DIR |= BIT0; // Set P1.0 to output direction
P1OUT &= ~BIT0; // Set LED off
P1SEL &= ~BIT3; // Select Port 1 P1.3 (push button)
P1DIR &= ~BIT3; // Port 1 P1.3 (push button) as input, 0 is input
P1REN |= BIT3; // Enable Port P1.3 (push button) pull-up resistor
P1IE |= BIT3; // Port 1 Interrupt Enable P1.3 (push button)
P1IFG &= ~BIT3; // Clear interrupt flag
_BIS_SR(GIE); // Enable interrupts
}
// Port 1 interrupt service routine
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void) {
P1IFG &= ~BIT3; // P1.3 Interrupt Flag cleared
P1OUT ^= BIT0; // Toggle LED state
}