Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 4.3 單顆七段. 2 共陰極七段顯示器 C ommon Cathod 00111111(abcdefg) 七段接腳 gf(com)ab ed(com)cp HT46R23 接腳 VDD(20) RES(19) OSC1(21) OSC2(22) VSS(11) PA0-PA7(6,5,4,3,26,25,24,23)

Similar presentations


Presentation on theme: "1 4.3 單顆七段. 2 共陰極七段顯示器 C ommon Cathod 00111111(abcdefg) 七段接腳 gf(com)ab ed(com)cp HT46R23 接腳 VDD(20) RES(19) OSC1(21) OSC2(22) VSS(11) PA0-PA7(6,5,4,3,26,25,24,23)"— Presentation transcript:

1 1 4.3 單顆七段

2 2 共陰極七段顯示器 C ommon Cathod (abcdefg) 七段接腳 gf(com)ab ed(com)cp HT46R23 接腳 VDD(20) RES(19) OSC1(21) OSC2(22) VSS(11) PA0-PA7(6,5,4,3,26,25,24,23)

3 3 #INCLUDE HT46R23.INC.CHIP HT46R23 MY_DATA.SECTION ‘DATA’ DEL1 DB ? ;DELAY1 DEL2 DB ? ;DELAY2 DEL3 DB ? ;DELAY3 COUNT DB ? SEG_PORT EQU PA ;PORT A is OUTPUT SEG_PORTC EQU PAC ;CONTROL REGISTER MY_CODE.SECTION AT 0 ‘CODE’ ;PROGRAM SECTION ORG 00H ;RESET VECTOR CLR SEG_PORTC ;PA is OUTPUT MAIN: MOV A,OFFSET TAB_7_SEG MOV TBLP,A ;INITIAL POINTER ATART ADDRESS

4 4 MOV A,10 MOV COUNT,A ;SET DATA COUNT OF TAB_7_SEG(0-9) LOOP: TABRDL SEG_PORT ;TBLP POINT TO LASTPAGE ;DATA TO SEG_PORT ;TBLH TIME CONSTANT MOV A,TBLH MOV DEL1,A ;DELAY FACTOR CALL DELAY ;DELAY TBLH*10mS INCTBLP;UPDATE TABLE POINTER SDZCOUNT;COUNT DOWN BY 1 JMPLOOP ;JUMP IF NOT TABLE END JMPMAIN;RESTART

5 5 DELAY PROC MOV A,30 MOV DEL2,A;SET DEL2 COUNTER DEL_2:MOV A,110 MOV DEL3,A;SET DEL3 COUNTER DEL_3: SDZ DEL3 ;DEL3 DOWN COUNT JMP DEL_3 SDZ DEL2 ;DEL2 DOWN COUNT JMP DEL_2 SDZ DEL1;DEL1 DOWN COUNT JMP DELAY RET DELAYENDP ORGLASTPAGE TAB_7_SEG: DC SHL 8;7 SEG CODE FOR COMMOM CATHOD LED DC SHL 8 ;CONNECT BIT 0~7 FOR SEGMENT A~H DC SHL 8 ;LOW-BYTE FOR 7 SEG DISPLAY CODE DC SHL 8 ;HIGH 7 BITs FOR DELAY FACTOR DC SHL 8 DC SHL 8 DC SHL 8 DC SHL 8 DC SHL 8 DC SHL 8 END

6 6 SHL SHL (TBLP 顯示 0 至 9) = (after SHL Bit 14-8 放置 TBLH 作為 DELAY)


Download ppt "1 4.3 單顆七段. 2 共陰極七段顯示器 C ommon Cathod 00111111(abcdefg) 七段接腳 gf(com)ab ed(com)cp HT46R23 接腳 VDD(20) RES(19) OSC1(21) OSC2(22) VSS(11) PA0-PA7(6,5,4,3,26,25,24,23)"

Similar presentations


Ads by Google