2014-03-06 23:42:17 +00:00
|
|
|
Borgware-2D
|
2013-09-25 14:58:21 +00:00
|
|
|
===========
|
|
|
|
|
2014-03-06 23:42:17 +00:00
|
|
|
Firmware for AVR based two-dimensional LED matrices, especially the
|
|
|
|
[Blinken Borgs](http://www.das-labor.org/wiki/Blinken_Borgs) from
|
|
|
|
[Das LABOR](http://das-labor.org/index.en.php).
|
|
|
|
Main platform is the [Borg16](http://www.das-labor.org/wiki/Borg16) construction
|
|
|
|
kit. Other supported platforms are the
|
|
|
|
[LED Brett](http://www.hackerspace-ffm.de/wiki/index.php?title=LedBrett)
|
2014-05-19 09:09:07 +00:00
|
|
|
projector from [Hackerspace FFM](http://www.hackerspace-ffm.de), the
|
|
|
|
[ELO Ping-Pong Board](http://www.elo-web.de/elo/mikrocontroller-und-programmierung/ping-pong/das-franzis-pingpong)
|
|
|
|
or the [LoL Shield](http://jimmieprodgers.com/kits/lolshield/) from Jimmie P.
|
|
|
|
Rodgers.
|
2014-03-06 23:42:17 +00:00
|
|
|
|
2014-03-06 23:59:05 +00:00
|
|
|
![Small Borg16](/doc/img/Borg16-small.jpg)
|
|
|
|
![Glow Lamp Borg](/doc/img/Glow_Lamp_Borg.jpg)
|
2013-09-25 14:58:21 +00:00
|
|
|
|
2014-03-06 23:42:17 +00:00
|
|
|
Animations
|
|
|
|
----------
|
2013-09-25 15:29:17 +00:00
|
|
|
|
2014-03-06 23:59:05 +00:00
|
|
|
![Matrix](/doc/img/anim-matrix.png)
|
|
|
|
![Fire](/doc/img/anim-feuer.png)
|
|
|
|
![Scrolling Text](/doc/img/anim-scroll.png)
|
2013-09-25 18:22:41 +00:00
|
|
|
|
2014-03-10 03:22:13 +00:00
|
|
|
[Animated GIF (3.5 MB)](/doc/img/borg_anim.gif)
|
|
|
|
|
2014-03-06 23:42:17 +00:00
|
|
|
Games
|
|
|
|
-----
|
2013-09-25 15:29:17 +00:00
|
|
|
|
2014-03-06 23:59:05 +00:00
|
|
|
![Snake](/doc/img/game-snake.png)
|
|
|
|
![Tetris](/doc/img/game-tetris.png)
|
2013-09-25 15:29:17 +00:00
|
|
|
|
2014-03-06 23:59:05 +00:00
|
|
|
* Tetris
|
2014-03-06 23:42:17 +00:00
|
|
|
* Classic: Standard Tetris Clone
|
|
|
|
* First Person Tetris: Rotate the bucket instead of the Tetromino.
|
|
|
|
* Bastet: Dices the worst the possible Tetromino the whole time.
|
2014-03-06 23:59:05 +00:00
|
|
|
* Snake
|
2014-03-07 21:43:21 +00:00
|
|
|
* Breakout
|
2014-03-06 23:59:05 +00:00
|
|
|
* Space Invaders
|
2013-09-25 15:29:17 +00:00
|
|
|
|
2014-03-06 23:42:17 +00:00
|
|
|
Build
|
|
|
|
=====
|
2013-09-25 14:58:21 +00:00
|
|
|
|
2014-05-28 14:39:08 +00:00
|
|
|
Supported build platforms are Linux, FreeBSD, NetBSD and Windows (via Cygwin).
|
|
|
|
Due to customized linker scripts, simulator support is currently limited to x86
|
|
|
|
and x86_64 archs. Following dependencies have to be met:
|
2013-09-25 14:58:21 +00:00
|
|
|
|
2014-05-28 14:39:08 +00:00
|
|
|
Linux / FreeBSD / NetBSD
|
|
|
|
------------------------
|
2013-09-25 14:58:21 +00:00
|
|
|
|
2014-03-07 21:43:21 +00:00
|
|
|
Package names are based on Debian/Ubuntu repositories. Please adapt the names
|
2014-05-28 14:39:08 +00:00
|
|
|
according to your Linux distribution (or BSD for that matter).
|
2013-09-25 14:58:21 +00:00
|
|
|
|
2014-03-06 23:42:17 +00:00
|
|
|
* build-essential (pulls in an ordinary gcc build tool chain for the host)
|
2014-03-25 10:37:05 +00:00
|
|
|
* bc
|
2014-05-28 22:19:02 +00:00
|
|
|
* make (gmake on BSD)
|
2014-03-06 23:42:17 +00:00
|
|
|
* libncurses5-dev
|
|
|
|
* gcc-avr
|
|
|
|
* avr-libc
|
|
|
|
* binutils-avr
|
|
|
|
* avrdude
|
|
|
|
* freeglut3-dev
|
2014-05-28 14:39:08 +00:00
|
|
|
* bash (note to the BSD folks: bash is required for the config tool)
|
2013-09-25 14:58:21 +00:00
|
|
|
|
2014-03-07 21:43:21 +00:00
|
|
|
Windows
|
|
|
|
-------
|
2014-03-25 10:37:05 +00:00
|
|
|
* AVR GCC toolchain for Windows, choose your poison:
|
|
|
|
* [WinAVR](http://winavr.sourceforge.net)
|
|
|
|
* already includes [avrdude](http://www.nongnu.org/avrdude/)
|
|
|
|
* installer offers to add the toolchain to the system path
|
|
|
|
* straight forward download from SourceForge
|
|
|
|
* project abandoned in 2010, therefore heavily outdated (avr-gcc 4.3.3)
|
|
|
|
* [Atmel AVR Toolchain for Windows](http://www.atmel.com/tools/atmelavrtoolchainforwindows.aspx)
|
|
|
|
* actively maintained, therefore fairly up to date
|
2014-03-25 10:50:08 +00:00
|
|
|
* homepage nags you with rather awkward registration process before download
|
2014-03-25 10:37:05 +00:00
|
|
|
* you have to add the toolchain to the system path manually
|
|
|
|
* avrdude is not included (but it is possible to install WinAVR in parallel)
|
2014-03-06 23:42:17 +00:00
|
|
|
* [Cygwin(64)](http://www.cygwin.com/)
|
2014-03-25 10:37:05 +00:00
|
|
|
* bc
|
2014-03-06 23:59:05 +00:00
|
|
|
* make
|
|
|
|
* gcc-core
|
2014-03-25 10:37:05 +00:00
|
|
|
* gdb (in case you want to debug your code in the simulator)
|
2014-03-06 23:59:05 +00:00
|
|
|
* libncurses-devel (Cygwin)
|
2014-03-07 00:16:19 +00:00
|
|
|
* libncursesw-devel (Cygwin64)
|
2014-03-25 10:37:05 +00:00
|
|
|
* [libusb-win32](http://sourceforge.net/apps/trac/libusb-win32/wiki) in case you
|
|
|
|
want to use an USBasp programmer device with avrdude
|
2014-03-06 23:42:17 +00:00
|
|
|
|
|
|
|
Configure
|
|
|
|
---------
|
|
|
|
|
2014-03-07 21:43:21 +00:00
|
|
|
Open a (Cygwin) terminal, change to your checkout directory and type:
|
2013-09-25 14:58:21 +00:00
|
|
|
> make menuconfig
|
|
|
|
|
2014-05-28 14:39:08 +00:00
|
|
|
In case you build on BSD, just use 'gmake' instead of 'make'. This starts an
|
|
|
|
Ncurses based text interface for configuring certain aspects of your target
|
|
|
|
platform. After a fresh checkout, the first thing you do is to load a profile
|
|
|
|
with sane defaults. In the menuconfig interface, select 'Load a Default
|
|
|
|
Configuration' and choose a preset. After hitting enter, the main menu returns
|
|
|
|
immediately. You can either tune your configuration or just exit (choose 'Yes'
|
|
|
|
at the confirmation dialog to save your stuff).
|
|
|
|
|
|
|
|
Be careful if you use an IDE like Eclipse to manage the build, as
|
|
|
|
integrated terminal emulators tend to choke on Ncurses generated output.
|
|
|
|
Make sure that 'make menuconfig' has been run at least once in an ordinary
|
|
|
|
terminal emulator after a fresh checkout or after issuing 'make mrproper'.
|
|
|
|
|
|
|
|
Note: Always use 'make clean' after changing something in the menu, because
|
|
|
|
subsequent builds may be broken if you don't.
|
2014-03-06 23:42:17 +00:00
|
|
|
|
|
|
|
Compile
|
|
|
|
-------
|
2013-09-25 14:58:21 +00:00
|
|
|
|
2014-03-06 23:42:17 +00:00
|
|
|
To build for the actual target platform, just type:
|
2013-09-25 14:58:21 +00:00
|
|
|
> make
|
|
|
|
|
2014-05-28 14:39:08 +00:00
|
|
|
This yields an 'image.hex' file which you can flash to your AVR device.
|
|
|
|
|
2014-03-07 00:16:19 +00:00
|
|
|
If you want to test and debug your code within a GUI application, you can use
|
2014-03-06 23:42:17 +00:00
|
|
|
the simulator:
|
|
|
|
> make simulator
|
2014-03-07 00:17:31 +00:00
|
|
|
|
2014-05-28 14:39:08 +00:00
|
|
|
Again, use 'gmake' instead of 'make' on BSD.
|
2014-03-07 21:43:21 +00:00
|
|
|
|
|
|
|
You can start the simulator by typing ./borgsim(.exe)
|
|
|
|
|
|
|
|
Simulator Handling
|
|
|
|
------------------
|
|
|
|
|
|
|
|
Please keep in mind that the simulator is NOT an emulator. All it does is
|
2014-03-25 10:37:05 +00:00
|
|
|
compile the source code to a native host application so you can step through
|
2014-05-28 14:39:08 +00:00
|
|
|
your C-Code with an ordinary host debugger. The GUI thread reads the simulated
|
|
|
|
frame buffer every 20ms (40ms on Windows) and draws its contents.
|
2014-03-07 21:43:21 +00:00
|
|
|
|
2014-05-29 02:33:17 +00:00
|
|
|
Joystick movements are simulated by the WASD keys and SPACE acts as the fire
|
2014-05-28 22:19:02 +00:00
|
|
|
button. The OpenGL based simulator (Linux/BSD) enables you to adjust the
|
2014-03-07 21:43:21 +00:00
|
|
|
viewing angle of the LED matrix via the arrow keys (not available on Windows).
|
2014-05-29 02:33:17 +00:00
|
|
|
|
|
|
|
LoL Shield on Arduino (and clones)
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
Although this project supports the LoL Shield on various Arduino boards, it does
|
|
|
|
not use the Arduino software stack at all. Instead, it follows the classical
|
|
|
|
Unix approach involving make files and mere command line tools. If you haven't
|
|
|
|
used anything besides the Arduino IDE, getting the Borgware to run (let alone
|
|
|
|
extending it) might be difficult at first. This README won't even try to cover
|
|
|
|
all workflows involved.
|
|
|
|
|
|
|
|
However, here are some hints:
|
|
|
|
|
|
|
|
* Find out what 'avrdude' command line parameters are used by the Arduino IDE to
|
|
|
|
flash your device (look into the upload log). Use that parameters (with the -U
|
|
|
|
option pointing to the Borgware 'image.hex' file) to flash your board.
|
|
|
|
* Pay attention to the size of your image. Borgware 2D can easily be configured
|
|
|
|
to exceed the usable flash memory of a 32 KiB device. After a successful
|
|
|
|
build, both flash and SRAM usage are displayed. Keep in mind that stock
|
|
|
|
Arduino MCUs already reserve 0.5 to 4KiB of flash memory for bootloaders.
|
|
|
|
* Same with SRAM. The "data size" should not exceed 2KiB (make that 1.5 KiB as
|
|
|
|
we still need some additional SRAM at runtime).
|
|
|
|
* In case avrdude gives you a verification error, chances are that your image
|
|
|
|
already reaches the bootloader area in the flash. Try to disable some
|
|
|
|
animations or games in Menuconfig to trim your image.
|
|
|
|
|
|
|
|
Digital joysticks are supported on the 'analog' pins, which are used in digital
|
|
|
|
input mode with internal pullups turned on. Just connect them to GND to signal
|
|
|
|
joystick movements.
|
|
|
|
|
|
|
|
| Arduino Pin | Meaning |
|
|
|
|
| ----------- | ------------- |
|
|
|
|
| A0 | Up |
|
|
|
|
| A1 | Down |
|
|
|
|
| A2 | Left |
|
|
|
|
| A3 | Right |
|
|
|
|
| A4 | Not Connected |
|
|
|
|
| A5 | Fire |
|