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
/* Enable HOCO, set to 50MHz, set CKSEL to HOCO | |
* ICLK by default is CKSEL / 1 | |
*/ | |
mov.l #0x80000, r10 | |
mov.w #0xA507, 1022[r10] ; Enable writing to Clock, Operating Power and VRCR registers | |
mov.b #0, 160[r10] ; Prepare for High-Speed power mode | |
nop | |
while_power_transitioning: | |
mov.b 160[r10], r11 | |
and #16, r11 |
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
/* Rotary Encoder ISR */ | |
ISR(PCINT0_vect) { | |
// Strawman ~3.75uS delay (@16MHz) so we can reliably detect the detent signal (A & B transition at the same time) even though | |
// the A & B signals are still technically 1-2uS apart. | |
_delay_loop_1(20); | |
// Analog inputs are all on PORTA | |
char pins = (~PINA) & 0x03; // A0 + A1 | |
if ( (pins == 0x03 && rotPinsLast == 0x00) || (pins == 0x00 && rotPinsLast == 0x03) ) { // A & B | |
if (rotTurning) { | |
if (rotDir == 1) { // Completed a clockwise turn |
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
/* nRFDMX Remote Control implementation to send 3-letter RGB values based | |
* on a user-adjusted HSV colorspace system. | |
* Value adjusted by sliding potentiometer | |
* Hue adjusted by rotating a Rotary Encoder | |
* Saturation flipped between 1.0 and 0.1 by the rotary encoder pushbutton | |
*/ | |
#include <msp430.h> | |
#include <stdint.h> | |
#include <sys/cdefs.h> |
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
/* Wolverine Lightning Sensor Logger | |
* | |
* A sensor logging application for the TI MSP430 Wolverine which utilizes | |
* the Austria Microsystems AS3935 Franklin Lightning Sensor to sense lightning | |
* strikes and log them, timestamped, into the Wolverine's FRAM. | |
*/ | |
#include <SPI.h> | |
#include <Franklin.h> | |
#include <RTC_B.h> | |
#include <string.h> |
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
> help | |
Wolverine Franklin Lightning Logger | |
CLI syntax: | |
help - Print this help | |
count - Get a count of lightning events currently logged | |
limit - Get the max # of events storable in the FRAM buffer | |
retrieve <#> - Retrieve the #'th entry (starting at 0), or "all" pulls all events. | |
purge - Purge all lightning events from FRAM buffer | |
disable - Place AS3935 in low-power off mode | |
enable - Wake AS3935 into listening mode |
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
#include <msp430.h> | |
#include <stdint.h> | |
#include "flash.h" | |
#define SEG_INFOB __attribute__((section(".infob"))) | |
#define DMX_PASSWORD_VALID ((uint16_t) 0xFEF5) | |
uint16_t SEG_INFOB _dmx_password = 0x0505; | |
uint16_t SEG_INFOB _dmx_red = 0x00FF; |
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
/* Simple F5xxx Flash Erase/Write primitives | |
* 2014 Eric Brundick <spirilis@linux.com> | |
*/ | |
#include <msp430.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include "flash.h" | |
int flash_erase_info(void *loc) | |
{ |
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
/* Wolverine Lightning Sensor Logger | |
* | |
* A sensor logging application for the TI MSP430 Wolverine which utilizes | |
* the Austria Microsystems AS3935 Franklin Lightning Sensor to sense lightning | |
* strikes and log them, timestamped, into the Wolverine's FRAM. | |
*/ | |
#include <SPI.h> | |
#include <Franklin.h> | |
#include <RTC_B.h> | |
#include <string.h> |
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
/* RadioBot - IRC bot with Radio support */ | |
#include <IrcBot.h> | |
#include <Ethernet.h> | |
#include <EthernetClient.h> | |
#include <Enrf24.h> | |
#include <SPI.h> | |
#include <Pkt.h> | |
byte ourMac[] = { 0x52, 0x54, 0xFF, 0xFF, 0xFF, 0x01 }; |
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
/* Public domain software */ | |
#ifndef HIGHMEM_INLINE_H | |
#define HIGHMEM_INLINE_H | |
#include <msp430.h> | |
#include <stdint.h> | |
__attribute__((always_inline)) | |
inline static void highmem_write(uint32_t dstaddr, void *srcaddr, uint16_t len) | |
{ |