Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Unwanted activation of output

$
0
0

Hi, 

 

I am new to the MSP430 and after a bit of advice please. I have an MSP430G2553 DPIP which is accepting an input of 2.5V (via a potential divider, input starts at 18V), when the input is detected the output switches on for a count and then goes off again. 

 

The problem I am having is that about 50% of the time when I power the circuit on (2 x AA batteries) the output immediately comes on, when there is no activate input. 

 

I have a 1K resistor to +V from the RST pin. 

I have a 1K resistor to GND from on my output pin

I have a 100K resistor to GND from my input pin

 

The output pin is then connected to a relay, 

 

 

Below is my program. 

 

#include <msp430.h>
 
long i = 0;
 
int main(void)
 
 
{
  WDTCTL = WDTPW + WDTHOLD;                 // Stop watchdog timer
  P1DIR |= 0x01;                                               // Set P1.0 to output direction
 
  for (;;)                                                             // infinite loop
  {
    if ((0x10 & P1IN))                                         // check if P1.4 is high
 
    {
    P1OUT |= 0x01;                                         // set P1.0 high
 
    for(i=0; i< 1000000; i++);                             // set P1.0 high for count of 1,000,000
 
    P1OUT &= ~0x01;                                      // set P1.0 to low
    }
 
  }
 
 
}

Viewing all articles
Browse latest Browse all 2077

Trending Articles