Skip to content

Instantly share code, notes, and snippets.

@nicholasjconn
nicholasjconn / printf.c
Created June 8, 2012 15:56
A printf() function for the MSP430
/******************************************************************************
* Reusable MSP430 printf()
*
* Description: This printf function was written by oPossum and originally
* posted on the 43oh.com forums. For more information on this
* code, please see the link below.
*
* http://www.43oh.com/forum/viewtopic.php?f=10&t=1732
*
* A big thanks to oPossum for sharing such great code!
@nicholasjconn
nicholasjconn / main.c
Created June 8, 2012 15:54
Testing printf() on the MSP430
/******************************************************************************
* MSP430G2553 printf() Tests
*
* Description: A modified version of the test code for testing oPossum's
* tiny printf() function. More information on the printf()
* function can be found at the following link.
*
* http://www.43oh.com/forum/viewtopic.php?f=10&t=1732
*
* This specific code tests the printf() function using
@nicholasjconn
nicholasjconn / ACLK_Test.c
Last active April 4, 2017 17:46
ACLK Test for LaunchPad (http://msp430launchpad.com)
/******************************************************************************
* MSP430G2553 ACLK Test
*
* Description: This code can be used to test if you have installed the
* 32.768kHz crystal on your LaunchPad correctly. Using this code
* LED1 (on P1.0) will turn on for 1 second, and off for one
* second. You can verify this with either an oscilloscope, logic
* analyzer, or by inspection. Simple as that!
*
* This code was originally created for "NJC's MSP430
/************************************************************************
* NJC's Simple LaunchPad DAC
*
* Description: This code turns the LaunchPad into a simple (slow)
* function generator that outputs a sine wave at 128Hz.
* For each point in a period signal, there is one
* smaller PWM period. For this example there are 32
* points per period. The duty cycle of each PWM period
* determines the analog value at that point in time.
* By continually changing the duty cycle, an analog
@nicholasjconn
nicholasjconn / gist:753207
Created December 23, 2010 16:26
NJS's MSP430 LaunchPad Oscilloscope
/******************************************************************************
* NJS's MSP430 LaunchPad Oscilloscope
*
* Description: This code turns the launchpad into a simple (slow)
* oscilloscope using a bi-directional software UART.
* The MCU will accept ascii commands from the computer
* for single measurment of a channel (internal and
* external) and also continous measuring of external
* channels.
*
/******************************************************************************
* MSP430 ADC10 Example for the G2231
*
* Description: This code provides an example for using the 10 bit ADC in the
* MSP430G2231. The code requires either a terminal program or
* the application provided on the blog mentioned below.
* depending on which ascii character is sent to the device,
* either VCC, the temperature sensor, or an external pin will
* be measured once and the results sent to the computer.
*
/******************************************************************************
* Half Duplex Software UART on the LaunchPad
*
* Description: This code provides a simple Bi-Directional Half Duplex
* Software UART. The timing is dependant on SMCLK, which
* is set to 1MHz. The transmit function is based off of
* the example code provided by TI with the LaunchPad.
* This code was originally created for "NJC's MSP430
* LaunchPad Blog".
*
//************************************************************************
// MSP430G2231 Demo - Timer_A, PWM TA1, Up Mode, SMCLK
//
// Description: This program generates one PWM output on P1.2 using
// Timer_A configured for up mode. The value in CCR0, 1000-1, defines the
// PWM period and the value in CCR1 the PWM duty cycles. Using SMCLK,
// the timer frequenciy is about 1.1kHz with a 25% duty cycle on P1.2.
// Normal operating mode is LPM0.
// MCLK = SMCLK = default DCO (about 1.1MHz).
//
//******************************************************************************
// MSP430F2013
//
// Description: Continuously sends a counter value over the USI in SPI which
// acting as if it were a UART. The sample circuit connects an
// FTDI breakout board to the transmit line and reads. The baud
// rate is determined by the USI speed, which in this case is
// 1100000 baud (DCO = 1.1MHz).
//
// Nicholas J. Conn
/******************************************************************************
* MSP-EXP430G2-LaunchPad Software UART Transmission
*
* Original Code: From MSP-EXP430G2-LaunchPad User Experience Application
* Original Author: Texas Instruments
*
* Description: This code shows the minimum neeed to send data over a software
* UART pin (P1.1). This is a highly condenced and modified version
* of the User Experience Application which comes programmed with
* the LaunchPad.