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
    3
    0
    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.
     
    #1
  2. geoffers

    geoffers Member

    Joined:
    Oct 25, 2010
    221
    5
    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.
     
    #2
  3. absf

    absf Well-Known Member

    Joined:
    Dec 29, 2010
    1,212
    271
    #3
  4. josephting

    josephting Thread Starter New Member

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

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

    kubeek AAC Fanatic!

    Joined:
    Sep 20, 2005
    4,047
    604
    I guess you will need to start reading some documentation about the compiler you use, find some examples and then come back with questions.
     
    #5
    absf likes this.
Loading...