|
877A 接7447解 七段的問題 煩請各位先進指教一下
|
|
中級會員
|
因為最近在練習用pic 接7447來解碼七段顯示器
我的問題是: 七段無法從0變1 也無法從9變1...等
設置如下
---共陽極七段顯示器--- 7447的輸入腳 A B C D 接在 PIC 19 ~ 22接腳(RD0~RD3)
7447的輸出腳 a b c d e f g 接在七段相對應的接腳
7447的 BI\RBO 跟 LT 跟 RBI 全部接High Vcc
我的程式如下: list p=16f877A #include <p16f877A.inc>
cblock 0x20 count_1ms count_250ms endc
main:
banksel TRISD clrf TRISD banksel PORTD clrf PORTD ;就是這邊不能從0變1 bsf PORTD, 0 ;煩請各位先進幫忙T_T ;感激不盡 nop goto main
delay: movlw .250 movwf count_250ms
loop_250: call delay_1ms decfsz count_250ms, f goto loop_250 return
delay_1ms: movlw .249 movwf count_1ms
loop_1ms: nop decfsz count_1ms, f goto loop_1ms return end
發表於: 2008/6/12 16:13
|
|