• 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: pic10f206的問題
#3
新會員
新會員


查看用戶資訊
謝謝這位高人指點,我的確疏忽比較器的設定。

發表於: 2004/11/19 9:28
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: pic10f206的問題
#2
中級會員
中級會員


查看用戶資訊
試試看
Initialize:
CLRF CMCON0
clrf GPIO
movlw b'00000000'
TRIS GPIO
MOVLW 0X40
OPTION
movlw b'01111110'
movwf OSCCAL
goto main

CLRF CMCON0===>初值比較器是enable的,要disable

MOVLW 0X40
OPTION===>0X40放入OPTION,Weak Pull-ups bit disable
加上這三行才能做I/O

有錯請指教

發表於: 2004/11/18 0:40
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


pic10f206的問題
#1
新會員
新會員


查看用戶資訊
各位前輩!!
我現在因為幾個案子會用到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
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... ]

教育訓練中心

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