Program Lattice MachXO2/3 with CircuitPython
This is a CircuitPython library that allows updating the internal flash in a MachXO2/3 device through I2C with a CircuitPython board.
This library depends on:
It is highly recommended to use an ARM Cortex M4 board with sufficient memory to run CircuitPython. External SPI memory is likely required to store the MachXO image. This code was developed with the Adafruit Feather M4 Express
- load_jed.py is an example for programming a MachXO2/3 from a .jed file
- load_hex.py is an example for programming a MachXO2/3 from a .hex file
Some example hex and jedec files are provided in the examples folder for demonstration purposes.
- tiny256.hex/tiny256.jec are examples for the TinyFPGA AX1 that blinks the LED
- xo3starter.hex/xo3starter.jed are examples for the MachXO3LF Starter Kit that applies a counter to the LEDs controlled by the switches
This can currently program the configuration flash through I2C and has a variety of helper functions for erasing and status. To be done:
- Add support for EBR initialization
- Add support for UFM programming
- Add more documentation about feature row (before allowing a program function that could brick boards)
- Add equivalent library for SPI programming
This was based loosely on Adafruit_CircuitPython_AVRprog, but the code was all written from scratch