Skip to content

8x8 WS2812 LED matrix driven by an Arduino Uno or ATtiny45 using AVR assembler code

License

Notifications You must be signed in to change notification settings

MuellerA/Led-8x8

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

8x8 64 LED Matrix WS2812

Date2016-04
Tool VersionArduino IDE 1.6.5 (Windows) (arduino.avrdude=6.0.1-arduino5, arduino.avr-gcc=4.8.1-arduino5)
KeywordsLED, WS2812, Arduino Uno, ATmega328, ATtiny45

Introduction

Led-4x8x8

Led-8x8

This program displays animations on one, two or four 8x8 LED WS2812 matrices. You can switch between the animations by pressing a button.

There are two versions, one for the Arduino Uno rev3 running at 16MHz and one for an ATtiny45 running at 20MHz.

License

MIT License

Hardware Configuration

ATmega328P
(Arduino Uno rev3)
ATtiny45
Clockexternal 16MHzexternal 20MHz
Voltage5V5V
Current< 2A

Configuring the Software

The layout of the LED matrices is defined in ledMatrix.h:

  • #define MATRIX_8x8
    One 8x8 LED matrix
  • #define MATRIX_2X8x8
    Two 8x8 LED matrices, giving 16x8 LEDs; left: LEDs 0 to 63, right: LEDs 64 to 127
  • #define MATRIX_2x2X8x8
    Four 8x8 LED matrices, giving 16x16 LEDs; top: LEDs 0 to 127, bottom: LEDs 128 to 255

If you use a different layout (e.g. 3x1) you have to add a new #define. In ledMatrix.h you have to add some constants for the new layout and in ledMatrix.cpp you have the add the conversion calculation from x/y coordinates to LED index and vice versa.

If you want to add an animation, you have to implement an initialization function and a run function. Then you have to add the function calls to the led-8x8.asm file. Please consider that the RAM of the ATtiny45 is too small for a memory mapped display and calculating the each pixel color must be done within 50us because of the WS2812 protocol. However you can use an ATtiny85 with more memory or an ATmega328P where memory is not an issue at all.

Compiling the Software

If you don't want to compile yourself, upload the included hex file (using one 8x8 matrix) with avrdude.

  • If you don't have a 'make' get and install it (http://gnuwin32.sourceforge.net/packages/make.htm)
  • Open command line box, change directory to the source folder of this project
  • Check the settings at the top of the 'Makefile'
  • ATmega328P: Run 'make MCU=atmega328p' to create the hex file
  • ATtiny45: Run 'make MCU=attiny45' to create the hex file

Setup and Upload

ATmega328

  • Run 'make MCU=atmega328p Upload' to upload the hex file
  • Connect Arduino's 5V, GND and Digital Pin 8 to the LED matrix' 5V, GND and DIN pins, connect Arduino's GND and Digital Pin 2 with a push button as shown in the image

ATtiny45

  • To upload the hex file to the ATtiny45 with an Arduino Uno board as programmer follow the instructions on http://highlowtech.org/?p=1695 'connecting an Arduino (as ISP) to an ATtiny'
  • Run 'make MCU=attiny45 Upload' to upload the hex file
  • Run 'make MCU=attiny45 Fuses' to make the ATtiny45 use an external clock source. Warning: After burning the Fuse you cannot use the ATtiny45 without an external clock (not even reprogram to clear the fuse)!
  • Setup the ATtiny45, 20MHz oscillator, two 22pF capacitors, 10uF capacitor, push button and the LED matrix as shown in the image

Links

About

8x8 WS2812 LED matrix driven by an Arduino Uno or ATtiny45 using AVR assembler code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published