HomeArticlesProjectsBlogContact
Articles
5x7 Display
Colin Mitchell
Colin Mitchell
Make sure to subscribe to our newsletter and be the first to know the news.

Table Of Contents

01
TESTING THE DISPLAY
02
SLOW SCAN
03
FAST SCAN
04
RUNNING SIGN

TESTING THE DISPLAY

Page 2

The 5 VIRTUAL SCREEN files are: 11h, 12h, 13h, 14h, and 15h.

Test4 scans the LEDs slowly so you can see the scanning. To increase the scan rate so the screen appears as a “chequer-board,” delete the two instructions in the delay routine.
To obtain the value for each “Ghost file,” you need to know the hex value for each LED. The bottom LED has a value of 01. The next LED: 02, 04, 08, 10, 20, 40. To combine two or more LED you must add their hex values.
For instance, the two bottom LEDs have a combined value of 03. The lowest 3 LEDs have a combined value of 01 + 02 + 04 = 07. The lowest 4 LEDs: 08 + 04 + 02 + 01 = 0F
For the chequer-board effect, the values are 55h and 2Ah

SLOW SCAN

FAST SCAN

The block of numbers below is the HEX file for Test 4. Copy and paste it into a text program such as TEXTPAD or NOTEPAD and call it: Tst4-5x7.hex

:1000000083160030850086008312553091002A3017
:100010009200553093002A30940055309500851495
:100020000000851011088600222012088600222078
:100030001308860022201408860022201508860056
:1000400022200F289B0B2228003086000514000078
:04005000051008008F
:00000001FF

RUNNING SIGN

The 5x7 Display can display running messages. Even though the “window” is only large enough for one letter to be displayed at a time, the words can still be read.

Remember, this project is just a starting point. Its concepts can be expanded to any size and shape. For the RUNNING SIGN Routine, data in table1 is loaded into 5 Ghost locations (11h, 12h, 13h, 14h, 15h) and this data is displayed on the screen. One byte is transferred at a time from the table and loaded into the Ghost section. A routine then outputs the five locations to the screen.
The data in the Ghost section is then shifted one place to the left and a new byte loaded into the 5th location (15h).
This gives the effect of a message scrolling across the screen, from right to left. The message supplied with the project is: TE MOVING SIGN, but this can be altered to any message by changing the data in Table1. To work out the value of each column of LEDs, the individual HEX values are added together.
The program looks for “FF” and repeats the message.

RUNNING SIGN for 5x7 Display

;Program for PIC16F84 and only F84 chip
;Takes data from Table1 and runs it across the screen

 Start ORG 0x00   ;This sets up the ports
 BSF 03,5
 MOVLW 00h
 MOVWF 05h
 MOVWF 06h
 BCF 03,5
 GOTO Run1

   ;Table1 holds the hex values for each column of LEDs

 Table1 ADDWF 02h,1   ;Add W to Program Counter
        RETLW 00h
        RETLW 40h
        RETLW 40h
        RETLW 7Fh
        RETLW 40h
        RETLW 40h
        RETLW 00h
        RETLW 7Fh
        RETLW 49h
        RETLW 49h
        RETLW 41h
        RETLW 41h
        RETLW 00h
        RETLW 3Fh
        RETLW 40h
        RETLW 3Fh
        RETLW 40h
        RETLW 3Fh
        RETLW 00h
        RETLW 3Eh
        RETLW 41h
        RETLW 41h
        RETLW 41h
        RETLW 3Eh
        RETLW 00h
        RETLW 70h
        RETLW 0Eh
        RETLW 01h
        RETLW 0Eh
        RETLW 70h
        RETLW 00h
        RETLW 7Fh
        RETLW 00h
        RETLW 7Fh
        RETLW 10h
        RETLW 0Ch
        RETLW 02h
        RETLW 7Fh
        RETLW 00h
        RETLW 3Eh
        RETLW 41h
        RETLW 45h
        RETLW 45h
        RETLW 36h
        RETLW 00h
        RETLW 32h
        RETLW 49h
        RETLW 49h
        RETLW 49h
        RETLW 26h
        RETLW 00h
        RETLW 7Fh
        RETLW 00h
        RETLW 3Eh
        RETLW 41h
        RETLW 45h
        RETLW 45h
        RETLW 36h
        RETLW 00h
        RETLW 7Fh
        RETLW 10h
        RETLW 0Ch
        RETLW 02h
        RETLW 7Fh
        RETLW 00h
        RETLW 00h
        RETLW 00h
        RETLW 00h
        RETLW 0FFh

