Saturday, May 23, 2009

Fun with LEDs

8x8 LED matrix

intro8x8 LED matrix

This instructable will show you how to make a 8x8 LED matrix in witch you can control evry single LED and create your own patterns as long as they only need 64 pixels to show them in one color.

Picture 002.jpg
loading...
500x375 : FHGB8A2FUVSGCW2 (0)
i
Picture 002.jpgPicture 003.jpg

step 1Materials

Materials you need:
-8x8LED matris (can make one but i bought mine)
-16x120Ohm resistors
-8xNPN transistors (I used C547B)
-1xPIC16f690
-prototype board (or you can make pcb for this)
-wire
-5V power supply (you can use a voltige regulator but I just power mine from a usb port)

Tools:
-PIC programmers (all the pic programmers from microchip exept for pickit1 will work)
-Software- MPLAB (free software from microchip)
-Soldering iron
-A vacum pump for removing solder is good to have
-wire cutters

Skills you need:
-soldering skill (being capable of making good solder connections within 5-10 sec.)
-Logic thinking to some level

If this is your first experiense using microcontrollers I recommend that you start with a mo

Picture 002.jpg
loading...
500x375 : FHGB8A2FUVSGCW2 (0)
i

step 2The cuircuit

This is the cuircuit schematic.

NOTE that you will need to look at the datasheet of your led matrix (if you bought one) or know how to connect the matrix you made

Picture 001.jpg
loading...
500x375 : FHN8FW6FV15T8GV (4)
i

step 3The code.

The code is written in assembly.

This code is based on the code from http://www.instructables.com/id/3x3x3-LED-Cube/ but you can not use the genorator that he supplys sense it only has 27 diodes and is has "layer1 layer2 layer3" insted of "line1...." and also has only got 3x8 bit numbers while have 8x8 bit numbers
NOTE the letters in this code may display in reverse sense I accidentally reversed the ground in my display.

loading...
1x1 : http://www.instructables.com/static/img/pixel.gif

step 4Editing patterns displayed.

You can add and remove patterns as you like in this matrix.
to add a pattern

Just change the ones and zeros acording to witch led should be lidt

to only light a led in the top corner the subroutine will be like this

;-----------------------------------------------------------------------------------------------;
; Test sub routine ;
;-----------------------------------------------------------------------------------------------;
Test:
movlw b'10000000'
movwf Line1
movlw b'00000000'
movwf Line2
movlw b'00000000'
movwf Line3
movlw b'00000000'
movwf Line4
movlw b'00000000'
movwf Line5
movlw b'00000000'
movwf Line6
movlw b'00000000'
movwf Line7
movlw b'00000000'
movwf Line8
movlw b'11111111'
movwf Layer4
call Output

return

to make a moving design you can few steps to the subroutine and it will be like this.

;-----------------------------------------------------------------------------------------------;
; Test sub routine ;
;-----------------------------------------------------------------------------------------------;
Test:
movlw b'01111100'
movwf Line1
movlw b'11000110'
movwf Line2
movlw b'00000011'
movwf Line3
movlw b'00000011'
movwf Line4
movlw b'00000011'
movwf Line5
movlw b'00000011'
movwf Line6
movlw b'11000110'
movwf Line7
movlw b'01111100'
movwf Line8
movlw b'11111111'
movwf Layer4
call Output

movlw b'01111100'
movwf Line1
movlw b'11000110'
movwf Line2
movlw b'00000011'
movwf Line3
movlw b'00000011'
movwf Line4
movlw b'00000011'
movwf Line5
movlw b'00000011'
movwf Line6
movlw b'11000110'
movwf Line7
movlw b'01111100'
movwf Line8
movlw b'11111111'
movwf Layer4
call Output

return

you will also have to add a function at the bottom of the asm file

The bottom few lines will be somthing like this.(the call function is to call the subroutines you can call them in any order you want to)
Loop:

call Someroutine
call Test
call Test

goto Loop

end


step 5The finished Product

Here are the results of the matrix... you can control evry single LED on this matrix through the code

Picture 002.jpg
loading...
500x375 : FHGB8A2FUVSGCW2 (0)
i
Picture 002.jpgPicture 003.jpgPicture 004.jpgPicture 005.jpg
blog comments powered by Disqus