
A standalone read-only SDHC SPI animation player. The ASIC uses one 25 MHz clock, initializes the card in SPI mode at 390.625 kHz, and reads raw sectors using CMD17. It extracts 16x12 one-bit frames prepared offline, using 24 bytes per image and a one-byte loop marker. Two 192-bit registers stage and display images; the displayed image is replaced only at a VGA frame boundary. The VGA output is 640x480 at approximately 59.52 Hz, with 40x nearest-neighbor scaling. Each animation frame is held for at least five VGA refreshes (~11.9 FPS). If a read fails or is delayed, the last complete image remains displayed.
The ASIC does not parse a filesystem or decode GIF files; conversion is performed on a computer before playback. No microcontroller is needed during playback.
Use a 25 MHz clock and reset the selected project after the SD card is powered. Set UI0 low for automatic playback; set UI0 high for a built-in white rectangle VGA diagnostic. Keep unused input pins at known logic levels. UIO5 indicates SD activity, UIO6 indicates a valid displayed image, and UIO7 indicates an SD error. A card initialization error requires a reset; transient read errors are retried.
Prepare a card using tools/gif_to_sd.py (requires Pillow). For example:
python tools/gif_to_sd.py --demo -o demo.img
python tools/gif_to_sd.py animation.gif -o animation.img
Write the resulting image to the whole SD card as raw sectors, not as a filesystem file. This is destructive to the existing card contents. Use a spare SDHC card and verify the target device before writing. The first animation sector is LBA 2048; the image contains the required zero-filled prefix. Use the same 512-byte sector layout for any replacement animation.
Sector bytes 0..23: row-major pixels, MSB first (two bytes per row). Byte 24: 0xA0 for continuation, 0xA1 for the final frame (loop to LBA 2048). Bytes 25..511: zero padding. Sector addresses above 65535 are not supported. SD data CRC bytes are consumed but not verified. Only SDHC block-addressed cards are targeted.
| # | Input | Output | Bidirectional |
|---|---|---|---|
| 0 | Diagnostic pattern enable | VGA R1 | SD CS_n |
| 1 | VGA G1 | SD MOSI | |
| 2 | VGA B1 | SD MISO | |
| 3 | VGA VSYNC_n | SD SCK | |
| 4 | VGA R0 | ||
| 5 | VGA G0 | SD busy | |
| 6 | VGA B0 | Image valid | |
| 7 | VGA HSYNC_n | SD error |