5x7 Display
Test
Routine
THE
TEST ROUTINE
This is the Test Routine that comes with the PIC16F84 chip when supplied
with the 5x7 Display kit.
Simply fit the chip to the completed project and switch on. The LEDs will
illuminate individually, starting from the bottom left-hand LED and moving up the column. The 2nd, 3rd, 4th and 5th columns
are also be
tested in the same way.
The second test is a brightness test. All the LEDs come on at the same time
in a scan routine, and any LEDs that appear dull should be replaced.
The third test is a Sound Test. It tests the piezo diaphragm with a set of
notes.
Once you are satisfied with the performance of the project, the chip can be
re-programmed with the experiments contained in the project. You
will lose the Test Routine but if you want to run the Test Routine at a
later date, it can be "re-burnt" into the chip by referring to the
Test Routine on the disc.
The only feature we have not tested is the "burning" or
"programming" capability of your project. This is the
biggest test of all and the only way to test this feature is to "burn"
or "download" the first experiment. The 5x7 Video
Screen project has been tested on a number of different computers and the
circuit is capable of accepting a wide range of voltages. The two indicator
LEDs on the project will show if 5v is present via the 6v battery and
the presence of 13v during programming.
|
Test Routine
for 5x7 Display
;Program for PIC16F84 and only F84 chip
;Test Routine supplied with PIC chip
Start ORG 0x00
;Start the micro at address 00
BSF 03,5
;Go to page1 for setting-up the ports
MOVLW 00h
;Put 00 into W
MOVWF 05h
;Make all RA lines output
MOVWF 06h
;Make all RB lines output
BCF 03,5
;Go to Page0 for programming
MOVLW 02h
;Put 02 into W to
MOVWF 05h
; Reset the 4017
MOVLW 00h
;Put 00 into W so that 4017
MOVWF 05h
; can be clocked
MOVLW 05
MOVWF 1Eh
;counter for shifts across the screen
;Turn on one LED at a time
Up BCF 03h,0
;clear the carry flag
MOVLW 01h
;Turn on the bottom LED
MOVWF 06h
; and output a HIGH
CALL Delay
Up1 RLF 06h,1
;Shift the HIGH up the column
CALL Delay
BTFSS 06h,6
;Has it reached the top?
GOTO Up1
;NO.
BSF 05,0
;Clock the 4017
NOP
BCF 05,0
DECFSZ 1Eh,1
;Decrement the count file
GOTO Up
;Turn on FULL screen
Full MOVLW 05
MOVWF 1Eh
;counter for shifts across the screen
FullA MOVLW 7Fh ;Illuminate all LEDs
MOVWF 06
;Output to screen
DelA NOP
DECFSZ 1Dh,1
;Short delay to see LEDs
GOTO DelA
BSF 05,0
;Clock the 4017
NOP
BCF 05,0
DECFSZ 1Eh,1
;Decrement the count file
GOTO FullA
DECFSZ 1Ah,1
;256 loops to see screen
GOTO Full
;Spiraling tone from piezo
Piezo MOVLW 060h
;This is also the number of steps
MOVWF 10h
;Stores ON-TIME for piezo
MOVWF 11h
;Stores OFF-TIME for piezo
Piezo1 MOVF 10h,0
;Copy file 10h to W
MOVWF 12h
;Move 10h to 12h for decrementing
MOVF 11h,0
;Copy file 11h to W
MOVWF 13h
;Move 11h to 13h for decrementing
BSF 06,7
;Turn on piezo line
On NOP
DECFSZ 12h,1
;Decrement the ON-time
GOTO On
BCF 06,7
;Turn off piezo line
Off NOP
DECFSZ 13h,1
GOTO Off
DECFSZ 14h,1
GOTO Piezo1
;256 loops for each HIGH/LOW
DECF 10h,1
;Make tone higher pitch
DECFSZ 11h,1
;Make tone higher pitch
GOTO Piezo1
GOTO Start
Delay MOVLW 01
MOVWF 1Ah
Delay1 DECFSZ 1Bh,1
GOTO Delay1
DECFSZ 1Ch,1
GOTO Delay1
DECFSZ 1Ah,1
GOTO Delay1
RETURN
END
|
|
The block of
numbers below is the HEX file for TstRout. Copy and paste
it into a text program such as TEXTPAD or NOTEPAD and call it:
TstRout.hex
|
|
|
:1000000083160030850086008312023085000030A0
:10001000850005309E000310013086003B20860DD0
:100020003B20061F0F280514000005109E0B0B280F
:1000300005309E007F30860000009D0B1C280514B3
:10004000000005109E0B1A289A0B182860309000AB
:100050009100100892001108930086170000920B7F
:100060002E2886130000930B3228940B2928900326
:10007000910B2928002801309A009B0B3D289C0BEE
:080080003D289A0B3D28080001
:00000001FF |
More Testing of the project can be found at:
Testing Page 1
Testing Page 2
Testing Page 3
The first experiment can be found at:
5x7
EXPERIMENTS: Page-1.
|