All About Circuits Forum  

Go Back   All About Circuits Forum > Software, Microcomputing, and Communications Forums > Embedded Systems and Microcontrollers

Notices

Embedded Systems and Microcontrollers Discussion forum for projects and working with embedded systems and microcontrollers (FPGAs, PICs, AVRs). Get help with hardware issues and embedded programming.

Reply   Post New Thread
 
Thread Tools Display Modes
  #1  
Old 08-19-2012, 08:31 AM
josephting josephting is offline
New Member
 
Join Date: Aug 2012
Posts: 3
Default PIC 18F4520 Interfacing with LED Dot Matrix for Running Message Display

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.
Reply With Quote
  #2  
Old 08-19-2012, 09:51 AM
geoffers geoffers is offline
Senior Member
 
Join Date: Oct 2010
Location: UK Devon
Posts: 192
Default

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.
Reply With Quote
  #3  
Old 08-19-2012, 12:22 PM
absf absf is offline
Senior Member
 
Join Date: Dec 2010
Location: Sarawak (GMT+8)
Posts: 971
Default

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/projec..._%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
Reply With Quote
  #4  
Old 08-20-2012, 03:32 PM
josephting josephting is offline
New Member
 
Join Date: Aug 2012
Posts: 3
Default

Quote:
Originally Posted by absf View Post
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/projec..._%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 ?

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
Select All

Last edited by bertus; 08-20-2012 at 03:36 PM. Reason: usd code tags
Reply With Quote
  #5  
Old 08-20-2012, 08:35 PM
kubeek's Avatar
kubeek kubeek is offline
Senior Member
 
Join Date: Sep 2005
Location: Prague, Czech Rep
Posts: 3,445
Default

I guess you will need to start reading some documentation about the compiler you use, find some examples and then come back with questions.
Reply With Quote
The Following User Says Thank You to kubeek For This Useful Post:
absf (08-21-2012)
Reply   Post New Thread

Tags
, , , , , , ,


Similar Threads
Thread Thread Starter Forum Replies Last Post
plz help for led dot matrix sim math_1048 Homework Help 5 01-12-2012 06:25 PM
5x8 LED Matrix Display: need urgent help! ^_^ geunrisse The Projects Forum 4 10-05-2009 12:23 PM
Need Help 5x7 Bi-Color LED Dot Matrix Switched Counting Flashing Changing Project eazy2001x Embedded Systems and Microcontrollers 5 03-29-2008 01:35 AM
led dot matrix urgent inzaghi Homework Help 2 02-03-2008 07:02 AM
5X7 led dot matrix r.shk Embedded Systems and Microcontrollers 0 11-11-2007 01:01 PM

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:19 PM.


User-posted content, unless source quoted, is licensed under a Creative Commons Public Domain License.
Powered by vBulletin
Copyright ©2000 - 2014, vBulletin Solutions, Inc.