Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.
/ Vector-Zoetrope Public archive

A vector animation player for a GD32VF103 microcontroller and an analog oscilloscope in XY mode.

License

Notifications You must be signed in to change notification settings

Mecrisp/Vector-Zoetrope

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

--------------------------------------------------------------------------------
  Vector Zoetrope
--------------------------------------------------------------------------------

Zoetropes are an old, but charming way to display animations, invented long
before film projection was invented. This project is a vector animation player
which fits in 512 bytes on a GD32VF103 RISC-V microcontroller, using two DAC
channels for vector graphics on an analog oscilloscope in XY mode connected to

   GND and the two DAC channels on pins
   PA4 (horizontal) and
   PA5 (vertical).

--------------------------------------------------------------------------------
  Design ideas:
--------------------------------------------------------------------------------

Animation data that consists of the elements

  moveto x y
  lineto x y
  end_of_frame
  end_of_animation

with x and y between 0 and 4095 for 12 bit DACs is displayed. Lines are rendered
with the well known Bresenham algorithm, and the pixels are feed into a ring
buffer that is processed by an interrupt handler for a constant pixel clock
of 2.25 MHz in order to keep uniform brightness regardless of the calculation
time necessary for an individual pixel.

If coordinate delta is within (-64..63, -64..63), lineto elements are encoded
in 16 bits of data, all other elements are encoded in 32 bits of data.

More sophisticated data representation for longer animations is coming soon!

--------------------------------------------------------------------------------
  How to run:
--------------------------------------------------------------------------------

If you have connected your

Longan Nano board to
             a USB-serial cable with 3.3V logic levels

3V3 or 5V -- VCC (measure the voltage present here)
R0        -- TXD
T0        -- RXD
GND       -- GND

you can flash it if you first

* Press and hold BOOT0 button
* Press and release Reset button
* Release BOOT0 button

and then execute

stm32loader -e -w -v -p /dev/ttyUSB0 vector-zoetrope.bin

on your host machine.

Press and release Reset button to start animation.

--------------------------------------------------------------------------------
  Credits:
--------------------------------------------------------------------------------

* Touhou "Bad Apple" video taken from Archive.org:

https://ia802905.us.archive.org/19/items/TouhouBadApple/Touhou%20-%20Bad%20Apple.mp4

* Vectorizer script by Bruno Levy:

https://github.com/BrunoLevy/Vectorizer

About

A vector animation player for a GD32VF103 microcontroller and an analog oscilloscope in XY mode.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published