• slider image 442
  • slider image 483
  • slider image 484
  • slider image 485
  • slider image 486
  • slider image 487
  • slider image 488
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users




(1) 2 »


Re: 程式疑難2
#16
高級會員
高級會員


查看用戶資訊
我以前用過別顆 , 因為 comparator 沒設好 , 也和你一樣 , 程式看澖了都看不出有問題 , 結果是 comparator 沒關 = =

發表於: 2009/4/11 18:05
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式疑難2
#15
初級會員
初級會員


查看用戶資訊
我知道SIM沒問題,我也是用DEBUG模式才出問題,剛在測試時我發現PORTC是可以讓我用程式去控制輸出H,但為啥PORTA就不能讓我控制輸出H,問題是否出在PORTA還需要設定啥才能輸出H?

發表於: 2009/4/10 14:26
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式疑難2
#14
版主
版主


查看用戶資訊
剛測了一下你的程式,在 MPLAB SIM 下模擬最後 PORTA4 & PORTA5 都可以正確輸出 1,PORTA=0x30 正確無誤。

建議可以從 201 ASP 讀起,教材內是用PIC16F887的組語來練習所有的周邊。看完功力大進。

201 ASP 教育訓練 : http://www.microchip.com.tw/modules/w ... glefile.php?cid=3&lid=380

發表於: 2009/4/10 9:30
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式疑難2
#13
版主
版主


查看用戶資訊
不曉得是我的 RAR 解壓縮程式損壞還是你壓的 RAR 有問題,打不開說是革是損壞了。

沒關係就你貼上了的程式去做測試,待會再說明。

發表於: 2009/4/10 9:09
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式疑難2
#12
初級會員
初級會員


查看用戶資訊
各位先進,針對目前我遭遇到的困境,我有幾點想要確認:

1. 在MPLAB IDE下的 PROGRAM SUCCEEDED,真的代表程式已經燒進CHIP麻?
2. 我使用16F883,我將晶震造著SPEC上說明接在OSC1和OSC接腳上,16F883已確定VSS和VDD都正常接續,MPLAB IDE的config bit裡的OSC也有選HS,這樣可確保我外部晶震有正常工作麻,我可用示波器量測到頻率麻(我目前量不到)。
3. 我目前感覺I/O都能接收到輸入訊號,但就是I/O輸出無法讓程式正常控制,有哪些原因會造成此種現象?

煩請各位先進,幫忙小子度過此一難關,連測試I/O功能都搞不定,我看我離炒魷魚不遠了,以下是測試程式:

LIST P=16F883 ;directive to define processor
#include <P16F883.INC> ;processor specific variable definitions

;***********************************************************************
;
#define VBT_DET PORTA,0
#define LIN_EN PORTA,1
#define IGN PORTA,2
#define REL_CW PORTA,4
#define REL_CCW PORTA,5
#define SWUP PORTB,3
#define SWOP PORTB,4
#define SWCL PORTB,5




;***********************************************************************
;Reset vector
; This code will start executing when a reset occurs.

ORG 0x0000
GOTO MAIN ;go to start of main code


;***********************************************************************
;Start of main program
; The main program code is placed here.

MAIN:
BANKSEL PORTA ;
CLRF PORTA ;Init PORTA
CLRF PORTB ;Init PORTB
CLRF PORTC ;Init PORTC
BANKSEL ANSEL ;
CLRF ANSEL ;DIGIPAL
CLRF ANSELH ;DIGITAL
BCF STATUS,RP1 ;
MOVLW B'11000001' ;
MOVWF TRISA ;Set PORTA is input or output
MOVLW B'11111011' ;
MOVWF TRISB ;Set PORTB is input or output
MOVLW B'10100110' ;
MOVWF TRISC ;Set PORTC is input or output

OP_DET:
BANKSEL PORTB ;
BTFSC PORTB,4 ;
GOTO OP_DET ;
BSF PORTA,4 ;Motor CCW
BSF PORTA,5 ;Motor CW
BTFSS PORTB,4 ;
GOTO $-1 ;
GOTO OP_DET ;


;
;***********************************************************************
;End of program

END

發表於: 2009/4/10 8:59
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式疑難2
#11
初級會員
初級會員


查看用戶資訊
的確是壞了,我重傳一次看看><


奇怪,上傳前都能解壓,上傳後下載就有問題><

Attach file:


Link only for registered users

發表於: 2009/4/10 8:26
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式疑難2
#10
高級會員
高級會員


查看用戶資訊
壓縮檔毀損?蝦咪..是我的問題嗎...XD

發表於: 2009/4/9 17:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式疑難2
#9
版主
版主


查看用戶資訊
沒看到附件?

發表於: 2009/4/9 8:49
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式疑難2
#8
初級會員
初級會員


查看用戶資訊
附件為發生問題的測試用程式,但拿出來壓縮,好像就會路徑不正常,無法復原我MPLAB IDE的設定,不知道這樣是否可以。

PS: 感謝0u0兄的提示,我已測試過並無短路跡象。

Sorry 忘記按下"上傳"

Attach file:


Link only for registered users

發表於: 2009/4/9 8:35

Edited by Leon on 2009年04月09日 08:59:04
Edited by Leon on 2009年04月09日 08:59:59
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 程式疑難2
#7
資深會員
資深會員


查看用戶資訊
我建議拿起電表量量是否有跟隔壁腳短路的情形...

發表於: 2009/4/8 20:05
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部







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.

[進階搜尋]


:::

Microchip連結

https://www.facebook.com/microchiptechnologytaiwan/
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=13
https://mu.microchip.com/page/tmu
http://elearning.microchip.com.tw/modules/tad_link/index.php?cate_sn=1
https://page.microchip.com/APAC-PrefCenters-TW.html
http://www.microchip.com/
http://www.microchip.com/treelink
http://www.microchipdirect.com/
http://www.microchip.com.cn/newcommunity/index.php?m=Video&a=index&id=103
http://www.microchip.com.tw/modules/tad_uploader/index.php?of_cat_sn=2
http://www.microchip.com.tw/Data_CD/eLearning/index.html
http://www.microchip.com.tw/RTC/RTC_DVD/
https://www.microchip.com/development-tools/
https://www.youtube.com/user/MicrochipTechnology
[ more... ]

教育訓練中心

!開發工具購買
辦法說明 [業界客戶] [教育單位]
----------------------------------
!校園樣品申請
辦法說明 [教師資格] [學生資格]
----------------------------------