Browsing this Thread:
2 Anonymous Users
Topic options
View mode
舊的在前
Re: ICD2 使用問題
版主
Joined
: 2004/4/30 10:53最後登入時間
: 2021/11/30 18:11
From CAE, Microchip
Group:
站務管理者 註冊會員
Level : 75
HP : 744 / 1861
MP : 5367 / 111040
EXP : 45
跟測試了一下你的程式,PORTB 的動作是可以的。我是用MPLAB SIM直接看 watch window 裡的 PORTB 變化。 Compiler : HI-TECH C PRO for the PIC10/12/16 MCU family V9.65
發表於: 2009/8/28 16:45
ICD2 使用問題
新會員
Joined
: 2009/8/27 9:32最後登入時間
: 2010/1/18 15:10
Group:
註冊會員
Level : 1
HP : 0 / 11
MP : 2 / 519
EXP : 47
您好,我使用C寫了一個程式,程式段碼如下: volatile bit KB_CLK @ ((unsigned)&PORTB*8)+0; volatile bit KB_DATA @ ((unsigned)&PORTB*8)+1; volatile bit CLK_C @ ((unsigned)&TRISB*8)+0; volatile bit DATA_C @ ((unsigned)&TRISB*8)+1; CLK_C = 0 ; DATA_C = 0 ; KB_CLK = 1 ; asm("nop"); KB_DATA = 1 ; asm("nop"); CLK_C = 1 ; CK = 1 ; Delay40uS() ; while(!KB_CLK) ; 理論上我應該能對PORTB的 bit0&1 做I/O動作,可我不管自動執行或單步,都無法得到portB的資料(一直為0x00)。請問這是正常的嘛? 到 while(!KB_CLK) 這行就停住了(我量 portb.0有5V,且trisb慶定為input status)
發表於: 2009/8/28 11:19
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.