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


Browsing this Thread:   1 Anonymous Users






Re: 關於 PIC10F206 的 delay
#9
新會員
新會員


查看用戶資訊
問題已經解決了, 原來是MPLAB IDE 7.1的bug, 更新到7.3之後就沒有Calibration memory寫入, 會出現錯誤訊息的問題.

發表於: 2005/12/23 15:58
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於 PIC10F206 的 delay
#8
新會員
新會員


查看用戶資訊
沒人知道嗎? 我正在等待答案.
Waiting~~~

發表於: 2005/12/22 18:31
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於 PIC10F206 的 delay
#7
新會員
新會員


查看用戶資訊
您好:
除了用PIC KIT外, 是否可用ICD2寫入OSC校正值?
我用PIC10F202+MPLAB IDE 7.1+ICD2
pic10f202寫入一次, 工作正常, 但是抹除再寫入, 第二次以上就無法正常工作了, 而且0x1FF讀出來是0x000 或者是0x808.
MPLAB IDE Programer -> Settings -> Calibration Memory 有個選項 Allow ICD2 to program calibration memory, 我把它打勾並填入值(試圖修改回來), program target device時, 會出現錯誤訊息, 如下:
Programming Target...
ICDWarn0044: Target has an invalid calibration memory value (0x800). Continue?
ICDWarn0045: You have chosen to program a new calibration memory value. Doing so will destroy the existing calibration memory value. Do you wish to continue?
...Validating configuration fields
...Erasing Part
...Programming Program Memory (0x0 - 0x1FD)
...Calibration Memory
Verifying...
...Program Memory
ICD0161: Verify failed (MemType = Program, Address = 0x4, Expected Val = 0x909, Val Read = 0x800)
ICD0275: Programming failed.
MPLAB ICD 2 Ready
無法寫入PIC, 這是怎麼回事? 是IDE的bug嗎? 更新IDE版本, 可以解決問題嗎?

我用的是 HI-Tech C compiler, C內建組合語法如下
#asm
        
movwf   _OSCCAL            // update register with factory cal value     
        
bsf    _OSCCAL,0
    
#endasm

如果單獨用C language, 有辦法表示嗎?

Thanks!

發表於: 2005/12/21 11:37
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於 PIC10F206 的 delay
#6
資深會員
資深會員


查看用戶資訊
1.OSC校正值回復,可用MICROCHIP出的簡易燒錄器回復,如PIC KIT I 或 II.
2.請問你是用那一種COMPILER?若硬要使用,C可以混合ASM一起寫,把那一行寫進去即可.

發表於: 2005/12/20 20:18
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於 PIC10F206 的 delay
#5
新會員
新會員


查看用戶資訊
我也很想知道, 如何讓timer0開始運作及停止?
目前正在用10F202遇到一些trouble.

另外位址0x1FF的地方是不是不能寫入?(內存Osciliator校正值)
萬一寫入此位址會怎樣, 可以復原嗎?

程式開始的第一行
movwf OSCCAL
如何用c language表示(因為用到W register)

謝謝!

發表於: 2005/12/20 14:01
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


訪客
Re: 關於 PIC10F206 的 delay
#4
多謝你的回覆 ....

我還是有些東西不明白

1. 根據書籍提供的算式, prescaler 的比例越大 (i.e. 1:256) 和 tmr0 的 initial 數值越細 , 這timer 是會行得快了 or 慢了 ?

2. 當tmr0 每次數值加1時(不用prescaler), 是不是需時 1us ( 假設 Fosc 是4MHz ) 標準 ?

3.正如你所說, 判斷是否已經 "經過" 某一點為原則 , 你的意思是不是說 compare 個 tmr0 與 標準數值做比較 ?

4. 當設定了 tmr0 的數值時 , 我如何去令這timer 開始運作 及停止 ?

5. tmr0 在 pic10f206 的環境下 , 有甚麼普遍用途 ?

Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於 PIC10F206 的 delay
#3
資深會員
資深會員


查看用戶資訊
有個現成的程式, 可以拿來參考;
目前笨笨鴨我.... 還看不懂此程式...
是日文的呦... 希望能提供壹些小小助益...
如果有人可以重新詳細註解一下...
笨笨鴨我 呱..呱..呱..呱.. 感激不盡 lar!!!

>>>>>> www.picfun.com/P10F/p10f07.html <<<<<

發表於: 2005/6/28 1:11
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


Re: 關於 PIC10F206 的 delay
#2
管理員
管理員


查看用戶資訊
你好,

PIC10F206 屬於像 PIC16C54 一樣的 Base Line 係列, 所以在 Timer0 的溢位時是沒有中斷旗號可以參考的. 所以要判定是否溢位時並非用偵測 Timer0 是否等於某個值的方式 ( i.e. TMR0 == 0 ). 而是用判斷是否已經 "經過" 某一點為原則.

若要產生的 Clock 不是很快或要讓 TIMER0 停留較多的 Tcy 才加 1 , 則可利用 Prescaler.

記得 , OPTION 的 Bit3 要設為 0 , 才能讓這個 Prescaler 被 Timer0 使用 , 否則會被 WDT 用掉喔 .

Prescaler 使用 OPTION 的 Bit 0..2 , 可設定 8 種不同的預除值:

000 > 1:2
001 > 1:4
010 > 1:8
011 > 1:16
100 > 1:32
101 > 1:64
110 > 1:128
111 > 1:256

加油 !

發表於: 2005/6/27 22:36
Twitter Facebook Google Plus Linkedin Del.icio.us Digg Reddit Mr. Wong 頂部


訪客
關於 PIC10F206 的 delay
#1
本人剛剛學習 pic10f206 mcu 去產生一個方波

當我按tact switch的時候 , mcu就會一個特定頻率的方波

我想用下列方法去做的時候, 就發現到一些問題 .......
1. 如果用 tmr0 去做 delay的時候 , 我如何去檢查這 timer是到了 0FFH ,從而再做另一半的半波 , 因為我在 datasheet 中找不到如 8051 般的 overflow flag 的 interrupt flag
2. 如何決定prescaler 的 數值 ?
3. 當設定了 tmr0 的數值時 , 我如何去令這timer 開始運作 ?
4. 如果我改用一個普通decrement的方法去寫這個 delay loop , 我如何去計算時間

請各位高人幫忙幫忙!

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... ]

教育訓練中心

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