======== Etherled ======== .. toctree:: :hidden: photos Introduction ============ Etherled is remote controlled, programable stroboscopic image projector using an 8051-family microcontroller. The image is projected based in the eye delay to recognize the light. It *draws* a *virtual* led matrix using a single led column, which shows each column of the matrix at the time with a relative high frequency, fast enough to make it look like a blinking column of leds when it's still. When the viewer moves his sight away from the leds column, the image is suddenly projected. It has a simple image editor that can send and receive images (pixel matrix) from the device using a compact binary protocol (called ELP, Etherled Protocol) over a small and simplified ethernet/IP/UDP stack. There are some :doc:`photos` available. There is more detailed documentation in the `doc repository directory`__, but it's all in spanish (unfortunately if you don't speak the language). __ https://git.llucax.com/w/z.facultad/66.09/etherled.git/tree/HEAD:/doc Hardware ======== The main hardware components are an AT89S8252__ microcontroller, a column of 8 leds , a latch and an ISA NE2000__ compatible ethernet adapter. __ http://www.atmel.com/dyn/products/Product_card.asp?part_id=1920 __ http://en.wikipedia.org/wiki/NE2000 Firmware ======== The firmware is divided in 2 modules: networking and led projection. The networking module runs in the *main thread*, while the led projection is interrupt-driven (using a timer to trigger the interruption). Led Projection -------------- The led projection is simple: when the timer expires, the next column is *printed* using the leds. The *next column* is calculated using modulo number of columns so when the matrix it's fully printed, it starts again from the beginning. This module is written in assembly. Networking ---------- This module is more complex and it runs as the *main thread* of the firmware, in an infinite loop that polls the network adapter to see if a new frame arrived (we had problems using interrupts for this too, which is the ideal). When a new frame arrives, it's parsed to see if it's an ARP or IP packet. If it's ARP, it's answered with the device IP. If it's IP, it's parsed to see if it's UDP. If it is, it's parsed again to see if it's a valid ELP packet, and if it is, the *get* or *set* action is performed. If any of the parsing fails or other type of packet is detected, it's dropped silently. A simple locking mechanism was used to prevent the matrix to advance to the next column when the column is being set (to avoid the projection of an inconsistent image). The lock was simple, stop the timer while writing the new matrix into memory. This module is written in C. NE2000 driver ~~~~~~~~~~~~~ The NE2000 driver was based on uIP__ + `8051 integration project`__, but that driver had a lot of bugs and was very poor so the driver was almost rewritten to fix the bugs, make it modular, splitting the send, receive and buffer management into different modules, and using the adapter buffers as external memory to minimize the lack of RAM memory in the microcontroller. This improvements were possible thanks to `similar project using a PIC`__ instead of a microcontroller and the Linux__ DP8390 driver. __ http://www.sics.se/~adam/uip/index.php/Main_Page __ http://members.iinet.net.au/~vanluynm/#Downloads __ http://elserver.forknet-ar.org/harpo/uch/seminario/ __ http://www.kernel.org/ Software ======== There is a client application to create and edit images (as a led matrix) and to store them in the device via network. Both CLI and GUI are provided. The CLI can be used to set some other device parameters (like the refresh frequency) or send commands to it (like turn of the leds). This module is written in Python__ using PyGTK__ and SimpleGladeApp__. __ http://www.python.org/ __ http://www.pygtk.org/ __ http://kefir.sourceforge.net/tepache/SimpleGladeApp.html Download ======== There are no releases for this project, but you can get the code from the Git_ repository__ (or a snapshot). __ https://git.llucax.com/w/facultad/66.09/etherled.git .. _git: http://git.or.cz/ .. vim: set et sw=3 sts=3 tw=78 :