Setup
3. Connect a voltage source to the TPL5111EVM as described in either
or
.
4. Place the S_ON_OFF switch of the TPL5111EVM in the appropriate position
WARNING
Do NOT use the DONE switch in this configuration. The DONE
signal should be supplied by the MSP430 on the Launchpad.
Example Code
Once loaded into the MSP430 of the Launchpad, the code below performs the following functions, in
sequence:
•
At power on, the green LED present on the Launchpad is turned on.
•
Then the red LED present on the Launchpad is turned on
•
After that both green and red LEDs are turned off
•
The MSP430 sends the DONE signal to the TPL5111
Before launching the code set a timer interval > 5s (REXT_1 || REXT_2 > 8.85K
Ω
)
#include <msp430.h>
int main(void)
{
WDTCTL = WDTPW+WDTHOLD;
// Stop watchdog timer
__delay_cycles(50000);
// Set Delay;
P1DIR |= BIT0;
// Set P1.0 to output direction
P2DIR |= BIT3;
// Set P2.3 to output direction
P4DIR |= BIT7;
// Set P4.7 to output direction
P1OUT &= ~BIT0;
// Set P1.0 RED LED OFF
P2OUT &= ~BIT3;
// Set P2.3 DONE Low
P4OUT &= ~BIT7;
// Set P4.7 GREEN LED OFF
while (1)
{
__delay_cycles(10000);
// Set Delay;
P4OUT |= BIT7;
// Set P4.7 GREEN LED ON
__delay_cycles(1000000);
// Set Delay;
P1OUT |= BIT0;
// Set P1.0 RED LED ON
__delay_cycles(500000);
// Set Delay;
P1OUT &= ~BIT0;
// Set P1.0 RED LED OFF
P4OUT &= ~BIT7;
// Set P4.7 GREEN LED OFF
__delay_cycles(100000);
// Set Delay;
P2OUT |= BIT3;
// Done High
__delay_cycles(1000);
// Set Delay;
P2OUT &= ~BIT3;
// Set P2.3 DONE Low
}
}
5
SNAU183 – July 2015
TPL5111EVM User 's Guide
Copyright © 2015, Texas Instruments Incorporated