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

Thread Starter

josephting

Joined Aug 19, 2012
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.
 

geoffers

Joined Oct 25, 2010
487
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.
 

absf

Joined Dec 29, 2010
1,968

Thread Starter

josephting

Joined Aug 19, 2012
3
Have you been able to display the letter "A" on the 8x4 LED matrix without scrolling? If not, you may take at look at the tutorial project here. Though this project was for 5x7 matrix and used 16F84A, the principle should be same as the 18F PIC.

http://talkingelectronics.com/projects/5x7Display/Display_01_%20Index.html

There is also a tutorial on 8x8 led matrix display in Nigel's PIC tutorial page.

http://www.winpicprog.co.uk/pic_tutorial_hardware.htm

Allen
Thanks. Can u help me convert this to assembly language ?

Rich (BB 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:

kubeek

Joined Sep 20, 2005
5,795
I guess you will need to start reading some documentation about the compiler you use, find some examples and then come back with questions.
 
Top