Hi Everybody
I have a problem using MSP430 interrupts.
The thing I want to do is to toggle the P1.0 Pin on "MSP430F6137" on a "Low to High transition" on pin P1.7 (i have attached a read switch with a debounce circuit)
here is my circuit:

the circuit works well in normal condition but when i turn on a DC motor (3 Volt - 20mA) The LED Blinks very fast (Much faster than the Input Clock of P1.7)
The pull-down resistor (for P1.7) is Enabled. I want to Eliminate the bounce with hardware circuit to avoid unwanted interrupt.(after this step i'm going to Use it in very low power mode)
Is it Noise that generate Interrupt ?
Is there any problem with my code?
and here is my code:
void main( void )
{
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW + WDTHOLD;
// Set up the button as interruptible
P1DIR &= ~BIT7;
P1REN |= BIT7;
P1IES |= BIT7;
P1IFG = 0;
P1OUT &= ~BIT7;
P1IE |= BIT7;
// Initialize Port J
PJOUT = 0x00;
PJDIR = 0xFF;
// Set up LEDs
P1OUT &= ~BIT0;
P1DIR |= BIT0;
P3OUT &= ~BIT6;
P3DIR |= BIT6;
while (1)
{
__bis_SR_register( LPM3_bits + GIE );
__no_operation();
}
}
//*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.
// Port 1 interrupt service routine
#pragma vector=PORT1_VECTOR
__interrupt void Port_1(void)
{
switch (__even_in_range(P1IV,16))
{
case 0: break;
case 2: break;
case 4: break;
case 6: break;
case 8: break;
case 10:break;
case 12:break;
case 14:break;
case 16:
P1OUT ^= BIT0;
break;
}
}
The P1.7 Pulse Image:

as you seen the Low to High Pulse is sharp but when the DC motor is ON The MCU Generate Unwanted Interrupt every where (not only in Low to High transition)
The DC motor Supply voltage is completely Isolated from MCU Power supply.
Thank U
and
HAPPY NEW YEAR


