Browsing this Thread:
1 Anonymous Users
|
請教各位...
|
|
中級會員
Joined
: 2004/10/19 11:53 最後登入時間
: 2006/7/5 15:13
Group:
註冊會員
Level : 5 HP : 0 / 122 MP : 16 / 7013 EXP : 90
|
大家好 這是一個簡單的程式 我想要利用按鍵的按下 LED便會往左移一位 每按一下 往左移一位 但是我的程式不會RUN 請各位高手指點 感激不盡 我使用PIC 16F873A ICD 2 Demoboard PICDEM 2 PLUS
list p=16F873a #include <p16f873a.inc> ; Include file locate at defult directory ; #define Shift_value b'0001' shift_value equ 0x20 ;******************************************** ;********************************************* org 0x00 nop initial: banksel ADCON1 ;定義ADCCON1,將PORTA第四個bit設為數位模式 movlw b'11001110' movwf ADCON1 banksel CMCON ;定義CMCON將比較器功能關閉 movlw b'00000111' movwf CMCON banksel TRISB ;定義TRISB設定PORTB為輸出模式 clrf TRISB banksel PORTB clrf PORTB ;*********************************************** Main ;*********************************************** start: ;movlw b'00000000' ;LED初始狀態 ;movwf PORTB movlw Shift_value movwf PORTB switch: btfsc PORTA,4 ;判斷RA4是否按下 goto switch ;沒有-->switch繼續偵測;有-->執行下一行 goto original
;-----------------------LED狀態--------------------------------- original: rlf PORTB goto switch ;----------------------------------------------------------------------- end
發表於: 2005/8/23 16:09
|
|
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.