Skip to content

Instantly share code, notes, and snippets.

@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 / SPI.h
Created April 17, 2012 16:35
msp430 mono audio from sdcard using Petit Fat FileSystem
//-----------------------------------------------------------------------------
// SPI.h - common function declarations for different SPI implementations
//-----------------------------------------------------------------------------
#ifndef SPI_H_
#define SPI_H_
/**
* SMCLK divider arguments for spi_set_divisor
* assumes 16MHz SMCLK. You need to change if you
* use a different frequency
@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 / 910.c
Created June 29, 2012 19:48
msp430 based avr910 AVR ISP programmer
/*
*
* File : 910.c
* Author : Minifloat
* Project: Launchprog
* Version: 1.2 on 10 May 2012
*
*/
#include <msp430.h>
@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 / main.c
Last active September 4, 2020 00:51
msp430g2553 simple USCI UART print
/*
* main.c - really simple USCI hardware UART code
*/
#include <msp430.h>
#include <stdint.h>
#include <stdio.h>
#if !defined(__MSP430_HAS_USCI__)
#error "This code written for the msp430g2553"
@RickKimball
RickKimball / startup_gcc.c diff
Created December 22, 2012 20:49
Energia - Timer based blink
$ diff linux/work/hardware/lm4f/cores/lm4f/startup_gcc.c ../hardware/lm4f/cores/lm4f/startup_gcc.c
71d70
< __attribute__((weak)) extern void Timer0IntHandler(void) {}
123c122
< Timer0IntHandler, // Timer 0 subtimer A
---
> IntDefaultHandler, // Timer 0 subtimer A
$
@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