Projects Log

projects, diy

Search:

« PreviousNext »

Persistence Of Vision + Leds = Fun

21 July 2006

Today I saw an article about POV by Erik Zoltan (link IBM via hacked gadgets)

He's using a Parallax HomeWork Board (I don't know the price but i think it's quite expensive) thus I've decided to do the same thing with low cost equipement (16F84)

1) the electronical part

why do I use a 16F84:

  • i have some
  • it's cheap
  • you do not need a lot to make it work (1 crystal, 2 capacitors)
  • port pins have "Direct LED drive" capability
  • not that hard to program


  • The board:

    board
    as you can see, you do not need to have a lot of stuff on the board

    The pin diagram
    16f84 pin diagram

    The schematic diagram
    The schematic diagram
    R=120 ohm
    C=15pF
    X=4Mhz


    2) The assembly code part

    STATUS equ 03h ; Status Register
    TRISA equ 85h ; TrisA Register
    PORTA equ 05h ; A Port
    TRISB equ 86h ; TrisB Register
    PORTB equ 06h ; B Port
    COUNT1 equ 0Ch ; delay loop counter

    P equ 0Eh ; pointer
    C equ 0Fh ; display counter

    FSR equ 04h ; File Select Register
    INDF equ 00h ; Uses contents of FSR to address Data Memory


    bsf STATUS,5 ; ==> Bank 1
    movlw 00h ; B port
    movwf TRISB ; output
    bcf STATUS,5 ; ==> Bank 0



    movlw b'11000000'
    movwf 10h
    movlw b'01111111'
    movwf 11h
    movlw b'00010000'
    movwf 12h
    movlw b'00001000'
    movwf 13h
    movlw b'00010100'
    movwf 14h
    movlw b'00100010'
    movwf 15h
    movlw b'11000001'
    movwf 16h
    movlw b'00000000'
    movwf 17h
    movlw b'00000000'
    movwf 18h
    movlw b'00111100'
    movwf 19h
    movlw b'01001010'
    movwf 1ah
    movlw b'01001010'
    movwf 1bh
    movlw b'00101100'
    movwf 1ch
    movlw b'00000000'
    movwf 1dh
    movlw b'00000010'
    movwf 1eh
    movlw b'00011100'
    movwf 1fh
    movlw b'01100000'
    movwf 20h
    movlw b'00110000'
    movwf 21h
    movlw b'00001110'
    movwf 22h
    movlw b'00000000'
    movwf 23h
    movlw b'00000000'
    movwf 24h
    movlw b'01111101'
    movwf 25h
    movlw b'00000000'
    movwf 26h
    movlw b'01111110'
    movwf 27h
    movlw b'00000100'
    movwf 28h
    movlw b'00000100'
    movwf 29h
    movlw b'01111000'
    movwf 2ah
    movlw b'00000000'
    movwf 2bh
    movlw b'00000000'
    movwf 2ch
    movlw b'00000000'
    movwf 2dh
    movlw b'00000000'
    movwf 2eh
    movlw b'00000000'
    movwf 2fh
    movlw b'00000000'
    movwf 30h
    movlw b'01000000'
    movwf 31h
    movlw b'01000100'
    movwf 32h
    movlw b'01111100'
    movwf 33h
    movlw b'01000000'
    movwf 34h
    movlw b'01000000'
    movwf 35h
    movlw b'00000000'
    movwf 36h
    movlw b'00000000'
    movwf 37h
    movlw b'01000100'
    movwf 38h
    movlw b'01010100'
    movwf 39h
    movlw b'01010100'
    movwf 3ah
    movlw b'01101100'
    movwf 3bh
    movlw b'00000000'
    movwf 3ch
    movlw b'00000000'
    movwf 3dh
    movlw b'01000100'
    movwf 3eh
    movlw b'01010100'
    movwf 3fh
    movlw b'01010100'
    movwf 40h
    movlw b'01101100'
    movwf 41h
    movlw b'00000000'
    movwf 42h
    movlw b'00000000'
    movwf 43h
    movlw b'00000000'
    movwf 44h
    movlw b'01000100'
    movwf 45h
    movlw b'00100100'
    movwf 46h
    movlw b'00011100'
    movwf 47h
    movlw b'00000100'
    movwf 48h
    movlw b'00000000'
    movwf 49h
    movlw b'00000000'
    movwf 4ah
    movlw b'00000000'
    movwf 4bh



    Restart movlw 10h ; Load 0x10 in P (first led combination)
    movwf P
    movlw 3Ch ; load 0x3C in C (0x3C=60 led combination)
    movwf C

    Start movf P,0 ; W = P
    movwf FSR ; FSR = W
    movf INDF,0 ; W = INDF (INDF is the value pointed by FSR)
    movwf PORTB ; Display W on the led row
    incf P,1 ; P++
    call Delay ; wait a little bit
    decfsz C,1 ; c--;if(C!=0){goto start} else {goto restart}
    goto Start
    goto Restart



    Delay
    Loop1 decfsz COUNT1,1 ; goto loop1 while COUNT1!=0
    goto Loop1
    return



    end

    Download this code: pov.asm

    because i'm very lazy, i do not have typed all that byte sequence myself…
    i wrote a tiny perl script who analyses a small picture (8px * 60px) and generate the byte sequence for me

    picture:
    Kevin 1337

    source code:

    [The requested file http://dev.pulsed.net/wp/code/pov%20bsg.pl could not be found]


    3)And now the result:
    Poor quality (extracted from a video i took with my cellphone…) [i do not have a digital camera]

    POV pic 1

    this one is flipped (nice frame at return)
    POV pic 2

    POV pic 3

    POV pic 4

    1337 ^^
    POV pic 5

    POV pic 6



    the whole 1337 thing is just a joke

    Archived in DIY, Project, asm, pic | Trackback | del.icio.us | Top Of Page

    Comments are closed.