• slider image 442
  • slider image 492
  • slider image 493
  • slider image 494
  • slider image 495
  • slider image 496
  • slider image 491
:::


Browsing this Thread:   1 Anonymous Users






Re: 有冇人可以教我program PIC10F202 ??
#4
資深會員
資深會員


查看用戶資訊
10F206 和10F202 差不多 ,只要把比較器關掉就可以啦!
將就看看吧 !
笨鴨手頭是有一些10F206 的自修資料(花$買的)
如果有興趣的話請告知 伊媚兒,偶可以分享lor !



;-----[About]----------------------------------------------------------------
; File Name:PIC10F206_04.asm, by John Massa, Nov 20, 2004, Ver 1.00
; Description: Press the pushbutton and the LED will pulsate on and off.
;-----[Schematic]------------------------------------------------------------
; PIC10F206
; _ _
; GP0, ICSPDAT, Cin+ [ \_/ ] GP3, MCLR/, Vpp
; Vss, Ground [ ] Vdd, +2.0 VDC to +5.5 VDC
; GP1, ICSPCLK, Cin- [_____] GP2, T0CKI, Cout, FOSC4
;-----[Configuration]--------------------------------------------------------
LIST
; P10F206.INC Standard Header File, Version 1.01 Microchip Technology, Inc.
NOLIST
#include <p10F206.inc> ; processor specific variables
; Configure: Controls the reset pin, code protect, oscillator selection, WDT.
__CONFIG _MCLRE_OFF & _CP_OFF & _WDT_OFF
;-----[Defines & Variable Assignments]---------------------------------------
cblock 0x08
COUNT ; Count buffer
COUNT1 ; Count buffer #1
PWM_BUF ; PWM buffer
endc
;-----[Reset Vector]---------------------------------------------------------
ORG 0x000 ; PIC goes here (Origin of code) after reset.
movwf OSCCAL ; Load the oscillator calibration factor.
goto init ; go to initialization routine
;-----[Interrupt Vector]-----------------------------------------------------
; Note: PIC10F202/206 does not use interrupts.
;-----[Initialization]-------------------------------------------------------
init
;-----[OPTION]---------------------------------------------------------------
; OPTION register controls wake on GP0,1,3 change, GP0,1,3 pull-ups, TM0, etc
movlw b'10000111' ; Set pull-ups only, max pre-scaler
OPTION ;
;-----[CMCON0]---------------------------------------------------------------
; Comparator control register
movlw b'10001111' ; Turn-off the comparator, enable the I/O pins.
movwf CMCON0
;-----[TRIS]-----------------------------------------------------------------
; TRIS (reg#) tri-state I/O register. All I/O pins default to inputs at reset.
movlw b'00001000' ; Set GPIO pin 3 to an input, pins 0 - 3 to outputs.
TRIS GPIO ; Register 06h
;-----[Main routine]---------------------------------------------------------
main ; Routine pulsates an LED connected to GP0 thru 220 Ohms
btfsc GPIO,3 ; Press the pushbutton to begin
goto main ; ...Loop, if the pushbutton is not pressed

clrf COUNT ; The reg COUNT causes the subroutine to loop 255 times.
clrf COUNT1 ; The reg COUNT1 sets the PWM value
clrf PWM_BUF ; The reg PWM_BUF holds the PWM ratio of 'on' to 'off'
bcf GPIO,0 ; Start with the LED turned off
main1
movf COUNT1,W ; Transfer the value in reg COUNT1 to reg PWM_BUF
movwf PWM_BUF
call pwm
incfsz COUNT1,F ; Has COUNT1 counted from 0 to 255?
goto main1 ; ...No, loop again
main2
decf COUNT1,F ; ...Yes, and now COUNT1 holds the decrementing PWM value
main3
movf COUNT1,W ; Transfer the value in reg COUNT1 to reg PWM_BUF
movwf PWM_BUF
call pwm
decfsz COUNT1,F ; Has COUNT1 counted from 255 to 0?
goto main3 ; ...No, loop again
goto main ; ...Yes, start over.
;-----[Subroutines]----------------------------------------------------------
pwm ; This subroutine performs pulse width modulation.
movlw 0xFF ; Move the literal count of 255 to reg 'W'
movwf COUNT ; ...then store it in the register 'COUNT'
pwm1
movf PWM_BUF,F ; Test if the register PWM_BUF is zero
btfsc STATUS,2 ; ...Is PWM_BUF = 0?
goto led_off ; ...No, not yet, skip this instruction for now.
led_on
bsf GPIO,0 ; ...Yes, set GPIO pin-1 high, turn-on the LED
decf PWM_BUF,F ; Decrement the register PWM_BUF
goto exit
led_off
bcf GPIO,0 ; Set GPIO pin-1 low, turn-off the LED
nop
goto exit ;
exit
decfsz COUNT,F ; Has this sobroutine looped 255 times?
goto pwm1 ; ...No, keep looping
retlw 0 ; ...yes, return to the calling program

END ; Directive to end the program



發表於: 2007/3/16 0:33
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 有冇人可以教我program PIC10F202 ??
#3
資深會員
資深會員


查看用戶資訊
試試 Baseline Flash Microcontroller Programmer
型號PG164101 Or PICkit 2, 簡單, 便宜又好用,
但是功能不強, 小投資嘛!
適合簡單PIC,如10F20X,10F22X,12F508.12F510..

發表於: 2007/3/15 3:25
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 有冇人可以教我program PIC10F202 ??
#2
版主
版主


查看用戶資訊
如果PIC10F202是DIP包裝就按10F202轉成PIC12F508的8-pin接腳方式就可以使用PICStart Plus燒錄。
也可以直接使用ICD2燒錄,找到PIC10F202的燒錄規格接上ICD2就可以燒錄了,我都是用ICD2燒PIC10F202的。

http://ww1.microchip.com/downloads/en/DeviceDoc/41228D.pdf

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


有冇人可以教我program PIC10F202 ??
#1
新會員
新會員


查看用戶資訊
有冇人可以教我program PIC10F202 ??
例如programmer 同 software ??

謝謝@@~

發表於: 2007/3/7 22:59
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... ]

教育訓練中心

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