Run1    CLRF 11h      ;Clear the Ghost locations ready for starting
        CLRF 12h
        CLRF 13h
        CLRF 14h
        CLRF 15h
        MOVLW 00
        MOVWF 19h     ;File 19h is the jump value for table
Run2    MOVLW 40h
        MOVWF 18h     ;File 18h counts the number of scans
        CALL Shift    ;and controls the "run speed"
        INCF 19h,1
        MOVF 19h,0    ;Put jump value into W
        CALL Table1
        MOVWF 15h     ;W contains table data - put it in 15h
        XORLW 0FFh    ;If table value is FF,
        BTFSC 03,2    ;bit 2 of file 3 will be SET (=1)
        GOTO Run1     ;Start Table1 again
Run3    DECFSZ 18h,1  ;Scan the display 40h times
        GOTO Run4
        GOTO Run2
Run4    CALL Scan
        GOTO Run3

Scan    BSF 05,1      ;Reset 4017
        NOP
        BCF 05,1
        MOVF 11h,0    ;Output the data at the 5 Ghost
        MOVWF 06h     ;locations to the display
        CALL DelD
        MOVF 12h,0
        MOVWF 06h
        CALL DelD
        MOVF 13h,0
        MOVWF 06h
        CALL DelD
        MOVF 14h,0
        MOVWF 06h
        CALL DelD
        MOVF 15h,0
        MOVWF 06h
        CALL DelD
        RETURN

    ;SHIFT moves the data one place to the left to give the "movement"
    ;effect on the screen

Shift   MOVF 12h,0    ;Move file 12h to W
        MOVWF 11h     ;Move W to file 11h
        MOVF 13h,0    ;Move file 13h to W
        MOVWF 12h     ;Move W to file 12h
        MOVF 14h,0    ;Move file 14h to W
        MOVWF 13h     ;Move W to file 13h
        MOVF 15h,0    ;Move file 15h to W
        MOVWF 14h     ;Move W to file 14h
        RETURN

DelD  DECFSZ 1Bh,1    ;Delay for viewing the
      GOTO DelD       ;column of LEDs
      MOVLW 00h
      MOVWF 06
      Clk BSF 05,0    ;Clock the 4017 to NOP  ; the next output
      BCF 05,0
      RETURN

  END

The block of numbers below is the HEX file for Running Sign. Copy and paste it into a text program such as TEXTPAD or NOTEPAD and call it: Running1.hex

:10000000831600308500860083124C288207003456
:10001000403440347F344034403400347F344934F9
:1000200049344134413400343F3440343F34403467
:100030003F3400343E344134413441343E340034A2
:1000400070340E3401340E34703400347F34003494
:100050007F3410340C3402347F3400343E34413465
:100060004534453436340034323449344934493423
:10007000263400347F3400343E3441344534453432
:10008000363400347F3410340C3402347F3400347E
:10009000003400340034FF34910192019301940143
:1000A000950100309900403098007520990A190890
:1000B00006209500FF3A03194C28980B6028532816
:1000C00062205D28851400008510110886007E20BE
:1000D000120886007E20130886007E201408860001
:1000E0007E20150886007E20080012089100130863
:1000F0009200140893001508940008009B0B7E28BA
:0C01000000308600051400000510080007
:00000001FF

The next step adds buttons to the program. Go to Testing Page3



Colin Mitchell

Colin Mitchell

Expertise

electronics
writing
PIC-Chips

Social Media

instagramtwitterwebsite

Related Posts

TODO
Transistor Test
© 2021, All Rights Reserved.

Quick Links

Advertise with usAbout UsContact Us

Social Media