Browsing this Thread:
1 Anonymous Users
|
Re: 如何讓四位元的7-seg顯示不同的數字.....
|
|
版主
![版主](https://microchip.com.tw/uploads/rank3dbf8edf15093.gif)
Joined
: 2004/4/30 10:53 最後登入時間
: 2021/11/30 18:11
From CAE, Microchip
Group:
站務管理者 註冊會員
Level : 75 HP : 744 / 1861 MP : 5367 / 109730 EXP : 45
|
請參考"詳細解析PIC16F877原理與應用",洪正瑞編者,台科大 圖書公司出版
發表於: 2006/3/11 10:31
|
|
|
如何讓四位元的7-seg顯示不同的數字.....
|
|
新會員
![新會員](https://microchip.com.tw/uploads/rank3e632f95e81ca.gif)
Joined
: 2006/2/15 11:38 最後登入時間
: 2006/10/31 9:00
Group:
註冊會員
Level : 1 HP : 0 / 15 MP : 2 / 810 EXP : 60
|
list p=16f877 include <P16F877.INC> errorlevel -302 __CONFIG _BODEN_OFF&_CP_OFF&_PWRTE_OFF&_WDT_OFF&_XT_OSC&_DEBUG_OFF&_CPD_OFF&_LVP_OFF ;********************************************** ORG 20H Dis_1 RES 1 Dis_2 RES 1 Dis_3 RES 1 Dis_4 RES 1 Scan RES 1 ;*********************************************** ORG 00H NOP GOTO Start Start CLRW CLRF PCLATH CLRF PORTB BANKSEL TRISB MOVLW B'11110000' MOVWF TRISB CLRF PORTD BANKSEL TRISD MOVLW B'00000111' MOVWF TRISD MOVLW Dis_1 MOVWF H'04' MOVLW B'0001' MOVWF H'00' MOVLW Dis_2 MOVWF H'04' MOVLW B'0010' MOVWF H'00' MOVLW Dis_3 MOVWF H'04' MOVLW B'0011' MOVWF H'00' MOVLW Dis_4 MOVWF H'04' MOVLW B'0100' MOVWF H'00' LOOP MOVLW Scan MOVWF H'04' MOVLW B'11111110' MOVWF H'00' MOVLW Dis_1 MOVWF H'04' LOOP1 MOVF H'00',0 BANKSEL PORTB MOVWF PORTB MOVLW Scan MOVF H'24',0 BANKSEL PORTD MOVWF PORTD BSF 3,0 RLF Scan,1 CALL DELAY INCF FSR,1 MOVF Dis_4,0 SUBWF FSR,0 BTFSS 3,2 GOTO LOOP1 GOTO LOOP
DELAY MOVLW H'F0' MOVWF H'30' MOVLW H'F0' MOVWF H'31' DECFSZ H'31',1 GOTO $-1 DECFSZ H'30',1 GOTO $-5 RETURN END --------------------------------------------------------- 上面的程式動作目地是要讓四位元的7-seg顯示不同的數字
但出來的動作顯示卻一直不正確.......
不知道是我那裡的觀念不正確........
煩請各位前輩指教........
發表於: 2006/3/9 14:04
|
|
You can view topic.
你 不可以 發起新主題
You cannot reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You cannot post without approval.
You cannot use topic type.
You cannot use HTML syntax.
You cannot use signature.
You cannot create PDF files.
You cannot get print page.