Total members 11793 |It is currently Wed Aug 21, 2019 8:29 am Login / Join Codemiles

Java

C/C++

PHP

C#

HTML

CSS

ASP

Javascript

JQuery

AJAX

XSD

Python

Matlab

R Scripts

Weka





SEVEN SEGMENT DISPLAY
Code:
list 16f877
include <p16f877.inc>
BANK0 macro
bcf STATUS
,RP0
bcf STATUS
,RP1
endm

BANK1 macro
bsf STATUS
,RP0
bcf STATUS
,RP1
endm

BANK2 macro
bcf STATUS
,RP0
bsf STATUS
,RP1
endm

BANK3 macro
bsf STATUS
,RP0
bsf STATUS
,RP1
endm
;**********
DIGIT EQU 0x20
; *******
ORG 0
NOP
GOTO START
 
ORG 0x20
START CALL INIT 
;.INITIALISE PORTS
AGAIN MOVF DIGIT
,;GET NUMBER BETWEEN 0 9
ANDLW 0x0F 
;ONLY
CALL GET_PATTERN 
;DECODE
MOVWF PORTD 
;OUTPUT
MOVLW 01 
;SELECT 1ST DIGIT
MOVWF PORTA 
;AND OUTPUT
GOTO AGAIN 
;REPEAT FOR EVER
PORT INITIALISATION
INIT BANK1 
;SET To BANr 1
CLRF TRISD 
;SET PORT D To oUTPUT
MOVLW 06 
;MAKE PORT A DIGITAL
MOVWF ADCON1
CLRF TRISA 
;AND PORT OUTPUT
BANK0 
;BACK TO BANK 0
REIURN

DECODE ROUTINE
GET
-PATTERN
ADDWF PCL 
;GoTO EQUIV PATTERN
RETLW 0x3F 
;ZERo PATTERN
RETLW 0x06 
;ONE PATTERN
RETLW 0x5B 
;TWo PATTERN
RETLW 0x4F 
;THREE PATTERN
RETLW 0x66 
;FOLJR PATTzRN
RETLW 0x6D 
;FIvE PATTERN
RETLW 0x7D 
;SIx PATTEuN
RETLW 0x07 
;SEvEN PATTERN
RETLW 0x7F 
;EIGHT PATTERN
RETLW 0x67 
;NINE PATTEuN
RETLW 0x40 
;INVAtID DIGIT
RETLW 0x40 
;INvALID DIGIT
RETLW 0x40 
;PINvALID DIGIT
RETLW 0x40 
;INvALID DIGITN
RETLW 0x40 
;INVAIID DIGIT
RETLW 0x40 
;INvALID DIGIT
END





Author:
Mastermind
User avatar Posts: 2707
Have thanks: 74 time
Post new topic Reply to topic  [ 1 post ] 

  Related Posts  to : SEVEN SEGMENT DISPLAY
 MULTIPLEXING Seven SEGMENT DECODER Assembly     -  
 display list     -  
 Here is how to display any 2d array     -  
 Display a different image for each day of the week     -  
 Display images on jsp from servlet     -  
 How can i display these items in Listview in C#?     -  
 Can I display same vertically on right side?     -  
 read php file in asp and display it as html     -  
 display code block using html     -  
 display Coordinates of mouse in java     -  









Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
All copyrights reserved to codemiles.com 2007-2011
mileX v1.0 designed by codemiles team
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com