Skip to content

Instantly share code, notes, and snippets.

View ozel's full-sized avatar
📻
most likely soldering or shifting bits

Oliver Keller ozel

📻
most likely soldering or shifting bits
View GitHub Profile

Resurrecting NTC C.H.I.P. computers

Introduction

I bought four of the Next Thing Co. (defunct since 2018) C.H.I.P. (CHIP hereafter) computers shortly after their successful Kickstarter campaign of 2015. The CHIP computer is an interesting beast. It was positioned as a competitor the orginal Raspberry Pi and only cost US$8.00 before shipping. The Raspberry Pi cost US$25 at the time. The CHIP had some features that the Pi did not at the time including built-in wi-fi and battery charging. It was also considerably smaller the original Pi.

The CHIP was shipped with Debian 8 (Jessie) and was a capable Linux computer. I had big plans for all of them, but the

@newhouseb
newhouseb / delay_line.py
Created February 21, 2021 22:46
ECP5 Delay Line with ~50ps precision
# This is an nmigen delay line for ECP5 FPGAs using the open source toolchain. It strings together a series of
# manually placed carry chains into a "thermometer." It returns a signal that's (length) long that represents
# the chain "snapshotted" at the primary clock domain (using the flip flops colocated in the slice).
#
# This can be used in a Time to Digital Converter (i.e. to measure the time between to events) or in
# an ADC by comparing (with LVDS) a signal to a reference signal.
#
# Note that the bit precision (read: delay per carry element) varies as a function of temperature. On
# a LFE5U-25F-8MG285C, I've measure delay times of approximately 43ps on average. Due to assorted reasons,
# the delay time will vary between bits and due to variations in routing (even when manually places), you might
@branw
branw / samd51_1dac_2adc_dma.cpp
Last active March 21, 2024 18:52
Minimum working example of analog data acquisition with one output and two inputs on the SAMD51 Grand Central M4.
// Produces a sawtooth on A0 and samples A1 and A3 into buffers via DMA
#include <Adafruit_ZeroDMA.h>
#include <wiring_private.h> // for access to pinPeripheral
// Create buffers for DMAing data around -- the .dmabuffers section is supposed to
// optimize the memory location for the DMA controller
__attribute__ ((section(".dmabuffers"), used)) static uint16_t dac_buffer[4096], adc_buffer[2][4096];
void setup() {
@salotz
salotz / shimazaki_shinimoto_binning.py
Created January 9, 2020 18:16
Clean numpy-only implementation of the Shimazaki-Shinimoto histogram binning method as a function.
def shimazaki_shinimoto_binning(x, min_bins, max_bins):
"""The Shimazaki-Shinimoto histogram binning algorithm for choosing an
optimal constant number of bins.
Parameters
----------
x : array of int or float
The data you want to bin
# taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/
# generate server.pem with the following command:
# openssl req -new -x509 -keyout key.pem -out server.pem -days 365 -nodes
# run as follows:
# python simple-https-server.py
# then in your browser, visit:
# https://localhost:4443
import http.server
@smunaut
smunaut / gtkwave-sigrok-filter.py
Last active January 18, 2024 18:37
Transaction Filter Process for GTKWave to run SigRok protocol decoders
#!/usr/bin/env python3
"""
gtkwave-sigrok-filter.py
Use as a 'Transaction Filter Process' in gtkwave to apply signal
Usage:
- Group input signals in gtkwave with F4
- Apply this script as a 'Transaction Filter Process' (Right click / Data Format)
@alexanderhupfer
alexanderhupfer / main.py
Last active November 15, 2019 10:50
Display logfile in realtime with bokeh
# Plot logtime in realtime using bokeh and tail -f
# Tested with python 3.5 and bokeh 0.12.4
# OSX/Linux only
# usage:
# 1. run 'bokeh serve'
# 2. run 'python3.5 main.py logfile.csv'
# assumes a logfile.csv with format:
# min_ask,1489758134.150000,1077.00,1076.78,0.45
# max_bid,1489758139.660000,1076.56,1076.76,0.41
# min_ask,1489758142.076000,1076.95,1076.76,0.40
@cfangmeier
cfangmeier / keithley2410_SweepTest.py
Last active April 22, 2022 11:40
Creates an IV curve using Keithley 2410 Sweep Function
#!/usr/bin/env python3
import serial
import matplotlib.pyplot as plt
script = """
# hashes make comments
# @ on a read specifies the parser for the read data
*RST
:SENS:FUNC:CONC OFF #Turn off concurrent functions