Re: pic10f206的問題
|
||||
---|---|---|---|---|
新會員
|
謝謝這位高人指點,我的確疏忽比較器的設定。
發表於: 2004/11/19 9:28
|
|||
|
pic10f206的問題
|
||||
---|---|---|---|---|
新會員
|
各位前輩!!
我現在因為幾個案子會用到PIC10F206,因此先試玩一下這顆 IC,但是我碰到一些問題,因此想拿出來跟大家討論!! 以下是我寫的簡單DEMO 程式: list p=10f206 #include <P10F206.inc> ;**************************************************************** ;Initialize GPIO & 10f206 & OSC ;**************************************************************** DelayCounter1 equ 0x10 DelayCounter2 equ 0x11 ;***************************************************************** ;Program start ;***************************************************************** org 0x00 ; reset vector nop ; Reserve for MPLAB-ICD Initialize: clrf GPIO movlw b'00000000' TRIS GPIO movlw b'01111110' movwf OSCCAL goto main ;--Delay Function-------------------------------------------------- pDelay1ms: movlw .198 movwf DelayCounter1 nop nop tagDelay1ms_01: nop nop decfsz DelayCounter1, F goto tagDelay1ms_01 retlw 0x00 pDelay250ms: movlw .250 movwf DelayCounter2 tagDelay250ms_01: call pDelay1ms decfsz DelayCounter2, F goto tagDelay250ms_01 retlw 0x00 ;--Main----------------------------------------------------------- main: ;call pDelay250ms NOP movlw b'00000111' movwf GPIO ;call pDelay250ms NOP movlw b'00000000' movwf GPIO goto main END 此程式組譯會過,MPLAB SIM的GPIO的值也是我要的,但是 當我把PIC10F206燒好放在板子上時,GPIO0,1,2所接的LED 燈卻不會動作,因此我想請教大家可能是拿裡出問題呢? 我用電錶量gpio0,1,2只有0.4V但是gpio3卻有5V 這該如何是好呢?? 謝謝大家
發表於: 2004/11/17 15:42
|
|||
|