Skip to content

Instantly share code, notes, and snippets.

@cochrane
cochrane / OpenTomb Trace
Created June 10, 2015 05:21
OpenTomb Trace
Sampling process 47859 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling OpenTomb (pid 47859) every 1 millisecond
Process: OpenTomb [47859]
Path: /Users/tk/Library/Developer/Xcode/DerivedData/OpenTomb-bterfnixcryfnagjojhhvsisbxrx/Build/Products/Debug/OpenTomb.app/Contents/MacOS/OpenTomb
Load Address: 0x100000000
Identifier: org.opentomb.OpenTomb
Version: 1.0 (1)
Code Type: X86-64
Parent Process: debugserver [47860]
@cochrane
cochrane / msp430dcc.c
Created March 3, 2014 21:40
Decoding DCC with MSP 430
/*
* Parsing DCC with MSP 430 (very simple example).
*
* DCC is a protocol for controlling model railroads, including trains, signals, switches and so on.
* It is an open standard; the documentation can be found at http://www.nmra.org/standards/sandrp/consist.html
* Most relevant are S-9.1 (DCC Electrical Standard) and S-9.2 (DCC Communications Standard). The sub-standards can be useful, too.
*
* This is heavily based on the work at http://www.opendcc.org (though no code was copied, since they use different microcontrollers). Specifically this implements option 2 of http://www.opendcc.org/elektronik/opendecoder/opendecoder_sw_dcc.html
*
* Hardware: I'm using a simple version with a 1k resistor and a diode to ground (I'm rectifying the DCC signal anyway). An optocoupler can work, too, has the advantage that supply power can be sourced externally.