Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
334 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,19 @@ | |||
/* | |||
Blink | |||
Turns on an LED on for one second, then off for one second, repeatedly. | |||
This example code is in the public domain. | |||
*/ | |||
|
|||
void setup() { | |||
// initialize the digital pin as an output. | |||
// Pin 13 has an LED connected on most Arduino boards: | |||
pinMode(13, OUTPUT); | |||
} | |||
|
|||
void loop() { | |||
digitalWrite(13, HIGH); // set the LED on | |||
delay(1000); // wait for a second | |||
digitalWrite(13, LOW); // set the LED off | |||
delay(1000); // wait for a second | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<?ccsproject version="1.0"?> | |||
|
|||
<projectOptions> | |||
<deviceVariant value="MSP430G2231"/> | |||
<deviceEndianness value="little"/> | |||
<codegenToolVersion value="3.3.0"/> | |||
<isElfFormat value="false"/> | |||
<linkerCommandFile value="lnk_msp430g2231.cmd"/> | |||
<rts value="libc.a"/> | |||
<defaultAssemblyOnly value="false"/> | |||
</projectOptions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,88 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<?fileVersion 3.1.0?> | |||
|
|||
<ManagedProjectBuildInfo> | |||
<project id="BlinkLED.com.ti.ccstudio.buildDefinitions.MSP430.ProjectType.1006406853" name="MSP430" projectType="com.ti.ccstudio.buildDefinitions.MSP430.ProjectType"> | |||
<configuration artifactExtension="out" artifactName="BlinkLED" description="" id="com.ti.ccstudio.buildDefinitions.MSP430.Debug.675927986" name="Debug" parent="com.ti.ccstudio.buildDefinitions.MSP430.Debug"> | |||
<toolChain id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.DebugToolchain.1720186555" name="TI Code Generation Tools" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.DebugToolchain" targetTool="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.linkerDebug.768057698"> | |||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.741955528" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="3.3.0" valueType="string"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.325449300" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> | |||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=MSP430G2231"/> | |||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> | |||
<listOptionValue builtIn="false" value="IS_ELF=false"/> | |||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lnk_msp430g2231.cmd"/> | |||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> | |||
<listOptionValue builtIn="false" value="IS_ASSEMBLY_ONLY=false"/> | |||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=4.1.3"/> | |||
<listOptionValue builtIn="false" value="PROJECT_KIND=com.ti.ccstudio.managedbuild.core.ProjectKind_Executable"/> | |||
</option> | |||
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.compilerDebug.394377245" name="MSP430 Compiler" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.compilerDebug"> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.DIAG_WARNING.906683647" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.DIAG_WARNING" valueType="stringList"> | |||
<listOptionValue builtIn="false" value="225"/> | |||
</option> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.PRINTF_SUPPORT.1171024859" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.PRINTF_SUPPORT" value="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.PRINTF_SUPPORT.minimal" valueType="enumerated"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.SILICON_VERSION.727405436" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.SILICON_VERSION.msp" valueType="enumerated"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.INCLUDE_PATH.679291536" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.INCLUDE_PATH" valueType="includePath"> | |||
<listOptionValue builtIn="false" value=""${CCS_INSTALL_ROOT}/msp430/include""/> | |||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> | |||
</option> | |||
</tool> | |||
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.linkerDebug.768057698" name="MSP430 Linker" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.linkerDebug"> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.HEAP_SIZE.216822255" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.HEAP_SIZE" value="0" valueType="string"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.STACK_SIZE.387566209" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.STACK_SIZE" value="50" valueType="string"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.OUTPUT_FILE.239693915" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.OUTPUT_FILE" value=""BlinkLED.out"" valueType="string"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.MAP_FILE.1828838427" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.MAP_FILE" value=""BlinkLED.map"" valueType="string"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.LIBRARY.118044067" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.LIBRARY" valueType="libs"> | |||
<listOptionValue builtIn="false" value=""libc.a""/> | |||
</option> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.SEARCH_PATH.2036282304" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.SEARCH_PATH" valueType="stringList"> | |||
<listOptionValue builtIn="false" value=""${CCS_INSTALL_ROOT}/msp430/include""/> | |||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/> | |||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> | |||
</option> | |||
</tool> | |||
<macros/> | |||
</toolChain> | |||
</configuration> | |||
<configuration artifactExtension="out" artifactName="BlinkLED" description="" id="com.ti.ccstudio.buildDefinitions.MSP430.Release.2084110263" name="Release" parent="com.ti.ccstudio.buildDefinitions.MSP430.Release"> | |||
<toolChain id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.ReleaseToolchain.535168289" name="TI Code Generation Tools" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.ReleaseToolchain" targetTool="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.linkerRelease.1488283697"> | |||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION.2139045149" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_CODEGEN_VERSION" value="3.3.0" valueType="string"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS.35082550" superClass="com.ti.ccstudio.buildDefinitions.core.OPT_TAGS" valueType="stringList"> | |||
<listOptionValue builtIn="false" value="DEVICE_CONFIGURATION_ID=MSP430G2231"/> | |||
<listOptionValue builtIn="false" value="DEVICE_ENDIANNESS=little"/> | |||
<listOptionValue builtIn="false" value="IS_ELF=false"/> | |||
<listOptionValue builtIn="false" value="LINKER_COMMAND_FILE=lnk_msp430g2231.cmd"/> | |||
<listOptionValue builtIn="false" value="RUNTIME_SUPPORT_LIBRARY=libc.a"/> | |||
<listOptionValue builtIn="false" value="IS_ASSEMBLY_ONLY=false"/> | |||
<listOptionValue builtIn="false" value="CCS_MBS_VERSION=4.1.3"/> | |||
<listOptionValue builtIn="false" value="PROJECT_KIND=com.ti.ccstudio.managedbuild.core.ProjectKind_Executable"/> | |||
</option> | |||
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.compilerRelease.524459864" name="MSP430 Compiler" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.compilerRelease"> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.DIAG_WARNING.97350922" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.DIAG_WARNING" valueType="stringList"> | |||
<listOptionValue builtIn="false" value="225"/> | |||
</option> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.PRINTF_SUPPORT.792259939" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.PRINTF_SUPPORT" value="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.PRINTF_SUPPORT.minimal" valueType="enumerated"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.SILICON_VERSION.498135228" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.SILICON_VERSION" value="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.SILICON_VERSION.msp" valueType="enumerated"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.INCLUDE_PATH.1985814365" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.compilerID.INCLUDE_PATH" valueType="includePath"> | |||
<listOptionValue builtIn="false" value=""${CCS_INSTALL_ROOT}/msp430/include""/> | |||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> | |||
</option> | |||
</tool> | |||
<tool id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.linkerRelease.1488283697" name="MSP430 Linker" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.exe.linkerRelease"> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.HEAP_SIZE.888025707" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.HEAP_SIZE" value="0" valueType="string"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.STACK_SIZE.396688871" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.STACK_SIZE" value="50" valueType="string"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.OUTPUT_FILE.1884395154" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.OUTPUT_FILE" value=""BlinkLED.out"" valueType="string"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.MAP_FILE.563301963" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.MAP_FILE" value=""BlinkLED.map"" valueType="string"/> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.LIBRARY.326497401" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.LIBRARY" valueType="libs"> | |||
<listOptionValue builtIn="false" value=""libc.a""/> | |||
</option> | |||
<option id="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.SEARCH_PATH.997149327" superClass="com.ti.ccstudio.buildDefinitions.MSP430_3.3.linkerID.SEARCH_PATH" valueType="stringList"> | |||
<listOptionValue builtIn="false" value=""${CCS_INSTALL_ROOT}/msp430/include""/> | |||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/lib""/> | |||
<listOptionValue builtIn="false" value=""${CG_TOOL_ROOT}/include""/> | |||
</option> | |||
</tool> | |||
</toolChain> | |||
</configuration> | |||
</project> | |||
</ManagedProjectBuildInfo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<?eclipse-cdt version="2.0"?> | |||
|
|||
<cdtproject id="org.eclipse.cdt.managedbuilder.core.managedMake"> | |||
<extension id="org.eclipse.cdt.managedbuilder.core.ManagedBuildManager" point="org.eclipse.cdt.core.ScannerInfoProvider"/> | |||
<extension id="com.ti.ccstudio.binaryparser.CoffParser" point="org.eclipse.cdt.core.BinaryParser"/> | |||
<data> | |||
<item id="org.eclipse.cdt.core.pathentry"> | |||
<pathentry kind="src" path=""/> | |||
<pathentry kind="out" path=""/> | |||
<pathentry kind="con" path="org.eclipse.cdt.managedbuilder.MANAGED_CONTAINER"/> | |||
<pathentry kind="con" path="com.ti.ccstudio.managedbuild.core.CCS_CONTAINER"/> | |||
</item> | |||
</data> | |||
</cdtproject> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,20 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<projectDescription> | |||
<name>BlinkLED</name> | |||
<comment></comment> | |||
<projects> | |||
</projects> | |||
<buildSpec> | |||
<buildCommand> | |||
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name> | |||
<arguments> | |||
</arguments> | |||
</buildCommand> | |||
</buildSpec> | |||
<natures> | |||
<nature>org.eclipse.cdt.core.cnature</nature> | |||
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature> | |||
<nature>org.eclipse.cdt.core.ccnature</nature> | |||
<nature>com.ti.ccstudio.managedbuild.core.ccsNature</nature> | |||
</natures> | |||
</projectDescription> |
6 changes: 6 additions & 0 deletions
6
blink/msp430BlinkLED/.settings/org.eclipse.cdt.managedbuilder.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,6 @@ | |||
#Sat Sep 10 08:14:27 EDT 2011 | |||
com.ti.ccstudio.buildDefinitions.MSP430.Debug.675927986/internalBuilder/enabled=false | |||
com.ti.ccstudio.buildDefinitions.MSP430.Debug.675927986/internalBuilder/ignoreErr=true | |||
com.ti.ccstudio.buildDefinitions.MSP430.Release.2084110263/internalBuilder/enabled=false | |||
com.ti.ccstudio.buildDefinitions.MSP430.Release.2084110263/internalBuilder/ignoreErr=true | |||
eclipse.preferences.version=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |||
<configurations XML_version="1.2" id="configurations_0"> | |||
<configuration XML_version="1.2" id="configuration_0"> | |||
<instance XML_version="1.2" desc="TI MSP430 USB1" href="connections\TIMSP430-USB.xml" id="TI MSP430 USB1" xml="TIMSP430-USB.xml" xmlpath="connections"/> | |||
<connection XML_version="1.2" id="TI MSP430 USB1"> | |||
<instance XML_version="1.2" href="drivers\msp430_emu.xml" id="drivers" xml="msp430_emu.xml" xmlpath="drivers"/> | |||
<platform XML_version="1.2" id="platform_0"> | |||
<instance XML_version="1.2" desc="MSP430G2231" href="devices\MSP430G2231.xml" id="MSP430G2231" xml="MSP430G2231.xml" xmlpath="devices"/> | |||
</platform> | |||
</connection> | |||
</configuration> | |||
</configurations> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
This sample code was taken from the Texas Instruments wiki: | |||
|
|||
http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_Drive_LED |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,95 @@ | |||
/******************************************************************************/ | |||
/* lnk_msp430g2231.cmd - LINKER COMMAND FILE FOR LINKING MSP430G2231 PROGRAMS */ | |||
/* */ | |||
/* Usage: lnk430 <obj files...> -o <out file> -m <map file> lnk.cmd */ | |||
/* cl430 <src files...> -z -o <out file> -m <map file> lnk.cmd */ | |||
/* */ | |||
/*----------------------------------------------------------------------------*/ | |||
/* These linker options are for command line linking only. For IDE linking, */ | |||
/* you should set your linker options in Project Properties */ | |||
/* -c LINK USING C CONVENTIONS */ | |||
/* -stack 0x0100 SOFTWARE STACK SIZE */ | |||
/* -heap 0x0100 HEAP AREA SIZE */ | |||
/* */ | |||
/*----------------------------------------------------------------------------*/ | |||
|
|||
|
|||
/****************************************************************************/ | |||
/* SPECIFY THE SYSTEM MEMORY MAP */ | |||
/****************************************************************************/ | |||
|
|||
MEMORY | |||
{ | |||
SFR : origin = 0x0000, length = 0x0010 | |||
PERIPHERALS_8BIT : origin = 0x0010, length = 0x00F0 | |||
PERIPHERALS_16BIT : origin = 0x0100, length = 0x0100 | |||
RAM : origin = 0x0200, length = 0x0080 | |||
INFOA : origin = 0x10C0, length = 0x0040 | |||
INFOB : origin = 0x1080, length = 0x0040 | |||
INFOC : origin = 0x1040, length = 0x0040 | |||
INFOD : origin = 0x1000, length = 0x0040 | |||
FLASH : origin = 0xF800, length = 0x07E0 | |||
INT00 : origin = 0xFFE0, length = 0x0002 | |||
INT01 : origin = 0xFFE2, length = 0x0002 | |||
INT02 : origin = 0xFFE4, length = 0x0002 | |||
INT03 : origin = 0xFFE6, length = 0x0002 | |||
INT04 : origin = 0xFFE8, length = 0x0002 | |||
INT05 : origin = 0xFFEA, length = 0x0002 | |||
INT06 : origin = 0xFFEC, length = 0x0002 | |||
INT07 : origin = 0xFFEE, length = 0x0002 | |||
INT08 : origin = 0xFFF0, length = 0x0002 | |||
INT09 : origin = 0xFFF2, length = 0x0002 | |||
INT10 : origin = 0xFFF4, length = 0x0002 | |||
INT11 : origin = 0xFFF6, length = 0x0002 | |||
INT12 : origin = 0xFFF8, length = 0x0002 | |||
INT13 : origin = 0xFFFA, length = 0x0002 | |||
INT14 : origin = 0xFFFC, length = 0x0002 | |||
RESET : origin = 0xFFFE, length = 0x0002 | |||
} | |||
|
|||
/****************************************************************************/ | |||
/* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */ | |||
/****************************************************************************/ | |||
|
|||
SECTIONS | |||
{ | |||
.bss : {} > RAM /* GLOBAL & STATIC VARS */ | |||
.sysmem : {} > RAM /* DYNAMIC MEMORY ALLOCATION AREA */ | |||
.stack : {} > RAM (HIGH) /* SOFTWARE SYSTEM STACK */ | |||
|
|||
.text : {} > FLASH /* CODE */ | |||
.cinit : {} > FLASH /* INITIALIZATION TABLES */ | |||
.const : {} > FLASH /* CONSTANT DATA */ | |||
.cio : {} > RAM /* C I/O BUFFER */ | |||
|
|||
.pinit : {} > FLASH /* C++ CONSTRUCTOR TABLES */ | |||
|
|||
.infoA : {} > INFOA /* MSP430 INFO FLASH MEMORY SEGMENTS */ | |||
.infoB : {} > INFOB | |||
.infoC : {} > INFOC | |||
.infoD : {} > INFOD | |||
|
|||
.int00 : {} > INT00 /* MSP430 INTERRUPT VECTORS */ | |||
.int01 : {} > INT01 | |||
.int02 : {} > INT02 | |||
.int03 : {} > INT03 | |||
.int04 : {} > INT04 | |||
.int05 : {} > INT05 | |||
.int06 : {} > INT06 | |||
.int07 : {} > INT07 | |||
.int08 : {} > INT08 | |||
.int09 : {} > INT09 | |||
.int10 : {} > INT10 | |||
.int11 : {} > INT11 | |||
.int12 : {} > INT12 | |||
.int13 : {} > INT13 | |||
.int14 : {} > INT14 | |||
.reset : {} > RESET /* MSP430 RESET VECTOR */ | |||
} | |||
|
|||
/****************************************************************************/ | |||
/* INCLUDE PERIPHERALS MEMORY MAP */ | |||
/****************************************************************************/ | |||
|
|||
-l msp430g2231.cmd | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,63 @@ | |||
//*************************************************************************************** | |||
// MSP430 Blink LED / Start Stop Blinking with Button Demo - Software Toggle P1.0 & P1.6 | |||
// | |||
// Description; Toggle P1.0 and P1.6 by xor'ing them inside of a software loop. To | |||
// start/stop blink, an interrupt in Port 1 will toggle the condition statement. | |||
// ACLK = n/a, MCLK = SMCLK = default DCO | |||
// | |||
// MSP430x2xx | |||
// ----------------- | |||
// /|\| XIN|- | |||
// | | | | |||
// --|RST XOUT|- | |||
// | P1.6|-->LED | |||
// Button -->|P1.3 P1.0|-->LED | |||
// | |||
// Aldo Briano | |||
// Texas Instruments, Inc | |||
// June 2010 | |||
// Built with Code Composer Studio v4 | |||
//*************************************************************************************** | |||
#include <msp430g2231.h> | |||
|
|||
|
|||
#define LED_0 BIT0 | |||
#define LED_1 BIT6 | |||
#define LED_OUT P1OUT | |||
#define LED_DIR P1DIR | |||
#define BUTTON BIT3 | |||
|
|||
unsigned int blink = 0; | |||
|
|||
void main(void) | |||
{ | |||
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer | |||
LED_DIR |= (LED_0 + LED_1); // Set P1.0 and P1.6 to output direction | |||
LED_OUT &= ~(LED_0 + LED_1); // Set the LEDs off | |||
P1IE |= BUTTON; | |||
|
|||
__enable_interrupt(); | |||
|
|||
for (;;) | |||
{ | |||
|
|||
if(blink > 0) | |||
{ | |||
P1OUT ^= (LED_0 + LED_1); // Toggle P1.0 and P1.6 using exclusive-OR | |||
|
|||
__delay_cycles(100000); // SW Delay of 10000 cycles at 1Mhz | |||
|
|||
} | |||
} | |||
|
|||
} | |||
|
|||
// Port 1 interrupt service routine | |||
#pragma vector=PORT1_VECTOR | |||
__interrupt void Port_1(void) | |||
{ | |||
blink ^= 0x01; | |||
P1IFG &= ~BUTTON; // P1.3 IFG cleared | |||
LED_OUT &= ~(LED_0 + LED_1); // Clear the LEDs so they start in OFF state | |||
|
|||
} |