PIC 18F4520 Interfacing with LED Dot Matrix for Running Message Display

Discussion in 'Embedded Systems and Microcontrollers' started by josephting, Aug 19, 2012.

  1. josephting

    josephting Thread Starter New Member

    Joined:
    Aug 19, 2012
    Messages:
    3
    Hi,

    I am currently doing a project. I am using PIC 18F4520 to design and develop an 8x4 LED display panel with a finger-sensitive IR sensor. The requirement is to make the alphabet as running message in the LED display. For the example, alphabet "A" is moved from right to left constantly in the LED. There are 3 speed required, when approaching closer to the IR sensor, slow, medium and fast movement of the running message display.

    I am currently facing the problem of assembly code writing. I don't have the idea how to make the running message keep moving. Help please.
  2. geoffers

    geoffers Member

    Joined:
    Oct 25, 2010
    Messages:
    195
    Location:
    UK Devon
    Hi
    Before I start I'm not expert! Looks like you have pleanty of I/O so you can use a output for every LED, I would think you could draw the alphabet out, use a 8bit port for each collum, and all though it will take a while to write, do a subroutine for each letter which would write to each port and the shift it to the next port and your letter will move! You have pleanty of programme memory to do that.
  3. absf

    absf Well-Known Member

    Joined:
    Dec 29, 2010
    Messages:
    1,007
    Location:
    Sarawak (GMT+8)
  4. josephting

    josephting Thread Starter New Member

    Joined:
    Aug 19, 2012
    Messages:
    3
    Thanks. Can u help me convert this to assembly language ?

    Code:
    TRISA = %00000000
    TRISB = %00000000
    TRISC = %00000000
        column        var    byte
        dchange        var    byte
        scan         var     byte
        scroll        var    byte
        ldata         VAR byte[35]
    START:
        CLEAR
        'ldata [0 - 7 ] = %00000000 All Blank so that the first letter (D) scrolls onto the display
        ldata [8] = %01111111    'start of 'D'
        ldata [9] = %01000001 
        ldata [10] = %01000001
        ldata [11] = %01000001
        ldata [12] = %00111110
        ldata [13] = %00000000 
        ldata [14] = %01100001    'start of 'J'
        ldata [15] = %01000001
        ldata [16] = %01111111
        ldata [17] = %00000001 
        ldata [18] = %00000001
        ldata [19] = %00000000
        ldata [20] = %01111111    'start of 'W'
        ldata [21] = %01000000
        ldata [22] = %01111000 
        ldata [23] = %01000000
        ldata [24] = %01111111
        ldata [25] = %00000000
        ldata [26] = %01111110    'start of 'smiley face symbol'
        ldata [27] = %10000001
        ldata [28] = %10010101
        ldata [29] = %10100001 
        ldata [30] = %10100001
        ldata [31] = %10010101
        ldata [32] = %10000001
        ldata [33] = %01111110
        ldata [34] = %00000000    'Last line of data is blank to clear display as it scrolls
    LOOP:
        FOR scroll = 0 TO 34        
            FOR scan = 0 TO 50    '<< This will adjust scrolling speed
                PORTC = 1
                FOR column = 0 TO 7
                    PORTB = ldata [column]
                    PAUSE 1
                    PORTC = PORTC * 2
                NEXT
            NEXT 
            FOR dchange = 0 TO 33
                ldata [dchange] = ldata [dchange+1]    ' *** SHIFTS DATA IN ldata ARRAY DOWN.***
            NEXT 
        NEXT
        GOTO START
    END
    
    Last edited by a moderator: Aug 20, 2012
  5. kubeek

    kubeek AAC Fanatic!

    Joined:
    Sep 20, 2005
    Messages:
    3,624
    Location:
    Prague, Czech Rep
    I guess you will need to start reading some documentation about the compiler you use, find some examples and then come back with questions.
    absf likes this.
Similar Threads
Forum Title Date
Embedded Systems and Microcontrollers sd card interfacing with pic18f4520 Jan 13, 2014
Embedded Systems and Microcontrollers Interfacing LED's with 18F4520 Nov 23, 2012
Embedded Systems and Microcontrollers regarding interfacing sd card with pic 18f4520 Nov 8, 2010
Embedded Systems and Microcontrollers PIC18F4520 with I2C Mode (PICDEM2 Plus Board) May 5, 2014
Embedded Systems and Microcontrollers Not getting O/P:PIC18F4520 project using Timer0 module Nov 22, 2013

Share This Page