Skip to content

Instantly share code, notes, and snippets.

@RickKimball
RickKimball / gpio.h
Created January 11, 2012 22:45
msp430 template based gpio experiment
/*
* gpio.h - experimental template based c++ gpio abstraction
*
* Created on: Jan 14, 2012
* Author: kimballr
*
* 01/14/2012 - kimballr added volatile to SFR registers and force inline
* 01/16/2012 - kimballr more functions more experimentation
* 01/28/2012 - kimballr more complete implementation dealing with a 28 pin msp430g2553
*/
@RickKimball
RickKimball / framasram.x
Created March 21, 2012 00:08
msp430fr5750 - messing with fram as ram
/* Default linker script, for normal executables */
OUTPUT_FORMAT("elf32-msp430")
OUTPUT_ARCH("msp430")
INCLUDE memory.x
INCLUDE periph.x
SECTIONS
{
/* Read-only sections, merged into text segment. */
.hash : { *(.hash) }
.dynsym : { *(.dynsym) }
@RickKimball
RickKimball / main.c
Created April 10, 2012 03:20
msp430 port of tlv data dump
/**
* tlv_data dumper - msp430-gcc port
*
* see: http://www.43oh.com/forum/viewtopic.php?f=10&t=2547
*
*/
#include <msp430.h>
#include <stdint.h>
volatile unsigned ta0txbuf = 0; // Timer0_A0 Transmit buffer pseudo register
@RickKimball
RickKimball / pcmplayer.c
Created April 15, 2012 03:38
msp430 pcmaudio
/*
* pcmplayer.c - play the apple startup sound
*
* P1.2 - pwm output should be run through low pass filter.
*
* Like this one:
*
* http://www.arduino.cc/playground/Code/PCMAudio
*/
@RickKimball
RickKimball / main.c
Created April 29, 2012 22:58
msp430 launchpad user experience demo without legacy stuff
/*
* main.c
*
* MSP-EXP430G2-LaunchPad User Experience Application
*
* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
*
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@RickKimball
RickKimball / lcd7110.c
Created October 16, 2012 22:01
SugarAddict lcd driver
/*
* main.c
*/
#include "inc\hw_types.h"
#include "inc\hw_memmap.h"
#include "driverlib\pin_map.h"
#include "inc\lm4f120h5qr.h"
#include "driverlib\sysctl.h"
#include "driverlib\ssi.h"
#include "driverlib\gpio.h"
@RickKimball
RickKimball / test.cpp
Last active December 11, 2015 07:18
forum comment
uint32_t max31855::memory_read(void)
{
uint32_t mask = 0x80000000;
uint32_t data = 0;
digitalWrite(_cs,LOW);
do {
digitalWrite(_sclk, HIGH);
if (digitalRead(_so)) {
data |= mask;
@RickKimball
RickKimball / logo.inc
Last active December 12, 2015 02:59
xbmto5110 - convert xbm files to c structures usable with nokia 5110 lcd displays and oPossum nokia5110 template
/*
* lp_logo - nokia 5110 style bitmap
*
* Generated by xbmto5110 on Feb 3 2013 14:19:20
* Note: visualize the '1' and '0's rotated 90 degrees counterclockwise
*/
static const unsigned char lp_logo[] = {
/* width, height/8 */
56,48/8,
@RickKimball
RickKimball / asciitable.ino
Last active December 12, 2015 10:19
sw_serial_t - blocking software only cycle counting msp430 serial routines for Energia
/*
* aciitable - example of using the blocking sw_serial_t template
*/
#include "streaming.h" /* pull in insertion operator overloads */
#include "sw_serial.h"
// typedefs for software only rx/tx using software pin settings * J3 default jumper settings
// this is a good setting for the g2452 and g2231
sw_serial_t<9600, SS_P1_2, SS_NO_PIN> swserial; // HW jumper version TX=P1.2, RX=NOT CONNECTED
@RickKimball
RickKimball / signedtest.c
Created February 15, 2013 01:34
problem child for msp430-gcc 4.6.3 with patches
/**
* signedtest.c - this fails to output int8_t values properly when optimized with -Os
*
* Compiled like this:
*
* $ msp430-gcc -mmcu=msp430g2553 -DF_CPU=16000000 -Os -Wall \
* -Wno-main -g -mdisable-watchdog -fdata-sections -ffunction-sections \
* -Wl,--gc-sections signedtest.c
*
* $ mspdebug rf2500 "prog a.out"