I am facing a problem while switching a transistor. I am trying make the LED blink through a transistor. The program works when I am taking the power (3.3V) from the evaluation board (i.e. MSP-EXP430G2ET). But code does not work when I am using external power (8.33V) to power the LED. I am using a BC547 transistor. A current limiting resistor of 470 ohms in series with LED and a base resistor Rb of 2.2K ohms (which allows around 3.7 mA to the base of the transistor) used when the power is 8.33V. While taking the power from the LDO I am using a current limiting resistor of 220 ohms and same Rb. The code is given below,
#include <msp430.h>
void main(void)
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
P1DIR |=BIT3;
unsigned int i;
while(1)
{
P1OUT ^= BIT3;
for(i=0; i<=30000; i++) ;
}
}
#include <msp430.h>
void main(void)
{
WDTCTL = WDTPW | WDTHOLD; // stop watchdog timer
P1DIR |=BIT3;
unsigned int i;
while(1)
{
P1OUT ^= BIT3;
for(i=0; i<=30000; i++) ;
}
}