• 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






Re: MPLAB SIM…
#7
中級會員
中級會員


查看用戶資訊
謝謝Ryang提供參考資料…

發表於: 2007/9/17 13:07
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLAB SIM…
#6
版主
版主


查看用戶資訊
MPLAB SIM 的模擬輸入功能是很強大的。除了可以設定 I/O 的輸入外還可以利用 Clock 產生輸入時脈或模擬 AD & RS-232 ...等的檔案輸入方式。
有興趣研究的話可以到 MPLAB IDE 下啟動 MPLAB SIM 後,Stilmulus 裡就有此功能。詳細使用方式可以參考 MPLAB SIM 的 Help 說明,或可以看些 Web-Seminar的說明:
http://techtrain.microchip.com/websem ... ents/MPLAB_SIM_092304.pdf

或是 Web-Seminar 裡的第七巷裡:
http://techtrain.microchip.com/webseminars/Archived.aspx

發表於: 2007/9/17 11:55
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLAB SIM…
#5
中級會員
中級會員


查看用戶資訊
Dear C_H_M:

感謝你熱心回覆,目前GPIO設為output時,在MPLAB SIM中已可正常變更;但如果將GPIO設為input時,在MPLAB SIM還是無法變更,不過有個偷吃步就是,摸擬時先將GPIO設為outpout,測試完再將程式修正回來即可。

發表於: 2007/9/17 11:43
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLAB SIM…
#4
中級會員
中級會員


查看用戶資訊
真不好意思唷!
只注意到了ADC模組的存在. 另外還有一個比較器模組在....

以下引用 資料手冊 中的 I/O 設定述敘給你參考:
這次一定會可以的.

BCF          STATUS,RP0     ;Bank 0
   CLRF        GPIO                
;Init GPIO
   MOVLW    07h                  
;Set GP<2:0to
   MOVWF    CMCON             
;digital IO
   BSF          STATUS
,RP0     ;Bank 1
   CLRF        ANSEL              
;Digital I/O
   MOVLW    0Ch                  
;Set GP<3:2> as inputs
   MOVWF    TRISIO             
;and set GP<5:4,1:


-----------------------------------------------------------------
這裡是資料手冊中對 I/O 設定為 digital 時的注意事項,
意思是--->要注意 ANSEL 與 CMCON 的 設定內容,
否則 I/O 讀出值會為 0 喔!

NoteThe ANSEL (9Fh) and CMCON (19h)
         
registers (9Fhmust be initialized to
         configure an analog channel 
as a digital
         input
Pins configured as analog inputs will
         read ‘0’
The ANSEL register is defined for
         
the PIC12F675.


發表於: 2007/9/17 10:02
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLAB SIM…
#3
中級會員
中級會員


查看用戶資訊
Dear C_H_M:
我試過你的方法,將ANSEL設為00000000,但是無效,還是無法變更。不過還是很謝謝你提供意見…

發表於: 2007/9/17 8:14
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: MPLAB SIM…
#2
中級會員
中級會員


查看用戶資訊
會一樣喔! ........ 嚇你的啦!

你的問題是因為 你正好選擇了 12F675.
它是一個內含有 ADC 的晶片.

而GP0 / GP1 / GP2 / GP4 又是 AN0 / AN1 / AN2 /AN3
------------------------------------------------------------------

所以當你要 GP0/ GP1 / GP2 / GP4 為 digital 的 I/O時,

要將 ANSEL 的 bit 0 (ANS0), bit1(ANS1), bit 2(ANS2), bit3(ANS3) 設定為 0

因為, ANSEL 的初始值為 0000 1111 (電源on後預設為Analog輸入喔!)

發表於: 2007/9/14 14:52
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


MPLAB SIM…
#1
中級會員
中級會員


查看用戶資訊
各位,想請教一個問題:
使用MPLAB SIM來摸擬程式時,為什麼有的I/O Pin可以透過watch來寫入值,有的不行?
例如…
使用12F675,透過watch可以改變GPIO5的H、L狀態,GPIO0~GPIO4則無法變更…
不知實際應用時,狀況會一樣嗎?

發表於: 2007/9/14 13:13
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... ]

教育訓練中心

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