Skip to content

Instantly share code, notes, and snippets.

@ericfont
ericfont / minimal_spi.cpp
Last active March 27, 2025 06:59 — forked from bjornvaktaren/minimal_spi.cpp
Simple SPI example with libftdi and FTDI UM232H
// Quite minimal example showing how to configure MPSSE for SPI using libftdi
// compile like this: g++ minimal_spi.cpp -o minimal_spi -lftdi1 -Wno-deprecated
#include <libftdi1/ftdi.h>
#include <libftdi1/ftdi.hpp>
#include <usb.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <time.h>
@ericfont
ericfont / circuit-20250315-1613.svg
Created March 15, 2025 20:13
top up comparator (or opamp) compensation bias voltage periodically
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericfont
ericfont / circuit-20250315-0303.svg
Created March 15, 2025 07:04
double-buffer-and-offset-compensation (intended for MCP6004 with +/- 30mV offset) for buffer complementary decaying exponentials centered about 2.5V
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericfont
ericfont / circuit-20250315-0046.svg
Created March 15, 2025 04:46
loose but not quite attempt at op amp buffer cancellation for an RC circuit +/- buffering.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericfont
ericfont / circuit-20250314-2126.svg
Created March 15, 2025 01:26
create two decaying exponents, this time use op-amp inverting config, which allows easy offset-voltage compensating by adjusting positive input pin
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericfont
ericfont / circuit-20250314-2100.svg
Created March 15, 2025 01:00
simple circuit generate two opposite buffered decaying exponentials (but probably suffers from offet voltage issues)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericfont
ericfont / program_Olimex-iCE40HX1K-EVB_from_FT232H.md
Created February 27, 2025 03:42
program_Olimex-iCE40HX1K-EVB_from_FT232H.md

FT232H over USB from linux computer used to program Olimex iCE40HX1K-EVB flash chip. First applied 5v power from USB to pin 1 and GND to pin 2 of the BH34R extension header. Then connected the first 4 pins of the FT232H's AD port to the olimex's UEXT header like:

FT232H Olimex UEXT
ADO (CLK) 9 (iCE40-SCK)
AD1 (MOSI) 8 (iCE40-SDO)
AD2 (MISO) 7 (iCE40-SDI)
AD3 (CS) 10 (iCE40-SS)

Then after build the blinky test program, then before using FLASHROM I need to first expand the blinky.bin image from 32kB to be 2MB by using command:

@ericfont
ericfont / circuit-20250130-0155.svg
Last active January 30, 2025 07:00
TL431 regulate 4.75-5.5V USB supply through LED down to 2.50674V within 1 mV
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericfont
ericfont / circuit-20250129-2056.svg
Created January 30, 2025 01:58
TL431 regulating "5V" USB supply 4.75-5.5V range to limit under 5.032 V, simulated in circuitjs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericfont
ericfont / circuit-20250128-0142.svg
Created January 28, 2025 06:43
simple cheap (power-wasting) voltage step-down regulator from 3.3V to 1.2V using zener & led
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.