Hacklace/en: Unterschied zwischen den Versionen

Aus RaumZeitLabor Wiki
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
(22 dazwischenliegende Versionen von 7 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
{{AchtungKasten1 |title= Project no longer maintained |msg=
The project "Hacklace" is no longer maintained. This site is for reference only.}}
{{LanguageBox |msg=This page was translated from the German version. Click [[Hacklace|here]] to visit the original page.}}
{{LanguageBox |msg=This page was translated from the German version. Click [[Hacklace|here]] to visit the original page.}}
{{AchtungKasten1 |title=This page is not fully translated yet|msg=Please remove this message once the article is fully translated!
}}


{{ProjektInfoBox
{{ProjektInfoBox
Zeile 30: Zeile 30:
* Coin cell included
* Coin cell included
* Symmetric component layout
* Symmetric component layout
* Durch Ändern des Pin-Mappings an verschiedene Dot-Matrix-Typen anpaßbar
* Adjustable pin mapping to support dot-matrix display types
* Supports ASCII including german umlauts and additional symbols
* Supports ASCII including german umlauts and additional symbols
* Propotional font and predefined animations included
* Propotional font and predefined animations included
Zeile 43: Zeile 43:
Using the hacklace is very easy, because there is just one button which triggers the actions.
Using the hacklace is very easy, because there is just one button which triggers the actions.


By pressing this button short time, the hacklace switches to the next text/animation. By pressing the button for a longer time, the hacklace goes into a deep sleep mode which consumes nearly no power. By pressing the button again, one awakes the hacklace from deep sleep.
By pressing this button for a short period of time, the hacklace switches to the next text/animation. By pressing the button longer, the hacklace goes into a deep sleep mode which consumes nearly no power. By pressing the button again, the hacklace resumes from deep sleep.


==Prerequisites==
==Prerequisites==
Building the hacklace will help you learn to solder. If you already have soldering experience and the knowledge how to flash AVR mircocontrollers, it should be easy to build one. If you are not used to the tasks of soldering and flashing a microcontroller, we recommend to ask some RaumZeitLabor member to help you. This way you will gain the needed expertise!
Building the hacklace will help you learn how to solder. If you already have soldering experience and knowledge how to flash AVR mircocontrollers, it should be easy for you to build one. If you are not used to the tasks of soldering and flashing a microcontroller, we recommend to ask some RaumZeitLabor member to help you. This way you will gain the needed expertise!


==Tools needed==
==Tools needed==
Zeile 54: Zeile 54:
* ISP programmer for Atmel AVR-microcontroller
* ISP programmer for Atmel AVR-microcontroller
* A computer
* A computer
* Optional: equipment for etching circuit boards (when you do not want to use the professional produced circuit boards)
* Optional: equipment for etching circuit boards (when you do not want to use one of our pre-produced circuit boards)


Everything you ned is available at the RaumZeitLabor. Ask a friendly hackerspace member to introduce you to the equipment.
Everything you need is readily available at the RaumZeitLabor. Ask a friendly hackerspace member to introduce you to the equipment.


==Hardware==
==Hardware==


===Platine===
===Circuit Board===
[[Datei:Hacklace_Platine.jpg|thumb|right|220px|Platine, selbstgeätzt und rot lackiert]]
[[Datei:Hacklace_Platine.jpg|thumb|right|220px|Circuit board, etched manually and painted red]]
Die Platine wurde einseitig entworfen und das Layout so gestaltet, daß man die Platine leicht selber ätzen kann.  
The circuit board was designed to be easily etched. If you want to etch the circuit by yourself you will find the file [[Hacklace/en#Download|here]].
Eine Belichtungsvorlage findet sich unter [[Hacklace#Download|Download]].
 
After you etched the pcb you just need two drilling diameters. Use a 1.2mm (0.047") diameter for the LED-matrix pins and the tactile-switch pins. Apart from those drill holes, the remaining drill holes should have a diameter of 0.9mm (0.035"). The pads on the upper left and upper right side are not part of the circuit and can be drilled to the diameter of the cable which acts as the holder for the necklace.


Es werden nur zwei verschiedene Bohrdurchmesser verwendet. Die Pins für die Led-Matrix und die beiden Befestigungsanschlüsse des Tasters werden mit 1,2 mm gebohrt. Alle anderen Bohrungen mit 0,9 mm. An der oberen Kante sind rechts und links jeweils ein Pad, welches keinen elektrischen Anschluß hat und als Zugentlastung für das Kabel dient. Diese Pads werden auf den Außendurchmesser des Kabels aufgebohrt.
In case you do not have the equipment for etching circuit boards, you can buy a professionally manufactured circuit board [[Hacklace#Bezugsquellen|here]].


Für alle, die nicht so gerne selber ätzen, ist eine professionell gefertigte Platine im Rahmen eines [[Hacklace#Bezugsquellen|Bausatzes]] verfügbar.
===Assembly===


===Aufbau===
====Hint on the display====
Due to shortages in hardware supply, there are 3 different display types. Depending on the type, the display has to be inserted differently. This is also a configuration parameter in the firmware.


====Hinweis zum Display====
# HDSP-5403 hp 008 L3 - The black dot on the side of the display has to be arranged diagonally to PIN 1 (rectangular pad). Seen from top, that's the bottom right edge. Note: Since 01/2013 this display type is obsolete and will no longer be delivered with our kits.
Es gibt aufgrund der Hardwareverfügbarkeit 3 verschiedene Displaytypen in den Bausätzen.
# TC07 / TA07 - Pin 1 of the display (rectangular pad) is in the same row as pin 1 of the micro-controller (square pad). Depending on the display type (TA or TC) the corresponding firmware has to be flashed.
Das Display muss je nach Typ anders eingesetzt werden. Dies ist auch ein Konfigurationsparameter in der Firmware.
# LM57 - Same as TC07 display. Pin 1 of the display has been manually marked with a felt tip marker.


# HDSP-5403 hp 008 L3 - Der schwarze Punkt an der Seite des Displays muss diagonal zum PIN 1 (viereckiges Pad) liegen. Von oben betrachtet wäre das die rechte untere Ecke.
====Instructions====


====Anleitung====
Important: The top of the PCB is the side without traces and text! That's the side which is visible while waring. The traces and silkscreen are located on the back side. The back side is where you'll be soldering the components.


Zur Erläuterung: Die Platinenoberseite ist die Seite ohne Leiterbahnen bzw. ohne Aufdruck. Diese Seite ist die sichtbare Vorderseite. Auf der Rückseite befinden sich die Kupferbahnen und bei der professionellen Platine der weiße Bestückungsdruck. Dies ist die Lötseite.
[[Datei:Hacklace_Zusammenbau01.jpg|thumb|right|220px|SMD Resistors]]
[[Datei:Hacklace_Zusammenbau01.jpg|thumb|right|220px|SMD-Widerstände]]
[[Datei:Hacklace_Zusammenbau02.jpg|thumb|right|220px|Resistors and Capacitor]]
[[Datei:Hacklace_Zusammenbau02.jpg|thumb|right|220px|Widerstand und Kondensator]]
[[Datei:Hacklace_Zusammenbau03.jpg|thumb|right|220px|Aligning the IC Pins]]
[[Datei:Hacklace_Zusammenbau03.jpg|thumb|right|220px|Abrichten der Prozessorpins]]


Der Aufbau geschieht wie folgt:
The assembling is done as follows:
# Als erstes werden die beiden SMD-Widerstände (R2, R3) auf der Leiterbahnseite aufgelötet. Durch die große 1206-Bauform ist das nicht weiter schwierig. Zunächst ein Pad mit etwas Lötzinn belegen, dann das Bauteil mit der Pinzette an das Lötpad halten und mit dem Lötkolben festlöten. Wenn das Bauteil richtig sitzt, den zweiten Anschluß verlöten.
# Firstly, the two SMD resistors ('''R2''', '''R3''') are soldered to the conductor path side. Due to the large 1206 type, this is comparatively easy. At first, cover one pad with solder, then hold the resistor to the pad with a pair of tweezers. As soon as the part fits correctly, do the same with the other connector.
# Die Drähte des "normalen" Widerstands (R1) im richtigen Abstand abbiegen, Widerstand auf die Platinenoberseite stecken und auf der Lötseite festlöten. Anschließend die überstehenden Drahtenden mit einem Seitenschneider abknipsen.
# Bend the pins of the through-hole resistor '''R1''' in the correct width. You can use a bending tool. Insert the resistor into the holes. Fixate the resistor with a piece of tape. Turn the PCB around and solder the pins. Cut the remainder of the pins with a sidecutter.
# Mit dem Kondensator (C1) wird genauso verfahren.
# Repeat with the capacitor ('''C1''').
# Wer sich an den weißen Seiten des Displays stört, kann diese z. B. schwarz anmalen (Edding).
# If you don't like the white case of the display, paint it black using a permanent marker.
# Als Vorbereitung für den nächsten Schritt ist es sinnvoll, die Beinchen des Prozessors mit einem entsprechenden Werkzeug genau auf den Abstand der Bohrlöcher auszurichten (siehe Foto). Außerdem empfiehlt es sich, die Pins des Displays mit wenig Lötzinn leicht zu verzinnen.
# ICs usually don't come bent to the 2.54mm grid common in through-hole technology. You need to bend them to that grid first by either using a bending tool or by hand (see photo). Additionally, it is recommended to pre-tin the pins of the display a bit with solder.
# Jetzt kommt der etwas trickreiche Teil. Das Dot-Matrix-Display und der Prozessor müssen gleichzeitig eingelötet werden. Dazu wird das Display zunächst von der Oberseite her eingesetzt aber noch nicht verlötet. Das Display gehört in die breiten Pads mit den etwas größeren Löchern. Pad Nummer 1 ist an der quadratischen Form zu erkennen. Der zugehörige Pin des Displays ist durch eine kleine "1" oder einen Punkt markiert. Die überstehenden Pins auf der Lötseite müssen mit dem Seitenschneider so gekürzt werden, daß sie die Platine nur ca. 1 Millimeter überragen. Nun wird von der Lötseite her der Prozessor eingesetzt, so daß sich Display und Prozessor gegenüberliegen und die Pads mit den großen Löchern jeweils einen Pin vom Prozessor und einen Pin vom Display gemeinsam aufnehmen. Dies erfordert u. U. etwas Probieren, bis alle Beinchen ihren Platz gefunden haben. Auch hier ist darauf zu achten, daß Pin 1 des Prozessors in das quadratische Pad kommt.
# Now it's time for a tricky bit: The dot-matrix display and the IC need to be soldered in '''at the same time'''. Insert the display from the top and apply a bit of tape to hold it in place, but don't solder it in yet! The display is supposed to fit into the pads with the larger holes. You can recognize the first pad for the IC by it's squre shape (Pin 1). The first pin of the display is labeled with a small "1" or a dot. The pins of the display needs to be cut so that they'll stick out of the PCB by about 1mm. Insert the IC from the opposite side. This requires a bit of trial-and-error until all the pins fit.
# Anschließend werden Prozessor und Display gleichzeitig verlötet. Um eine gute Verbindung beider Bauteile zu erreichen, hilft die Verwendung eines Elektronik-Flußmittels. Da wir direkt am Pin löten, erwärmt sich das Bauteil recht schnell. Damit der Prozessor hierdurch keinen Schaden nimmt, sollte man nach jedem Pin eine Weile warten, bis er sich wieder abgekühlt hat.
# Solder the pins of the display and the IC. Apply a bit of solder flux to achieve better bonding. As we're soldering directly on the pins themselves you should wait a while after soldering one pin so that the parts don't overheat while soldering (this could break the uC)
# Jetzt können der Taster und die Stiftleisten von der Oberseite her eingesetzt und auf der Lötseite festgelötet werden.
# Insert the button and the pin header on the top and solder it from the bottom.
# Fehlen noch die Kabel für die Stromversorgung. Jeweils ein rotes (plus) und schwarzes (minus) Kabel wird an das jeweilige Lötpad angelötet. Zur Zugentlastung kann man jedes Kabel durch die zugehörige Bohrung in der oberen Ecke führen.
# Solder the two wires (red = positive, black = negative) to their corresponding pads. Then cut the wires to the desired length. To reduce mechanical stress you should guide both cables through their cable holes in the top of the PCB.
# Als letzter Schritt sind die Kabel an den Halter für die Knopfzelle zu löten. Dabei unbedingt auf die richtige Polung achten, da das Hacklace keinen Verpolungsschutz besitzt. Wer sich an den vorstehenden Pins des Knopfzellenhalters stört, kann diese rechtwinklig abbiegen, damit sie im Nacken nicht pieksen.
# Last Step! You need to solder the wires to the battery holder. You need to make sure that the polarity is correct, as the hacklace doesn't provide polarity protection. You may want to bend the pins of the battery holder so that you don't prick your neck.
{|  
{|  
| [[Datei:Hacklace_Zusammenbau05.jpg|thumb|right|220px|Löten von Prozessor und Display (vorher, nachher)]]
| [[Datei:Hacklace_Zusammenbau05.jpg|thumb|right|220px|Soldering of the IC and display (before, after)]]
| [[Datei:Hacklace_Zusammenbau07.jpg|thumb|right|300px|Mit Pfostenleisten und Taster]]
| [[Datei:Hacklace_Zusammenbau07.jpg|thumb|right|300px|Pin header and button]]
| [[Datei:Hacklace_Zusammenbau08.jpg|thumb|right|150px|Fertiges Hacklace mit Kabeln und Knopfzellenhalter]]
| [[Datei:Hacklace_Zusammenbau08.jpg|thumb|right|150px|Completed hacklace with wires and battery holder]]
|}
|}


===Flashen===
===Flash the firmware===
Zum Flashen der Software benötigt man einen AVR-Programmer (zum Beispiel den [[Usbasp|USBAsp]]), der an der ISP-Schnittstelle angeschlossen wird.
To flash the firmware you'll need an AVR programmer (the [[Usbasp|USBAsp]] is such a programmer). Connect your programmer to the ISP interface on the hacklace.  


Die Fuses des ATtiny4313 müssen so eingestellt werden, daß der Controller mit seinem internen RC-Oszillator auf 4 MHz läuft.
The fuses for the attiny4313 need to be adjusted so that the controller runs at 4 MHz from it's internal RC Oscillator. The fuses are: Low: 0xE2 High: 0xDF Extended: 0xFF
Die Fuses für den ATtiny4313 lauten: Low: 0xE2 High: 0xDF Extended: 0xFF


Fusebits mit avrdude setzen:
Set the fuse bits using avrdude:
  avrdude -v -c <PROGRAMMER> -p t4313 -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
  avrdude -v -c <PROGRAMMER> -p t4313 -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m


<PROGRAMMER> bitte durch den benutzten Programmer ersetzen, z.B.: usbasp
Replace <PROGRAMMER> with your used programmer, e.g. '''usbasp'''


Danach werden das Hex-File mit der Firmware ins Flash und die Default-Konfigurationsdaten ins EEPROM geschrieben.
Now program the firmware and the eeprom configuration data.


Flash und EEPROM mit avrdude programmieren:
Program flash and eeprom using avrdude:
  avrdude -c usbasp -p t4313 -u -U eeprom:w:Hacklace_Rev_B.eep
  avrdude -c usbasp -p t4313 -u -U eeprom:w:Hacklace_Rev_B.eep
  avrdude -c usbasp -p t4313 -u -U flash:w:Hacklace_Kingbright_TA.hex
  avrdude -c usbasp -p t4313 -u -U flash:w:Hacklace_Kingbright_TA.hex
Zeile 120: Zeile 120:
==Software==
==Software==


=== Firmware compilieren ===
=== Compiling the firmware ===
Die Firmware für den Mikrocontroller wurde mit dem AVR-Studio 6.0 von Atmel (AVR Toolchain Version: 3.4.0.663 - GCC  4.6.2) entwickelt. Dabei zeigte sich, daß das mit dieser Version ausgelieferte File "iotn4313.h" Fehler enthält. Eine korrigierte Version findet sich im GIT-Repository. Unter Windows liegt das fehlerhafte Headerfile unter
The firmware for the attiny4313 was developed using AVR-Studio 6.0 from Atmel (AVR Toolchain Version: 3.4.0.663 - GCC  4.6.2). The contained file "iotn4313.h" has an error. A corrected version of that file is available in the GIT-Repository. Place the corrected file under Windows to "C:\Programme\Atmel\Atmel Studio 6.0\extensions\Atmel\AVRGCC\3.4.0.65\AVRToolchain\avr\include\avr".
"C:\Programme\Atmel\Atmel Studio 6.0\extensions\Atmel\AVRGCC\3.4.0.65\AVRToolchain\avr\include\avr".
Bevor man das Hacklace-Projekt compilieren kann, muß man das fehlerhafte Headerfile "iotn4313.h" in "iotn4313_buggy.h" umbenennen und die korrekte Version aus dem Repository an seine Stelle kopieren.


Wer das AVR-Studio 6.0 nicht verwenden möchte, sollte den AVR-GCC-Compiler so einstellen, daß er die Codegröße optimiert (Option -Os). Außerdem muß das Symbol F_CPU=4000000 definiert werden (Option -D), damit er weiß, daß der Controller mit 4 MHz läuft.
If you're compiling manually using the avr-gcc toolchain, you should pass the compiler flags "-Os" (to optimize code size only) as well as "-DF_CPU=4000000" (to set the target CPU frequency to 4MHz).


===Displayspeicher===
===Display Memory===
[[Datei:Hacklace_Display_Schema.png|thumb|right|300px]]
[[Datei:Hacklace_Display_Schema.png|thumb|right|300px]]
Das Hacklace verwendet einen Displayspeicher von 200 Byte. Jedes Byte repräsentiert eine Spalte der Anzeige. Da der Zeichensatz proportional ist, haben die meisten Zeichen nur eine Breite von vier Spalten zuzüglich einer Spalte Abstand zum nächsten Zeichen. Animationen bestehen aus einzelnen Frames, wobei jeder Frame fünf Byte benötigt. Somit können Texte bis zu einer Länge von ca. 40 Zeichen dargestellt werden; eine Animation kann aus maximal 40 Frames bestehen.
The hacklace uses 200 bytes of display memory. Each byte represents one column of the display. The hacklace uses a proportional font by default. As such, most characters have a width of 4 columns plus one empty column for spacing. Animations are composited of single frames, where each frame requires 5 bytes. The maximum animation size is 40 frames, so also text messages are limited to about 40 characters.
 
===Configuration===
You can store custom texts and animations via a serial interface. You'll need a 3.3 or 5V serial cable. Connect it to CON2 (Pin 1: GND, Pin 2: TxD, Pin 3: RxD). Serial configuration: 2400 Baud, 8 data bits, no parity, 1 stop bit [8N1]).


===Konfiguration===
The text file configures your own texts or animations. You can edit it with any text editor. Make sure you're using an 8 bit ASCII encoding; UTF-8 is not supported. The maximum length of the configuration file is 256 bytes due to the microcontroller's eeprom memory.
Über ein serielles Interface kannst du deine eigenen Texte und Animationen auf das Hacklace übertragen. Hierzu benötigst du ein serielles 3,3 Volt-Interfacekabel (5 Volt geht auch), welches an CON2 angeschlossen wird (GND - Pin 1, TxD - Pin 2). Über das Kabel kannst du mit einem Terminalprogramm ein Textfile an das Hacklace senden (2400 Baud, 8 Datenbits, keine Parität, 1 Stoppbit).


Das Textfile zur Konfiguration enthält deine eigenen Texte und Animationen. Es läßt sich mit jedem beliebigen Texteditor erstellen, der in der Lage ist, ASCII-Texte zu erzeugen (kein Unicode!). Zum Speichern des Konfigurationsfiles stehen im internen EEPROM des Mikrocontrollers maximal 256 Byte zur Verfügung.
You need to send a specific init sequence to avoid programming by accident. Send the following sequence to your hacklace:


Um ein irrtümliches Beschreiben zu Verhindern, muß vor dem Download eine Initialisierungssequenz geschickt werden. Dazu wird das Hacklace durch Senden eines Escape-Zeichens (chr(27)) zunächst zurückgesetzt. Um die Programmierung freizuschalten, müssen danach die beiden Großbuchstaben 'H' und 'L' folgen. Nun kannst du das Textfile senden. Nach dem Download empfiehlt es sich, nochmals ein Escape-Zeichen zu senden, damit das Hacklace verriegelt und gegen zufälliges Beschreiben geschützt wird.
Escape-Character (ASCII Code 27, resets the hacklace)
Capital H, Capital L


===Format des Konfigurationsfiles===
Now you can transfer the configuraion file. It is recommended to reset the hacklace again after you've transferred the file. This enables write protection.
Eine Message ist entweder ein Text oder eine Animation. Die Messages können durch Tastendruck auf dem Hacklace weitergeschaltet werden. Jede Zeile des Konfigurationsfiles enthält genau eine Message. Eine Message beginnt immer mit einem Modus-Byte, danach folgt der Text bzw. die Daten der Animation. Ein Modus-Byte von 0 zeigt das Ende der Messageliste an.


Das Modus-Byte hat folgenden Aufbau:
===Configuration file format===
* Bit 7 gibt an, ob nur vorwärts (= 0) oder vor und zurück (= 1) gescrollt werden soll.
One messge is either one text or one animation. You can cycle though the messages by pushing the button. Each line of the configuration file contains exactly one message. A message always begins with a mode byte, followed by text or the data of the animation. A mode byte of 0 designates the end of the message list.
* Bit 6..4 legen die Dauer der Pause nach dem Erreichen des Endes der Message fest (größer = länger)
* Bit 3 gibt an, ob es sich um einen Text (= 0) oder eine Animation (= 1) handelt.
* Bit 2..0 bestimmen die Scroll- bzw. Animationsgeschwindigkeit (größer = schneller)
Es ist zu beachten, daß man nicht alle Bits auf Null setzen darf, da dies für die Markierung des Endes der Messageliste reserviert ist.


Texte können direkt als Klartext eingegeben werden. Es stehen alle druckbaren ASCII-Zeichen sowie die deutschen Umlaute und 'ß' zur Verfügung ([[Medium:Hacklace_Font_5x7_extended.bmp|Hacklace Zeichensatz]]).
The mode byte is defined as follows:
* Bit 7: forward (0) or backward (1) scrolling
* Bit 6..4: Duration of the pause after the end of the message
* Bit 3: Text (0) or Animation (1)
* Bit 2..0: Scroll speed


Um die Eingabe von Sonderzeichen, Animationen und Bytewerten zu erleichtern, gibt es folgende Escape-Sequenzen.
Don't set all bits to zero, as this designates the end of the message list.
* Ein vorangestelltes '^' erhöht den Characterwert um 63, so daß die Zeichenfolge '^A' das erste Sonderzeichen (chr(129)), '^B' das zweite Sonderzeichen usw. erzeugt.
* In ähnlicher Weise kann durch eine vorangestellte Tilde '~' eine im Flash gespeicherte Animation ausgewählt werden ('~A' erste Animation, '~B' zweite Animation usw.).
* Zur Eingabe von Hexadezimalwerten wird ein '$' vorangestellt. Danach folgen zwei Hex-Ziffern (0..9 bzw. A..F). Dabei müssen Großbuchstaben verwendet werden. Durch ein Leerzeichen oder ein Komma wird die Hex-Eingabe beendet.
Soll in einem Text eines der Escape-Zeichen ('^', '~' oder '$') verwendet werden, so muß man dieses verdoppeln. So erzeugt z. B. '$$' genau 1 Dollarzeicen.


Eigene Animationen können erzeugt werden, indem man durch Eingabe von '$FF,' das Zeichen chr(255) sendet, wodurch die Eingabe in den Direkt-Modus wechselt. Die folgenden Bytes werden nun direkt abgespeichert. Jedes Byte repräsentiert eine Displayspalte wobei Bit 0 das oberste und Bit 6 das unterste Pixel verkörpern. Bit 7 bleibt ungenutzt und sollte auf Null gesetzt werden. Verlassen kann man den Direkt-Modus ebenfalls durch Senden von chr(255).
You can enter texts as plain text. You can use any printable 7-bit ASCII characters as well as the german umlauts ([[Medium:Hacklace_Font_5x7_extended.bmp|Hacklace charset]]).


Hier nun ein Beispiel für ein Konfigurationsfile.
The hacklace firmware supports escape chars to make entering special chars, animations and byte values easier:
* Prefix with a '^' to increase the char value by 63. Example: '^A' represents the first special character (129), '^B' the second (130).
* Prefix with a '~' chooses an animation stored in flash. Example: '~A' chooses the first animation, '~B' the second one.
* Prefix with a '$' to enter hexidecimal values. Example: '$10' or '$A1'. You need to enter exactly two values. Only capital letters are allowed. Use space or colon to exit the hex mode.
* Use '^^', '~~' or '$$' to represent the literal value.
 
You can program own animations by entering the direct mode using '$FF'. Any bytes now entered will be directly stored into flash. Each byte represents a display column, where bit 0 is the first line and bit 6 the last line. bit 7 is not used and should be set to 0. Exit the direct mode by sending a character of value 255.
 
Configuration example:


<code>
<code>
  $45,Beispieltext
  $45,Sample text
  $40, Scrollen in Zeitlupe
  $40, Very slow scrolling
  $47, und extrem schnell
  $47, now very fast
  $74,moderat mit Pause
  $74,medium speed with pause
  $84,.bidirektional.
  $84,.bidirectional.
  $44,Umlaute äÄöÖüÜß
  $44,Umlauts äÄöÖüÜß
  $24,Ein Herz ^R
  $24,A heart ^R
  $3B,~F
  $3B,~F
  $0C,$FF $55 $2A $55 $2A $55 $2A $55 $2A $55 $2A $FF,
  $0C,$FF $55 $2A $55 $2A $55 $2A $55 $2A $55 $2A $FF,
Zeile 173: Zeile 177:
</code>
</code>


===Animationen erstellen===
===Creating animations===
Wer die vorgefertigten Animationen im Flash durch eigene ersetzen will, muß eine Header-Datei erstellen, die die entsprechenden Daten als Byte-Array enthält. In "animations.h" wird dann ein #include-Befehl eingefügt, der diese Datei einbindet. Außerdem muß die Animation in die Liste der Animationen (animation[]) eingetragen werden. Die Position in dieser Liste legt fest, über welchen Buchstaben die Animation referenziert wird. Z. B. wird mit '~A' die erste Animation in der Liste aufgerufen (siehe [[Hacklace#Format des Konfigurationsfiles|Konfigurationsfile]]).
'''You can use the hacklace animator tool to create own animations: [https://github.com/Hacklace/Animator/wiki/Download https://github.com/Hacklace/Animator/wiki/Download]'''


Als Hilfsmittel zum Erstellen einer Animation kann diese [[Medium:Hacklace_Animationtemplate.bmp|Vorlage]] verwendet werden. Dabei handelt es sich um ein Graustufenbild, das eine Folge von 40 Frames mit je 5 x 8 Pixeln enthält. Mit einem Malprogramm läßt sich die Animation einfach in die Kästchen zeichnen. Die unterste (achte) Zeile bleibt unbenutzt. Eingeschaltete Pixel müssen schwarz (Farbcode 0), ausgeschaltete Pixel müssen weiß (Farbcode 255) gemalt werden. Spalten die Grauwerte enthalten werden später ignoriert. Zuletzt wird das Bild auf die benutzten Frames zugeschnitten, die nicht genutzten Frames werden gelöscht. Eine solche Bitmap läßt sich anschließend mit dem Skript "[[Medium:make_data.m|make_data.m]]" automatisch in ein C-Headerfile konvertieren. Dabei ist der Name des Bildes ohne Extension anzugeben, z. B. make_data('my_animation'). Zum Ausführen des Skripts benötigt man FreeMat, einen freien Matlab-Klon.
You need to create your own header file if you wish to replace the animations. That header file contains your animation data as byte array. Include a #include command into "animations.h" which will include your own header file. You'll also need to append your animation to the list of animations (animation[]). The position inside that list defines which character is assigned to it. For example, '~A' is the first animation inside that list (see [[Hacklace/en#Configuration file format|Configuration File]]).
 
You can use the [[Medium:Hacklace_Animationtemplate.bmp|Hacklace Template]] to make it easier to create animations. It is a greyscale image with 40 frames with 5x8 pixels each. You can simply draw your frames using a bitmap paint program. The last line (8) is not used. To turn on a pixel, draw using color code 0, to turn it off draw using color code 255. Greyscale values are ignored. Crop the image to the number of used frames. Use the script "[[Medium:make_data.m|make_data.m]]" to convert your image to a C header file. Enter the file name without extension, e.g. make_data('my_animation'). You'll need FreeMat, a free Matlab clone.


==Download==
==Download==
{| class="wikitable"  valign = "top"
{| class="wikitable"  valign = "top"
!Datei
!File
!Format
!Format
!Lizenz
!License
|-
|-
|Schaltplan
|Schematic
|[[Medium:Hacklace_Schematic_Rev_B.pdf|.pdf]]
|[[Medium:Hacklace_Schematic_Rev_B.pdf|.pdf]]
|CC-BY-ND
|CC-BY-ND
|-
|-
|Bauteileliste
|Bill of Materials
|[[Medium:Hacklace_Bauteileliste.pdf|.pdf]]
|[[Medium:Hacklace_Bauteileliste.pdf|.pdf]]
|CC0
|CC0
|-
|-
|Belichtungsvorlage
|PCB etching template
|[[Medium:Hacklace_PCB_20x_Rev_B.pdf|.pdf]]
|[[Medium:Hacklace_PCB_20x_Rev_B.pdf|.pdf]]
|CC-BY-ND
|CC-BY-ND
|-
|-
|Bestückungsplan (Vorder- und Rückseite)
|Assembly Plan (front and back)
|[[Medium:Hacklace_Assembly_Front_Side_Rev_B.pdf|.pdf]], [[Medium:Hacklace_Assembly_Copper_Side_Rev_B.pdf|.pdf]]
|[[Medium:Hacklace_Assembly_Front_Side_Rev_B.pdf|.pdf]], [[Medium:Hacklace_Assembly_Copper_Side_Rev_B.pdf|.pdf]]
|CC-BY-ND
|CC-BY-ND
|-
|-
|Hex-File zum Flashen des Controllers (Display Kingbright TA07-11)
|Firmware (Display Kingbright TA07-11)
|[[Medium:Hacklace_Kingbright_TA.hex|.hex]]
|[[Medium:Hacklace_Kingbright_TA.hex|.hex]]
|CC-BY-NC-ND
|CC-BY-NC-ND
|-
|-
|Hex-File zum Flashen des Controllers (Display Kingbright TC07-11)
|Firmware (Display Kingbright TC07-11)
|[[Medium:Hacklace_Kingbright_TC.hex|.hex]]
|[[Medium:Hacklace_Kingbright_TC.hex|.hex]]
|CC-BY-NC-ND
|CC-BY-NC-ND
|-
|-
|Hex-File zum Flashen des Controllers (Display HDSP-5403)
|Firmware (Display HDSP-5403)
|[[Medium:Hacklace_HDSP5403.hex|.hex]]
|[[Medium:Hacklace_HDSP5403.hex|.hex]]
|CC-BY-NC-ND
|CC-BY-NC-ND
|-
|-
|Hex-File für das EEPROM
|EEPROM hex file
|[[Medium:Hacklace_Rev_B.eep|.eep]]
|[[Medium:Hacklace_Rev_B.eep|.eep]]
|CC-BY-NC-ND
|CC-BY-NC-ND
|-
|-
|Sourcecode (Github)
|Source code (Github)
|[https://github.com/fabster/Hacklace]
|[https://github.com/fabster/Hacklace]
|CC-BY-NC-SA
|CC-BY-NC-SA
|}
|}


Die aufgeführten Dateien stehen unter der jeweils angegebenen Creative-Commons-Lizenz.
All files are published under the respective Creative-Commons license.


==Bilder==
==Pictures==
{|  
{|  
| [[Datei:Hacklace_Halskette.jpg|thumb|left|300px|Ausführung als Halskette]]
| [[Datei:Hacklace_Halskette.jpg|thumb|left|300px|Hacklace worn as necklace]]
| [[Datei:Hacklace_Skull_red.jpg|thumb|left|250px|Ausführung als Gürtelclip]]
| [[Datei:Hacklace_Skull_red.jpg|thumb|left|250px|Hacklace worn as belt clip]]
|}
|}
Bei dem Gürtelclip wurde der Knopfzellenhalter mit einem Stück Platine und zwei Lötnägeln auf der Rückseite angebracht.
Wer das Hacklace in Aktion sehen möchte, findet ein cooles Video auf YouTube[http://www.youtube.com/watch?v=6ASvxaGiPwA].
==Bezugsquellen==
Die benötigten Bauteile können bei Reichelt bzw. CSD-Electronics bestellt werden. Ein Auflistung mit Bestellnummer findet sich [[Medium:Hacklace_Bauteileliste.pdf|hier]].


=== Bausatz ===
The belt clip was made by attaching the battery holder to a PCB and connected using soldering lugs.
Als bequeme Alternative bieten wir einen Bausatz mit allen Teilen und einer professionell gefertigten Platine an. Der Bausatz kostet 10,- Euro und kann bei [[Benutzer:Fabster|Fabster]] oder [[Benutzer:muzy|muzy]] erworben werden. Die Bezahlung erfolgt '''nicht''' über die Raumkasse. Gerne helfen wir oder andere erfahrene Laboranten beim löten, zusammenbauen, flashen und programmieren.


You can see the hacklace on a video on YouTube [http://www.youtube.com/watch?v=6ASvxaGiPwA].


{{ProgressBar|33
==Ordering Information==
| text = Verfügbare Bausätze mit Versandmöglichkeit ab dem 28.11.12 (Stand 27.11.12 16:15Uhr)
In Germany, you can order all needed parts from Reichelt or CSD-Electronics. A list of parts can be found [[Medium:Hacklace_Bauteileliste.pdf|here]].
| total = 60
| center = false
| height = 5
}}


=== Kit ===
You can purchase a kit for 10€ at RaumZeitLabor - please contact [[Benutzer:muzy|muzy]].


{|  
{|  
| [[Datei:Hacklace_Einzelteile.jpg|thumb|right|260px|Einzelteile]]
| [[Datei:Hacklace_Einzelteile.jpg|thumb|right|260px|Parts]]
| [[Datei:Hacklace_Platine_schwarz.jpg|thumb|right|120px|Professionell gefertigte Platine]]
| [[Datei:Hacklace_Platine_schwarz.jpg|thumb|right|120px|PCB]]
| [[Datei:Hacklace_schwarz.jpg|thumb|right|240px|Fertig aufgebautes Hacklace]]
| [[Datei:Hacklace_schwarz.jpg|thumb|right|240px|Completed Hacklace]]
|-
|-
|}
|}
=== Kosten ===
Die Progressbar zeigt die aktuelle Refinanzierung des Projektes an. Sobald die volle Summe erreicht ist, sind die restlichen Einnahmen Spende an das RaumZeitLabor.
{{ProgressBar|200
| text = Aktueller Refinanzierungsstatus
| total = 490
| center = false
| height = 5
}}
== Fragen, Ideen etc. ==
Diese Wikiseite dient dazu, die Fakten zum Hacklace zu präsentieren. Hier findest du Informationen über alles, was bereits realisiert worden ist. Für Dinge, die noch offen sind oder in der Zukunt liegen, wie z. B. Fragen, Ideen, Kommentare, Vorschläge, Wünsche steht dir die [[Diskussion:Hacklace|Diskussionsseite]] zur Verfügung. Dort kann alles eingetragen und besprochen werden, was noch nicht umgesetzt wurde.


==Credits==
==Credits==
Hacklace wurde inspiriert durch das Projekt "TinyMatrix" von TigerUp [https://sites.google.com/site/tinymatrix/]. Da wir jedoch unsere eigenen Vorstellungen umsetzen wollten, ist Hacklace bezüglich Hard- und Software eine komplette Neuentwicklung.
Hacklace was inspired by the "TinyMatrix" project from TigerUp [https://sites.google.com/site/tinymatrix/].  




[[Kategorie:Projekt]]
[[Kategorie:Projekt]]
[[Category:Raum-Kommerz-Labor]]
[[Category:Shop]]

Version vom 25. Februar 2014, 17:19 Uhr

Achtung Achtung: Project no longer maintained Achtung
The project "Hacklace" is no longer maintained. This site is for reference only.
English This page was translated from the German version. Click here to visit the original page.
         
Hacklace

Release status: stable [box doku]

Beschreibung A necklace with a 5x7 dotmatrix display
Autor(en)  fabster, muzy
Letzte Version  Revision B
Lizenz  Creative Commons
Download  Download

Hacklace - A Necklace for Hackers

  • You're searching for an accessory suitable for nerds, geeks and hackers? Try a hacklace!
  • You're searching for an individual gift? Try a hacklace!
  • You want to be the highlight on any party? A hacklace is your gadget with which you can gain attention!

A hacklace is 5x7 dotmatrix display which is attached to a necklace. You can create your own animations and messages which one can display on the dotmatrix display. You are only limited by your own imagination.


Features

  • Only 48mm x 15mm (1.89" x 0.59") in size.
  • Coin cell included
  • Symmetric component layout
  • Adjustable pin mapping to support dot-matrix display types
  • Supports ASCII including german umlauts and additional symbols
  • Propotional font and predefined animations included
  • Serial port (3,3 or 5V) to upload your own messages and animations which are then stored in the EEPROM.
  • Animations and messages can be created easily using a text-editor of your choice.
  • Ready to use. Your hacklace microcontroller comes with the latest firmware.
  • Speed, delay and modus can be set individually.
  • ISP-connector for flashing custom firmware.


Usage

Using the hacklace is very easy, because there is just one button which triggers the actions.

By pressing this button for a short period of time, the hacklace switches to the next text/animation. By pressing the button longer, the hacklace goes into a deep sleep mode which consumes nearly no power. By pressing the button again, the hacklace resumes from deep sleep.

Prerequisites

Building the hacklace will help you learn how to solder. If you already have soldering experience and knowledge how to flash AVR mircocontrollers, it should be easy for you to build one. If you are not used to the tasks of soldering and flashing a microcontroller, we recommend to ask some RaumZeitLabor member to help you. This way you will gain the needed expertise!

Tools needed

To build a hacklace you'll need the following tools:

  • Soldering equipment (Soldering iron, solder, tweezers, ...)
  • ISP programmer for Atmel AVR-microcontroller
  • A computer
  • Optional: equipment for etching circuit boards (when you do not want to use one of our pre-produced circuit boards)

Everything you need is readily available at the RaumZeitLabor. Ask a friendly hackerspace member to introduce you to the equipment.

Hardware

Circuit Board

Circuit board, etched manually and painted red

The circuit board was designed to be easily etched. If you want to etch the circuit by yourself you will find the file here.

After you etched the pcb you just need two drilling diameters. Use a 1.2mm (0.047") diameter for the LED-matrix pins and the tactile-switch pins. Apart from those drill holes, the remaining drill holes should have a diameter of 0.9mm (0.035"). The pads on the upper left and upper right side are not part of the circuit and can be drilled to the diameter of the cable which acts as the holder for the necklace.

In case you do not have the equipment for etching circuit boards, you can buy a professionally manufactured circuit board here.

Assembly

Hint on the display

Due to shortages in hardware supply, there are 3 different display types. Depending on the type, the display has to be inserted differently. This is also a configuration parameter in the firmware.

  1. HDSP-5403 hp 008 L3 - The black dot on the side of the display has to be arranged diagonally to PIN 1 (rectangular pad). Seen from top, that's the bottom right edge. Note: Since 01/2013 this display type is obsolete and will no longer be delivered with our kits.
  2. TC07 / TA07 - Pin 1 of the display (rectangular pad) is in the same row as pin 1 of the micro-controller (square pad). Depending on the display type (TA or TC) the corresponding firmware has to be flashed.
  3. LM57 - Same as TC07 display. Pin 1 of the display has been manually marked with a felt tip marker.

Instructions

Important: The top of the PCB is the side without traces and text! That's the side which is visible while waring. The traces and silkscreen are located on the back side. The back side is where you'll be soldering the components.

SMD Resistors
Resistors and Capacitor
Aligning the IC Pins

The assembling is done as follows:

  1. Firstly, the two SMD resistors (R2, R3) are soldered to the conductor path side. Due to the large 1206 type, this is comparatively easy. At first, cover one pad with solder, then hold the resistor to the pad with a pair of tweezers. As soon as the part fits correctly, do the same with the other connector.
  2. Bend the pins of the through-hole resistor R1 in the correct width. You can use a bending tool. Insert the resistor into the holes. Fixate the resistor with a piece of tape. Turn the PCB around and solder the pins. Cut the remainder of the pins with a sidecutter.
  3. Repeat with the capacitor (C1).
  4. If you don't like the white case of the display, paint it black using a permanent marker.
  5. ICs usually don't come bent to the 2.54mm grid common in through-hole technology. You need to bend them to that grid first by either using a bending tool or by hand (see photo). Additionally, it is recommended to pre-tin the pins of the display a bit with solder.
  6. Now it's time for a tricky bit: The dot-matrix display and the IC need to be soldered in at the same time. Insert the display from the top and apply a bit of tape to hold it in place, but don't solder it in yet! The display is supposed to fit into the pads with the larger holes. You can recognize the first pad for the IC by it's squre shape (Pin 1). The first pin of the display is labeled with a small "1" or a dot. The pins of the display needs to be cut so that they'll stick out of the PCB by about 1mm. Insert the IC from the opposite side. This requires a bit of trial-and-error until all the pins fit.
  7. Solder the pins of the display and the IC. Apply a bit of solder flux to achieve better bonding. As we're soldering directly on the pins themselves you should wait a while after soldering one pin so that the parts don't overheat while soldering (this could break the uC)
  8. Insert the button and the pin header on the top and solder it from the bottom.
  9. Solder the two wires (red = positive, black = negative) to their corresponding pads. Then cut the wires to the desired length. To reduce mechanical stress you should guide both cables through their cable holes in the top of the PCB.
  10. Last Step! You need to solder the wires to the battery holder. You need to make sure that the polarity is correct, as the hacklace doesn't provide polarity protection. You may want to bend the pins of the battery holder so that you don't prick your neck.
Soldering of the IC and display (before, after)
Pin header and button
Completed hacklace with wires and battery holder

Flash the firmware

To flash the firmware you'll need an AVR programmer (the USBAsp is such a programmer). Connect your programmer to the ISP interface on the hacklace.

The fuses for the attiny4313 need to be adjusted so that the controller runs at 4 MHz from it's internal RC Oscillator. The fuses are: Low: 0xE2 High: 0xDF Extended: 0xFF

Set the fuse bits using avrdude:

avrdude -v -c <PROGRAMMER> -p t4313 -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m

Replace <PROGRAMMER> with your used programmer, e.g. usbasp

Now program the firmware and the eeprom configuration data.

Program flash and eeprom using avrdude:

avrdude -c usbasp -p t4313 -u -U eeprom:w:Hacklace_Rev_B.eep
avrdude -c usbasp -p t4313 -u -U flash:w:Hacklace_Kingbright_TA.hex

Software

Compiling the firmware

The firmware for the attiny4313 was developed using AVR-Studio 6.0 from Atmel (AVR Toolchain Version: 3.4.0.663 - GCC 4.6.2). The contained file "iotn4313.h" has an error. A corrected version of that file is available in the GIT-Repository. Place the corrected file under Windows to "C:\Programme\Atmel\Atmel Studio 6.0\extensions\Atmel\AVRGCC\3.4.0.65\AVRToolchain\avr\include\avr".

If you're compiling manually using the avr-gcc toolchain, you should pass the compiler flags "-Os" (to optimize code size only) as well as "-DF_CPU=4000000" (to set the target CPU frequency to 4MHz).

Display Memory

The hacklace uses 200 bytes of display memory. Each byte represents one column of the display. The hacklace uses a proportional font by default. As such, most characters have a width of 4 columns plus one empty column for spacing. Animations are composited of single frames, where each frame requires 5 bytes. The maximum animation size is 40 frames, so also text messages are limited to about 40 characters.

Configuration

You can store custom texts and animations via a serial interface. You'll need a 3.3 or 5V serial cable. Connect it to CON2 (Pin 1: GND, Pin 2: TxD, Pin 3: RxD). Serial configuration: 2400 Baud, 8 data bits, no parity, 1 stop bit [8N1]).

The text file configures your own texts or animations. You can edit it with any text editor. Make sure you're using an 8 bit ASCII encoding; UTF-8 is not supported. The maximum length of the configuration file is 256 bytes due to the microcontroller's eeprom memory.

You need to send a specific init sequence to avoid programming by accident. Send the following sequence to your hacklace:

Escape-Character (ASCII Code 27, resets the hacklace)
Capital H, Capital L

Now you can transfer the configuraion file. It is recommended to reset the hacklace again after you've transferred the file. This enables write protection.

Configuration file format

One messge is either one text or one animation. You can cycle though the messages by pushing the button. Each line of the configuration file contains exactly one message. A message always begins with a mode byte, followed by text or the data of the animation. A mode byte of 0 designates the end of the message list.

The mode byte is defined as follows:

  • Bit 7: forward (0) or backward (1) scrolling
  • Bit 6..4: Duration of the pause after the end of the message
  • Bit 3: Text (0) or Animation (1)
  • Bit 2..0: Scroll speed

Don't set all bits to zero, as this designates the end of the message list.

You can enter texts as plain text. You can use any printable 7-bit ASCII characters as well as the german umlauts (Hacklace charset).

The hacklace firmware supports escape chars to make entering special chars, animations and byte values easier:

  • Prefix with a '^' to increase the char value by 63. Example: '^A' represents the first special character (129), '^B' the second (130).
  • Prefix with a '~' chooses an animation stored in flash. Example: '~A' chooses the first animation, '~B' the second one.
  • Prefix with a '$' to enter hexidecimal values. Example: '$10' or '$A1'. You need to enter exactly two values. Only capital letters are allowed. Use space or colon to exit the hex mode.
  • Use '^^', '~~' or '$$' to represent the literal value.

You can program own animations by entering the direct mode using '$FF'. Any bytes now entered will be directly stored into flash. Each byte represents a display column, where bit 0 is the first line and bit 6 the last line. bit 7 is not used and should be set to 0. Exit the direct mode by sending a character of value 255.

Configuration example:

$45,Sample text
$40, Very slow scrolling
$47, now very fast
$74,medium speed with pause
$84,.bidirectional.
$44,Umlauts äÄöÖüÜß
$24,A heart ^R
$3B,~F
$0C,$FF $55 $2A $55 $2A $55 $2A $55 $2A $55 $2A $FF,
$00,

Creating animations

You can use the hacklace animator tool to create own animations: https://github.com/Hacklace/Animator/wiki/Download

You need to create your own header file if you wish to replace the animations. That header file contains your animation data as byte array. Include a #include command into "animations.h" which will include your own header file. You'll also need to append your animation to the list of animations (animation[]). The position inside that list defines which character is assigned to it. For example, '~A' is the first animation inside that list (see Configuration File).

You can use the Hacklace Template to make it easier to create animations. It is a greyscale image with 40 frames with 5x8 pixels each. You can simply draw your frames using a bitmap paint program. The last line (8) is not used. To turn on a pixel, draw using color code 0, to turn it off draw using color code 255. Greyscale values are ignored. Crop the image to the number of used frames. Use the script "make_data.m" to convert your image to a C header file. Enter the file name without extension, e.g. make_data('my_animation'). You'll need FreeMat, a free Matlab clone.

Download

File Format License
Schematic .pdf CC-BY-ND
Bill of Materials .pdf CC0
PCB etching template .pdf CC-BY-ND
Assembly Plan (front and back) .pdf, .pdf CC-BY-ND
Firmware (Display Kingbright TA07-11) .hex CC-BY-NC-ND
Firmware (Display Kingbright TC07-11) .hex CC-BY-NC-ND
Firmware (Display HDSP-5403) .hex CC-BY-NC-ND
EEPROM hex file .eep CC-BY-NC-ND
Source code (Github) [1] CC-BY-NC-SA

All files are published under the respective Creative-Commons license.

Pictures

Hacklace worn as necklace
Hacklace worn as belt clip

The belt clip was made by attaching the battery holder to a PCB and connected using soldering lugs.

You can see the hacklace on a video on YouTube [2].

Ordering Information

In Germany, you can order all needed parts from Reichelt or CSD-Electronics. A list of parts can be found here.

Kit

You can purchase a kit for 10€ at RaumZeitLabor - please contact muzy.

Parts
PCB
Completed Hacklace

Credits

Hacklace was inspired by the "TinyMatrix" project from TigerUp [3].