Re: 12F675使用問題
|
||||
---|---|---|---|---|
版主
|
我在猜,Eigen 大大應該是沒用到的I/O 腳設定成輸入時沒有接地,造成 CMOS 輸入浮接所以不穩定有時就會掛掉。
發表於: 2009/8/25 15:31
|
|||
|
Re: 12F675使用問題
|
||||
---|---|---|---|---|
中級會員
|
請問一下...Eigen 大大說的...這顆會掛掉是怎麼一回事??
我也是幫公司做產品...總不希望做出去的產品會掛掉一堆... 是否可以説一下為什麼這顆會掛掉???
發表於: 2009/8/24 9:41
|
|||
|
Re: 12F675使用問題
|
||||
---|---|---|---|---|
資深會員
|
和耗電流沒關係
沒用的 io 都要接 地,沒差 spec 上的耗電流都是有標測試的條件的 大多數人誰會拿他做比較器? 大都是 io 用途,所以才會對他的預設值感到疑惑 (這一顆的耗電量,我在四五年前可是深受其害,太省電,結果量產後才發現會掛掉)
發表於: 2009/8/23 2:05
|
|||
|
Re: 12F675使用問題
|
||||
---|---|---|---|---|
資深會員
|
參照:
類比狀態 有雜訊時 IC耗電流較小
發表於: 2009/8/22 18:17
|
|||
|
Re: 12F675使用問題
|
||||
---|---|---|---|---|
資深會員
|
每個用 675/629 的人都會遇到第一次沒設定 CMCON ,導致 io 不會動。
我比較好奇 美國microchip 的工程師是以什麼樣的『思考羅輯』在設計?單純的硬體限制?還是有什麼特殊的目的? 為什麼io 的初始狀態不是 gpio 而是比較器? 能解釋一下嗎?很好奇~~
發表於: 2009/8/22 17:15
|
|||
|
Re: 12F675使用問題
|
||||
---|---|---|---|---|
版主
|
CMCON<bit2-0> CM2:CM0: Comparator Mode bits 開機的初始值為 000 ,比較器的接腳動作,需設為 111 以關閉類比輸入功能。參考一下 Data Sheet -- Figure 6-2 shows the Comparator modes and CM2:CM0 bit settings
發表於: 2009/8/21 18:00
|
|||
|
12F675使用問題
|
||||
---|---|---|---|---|
中級會員
|
請教前輩, 我目前在寫PIC12F675的IC,
因為硬體一直不會動, 所以先用軟體模擬,在做測試, 程式閏始後先 initial 一些暫存器, 隨後進入 while 迴圏, while 迴圏裡也只有改變GPIO的狀態, 但我用watch 看 GPIO的狀態是否有變, 確發現 GPIO0 和 GPIO1 怎麼設這二個IO 就是不會改變狀態, 一直維持0的狀態, 我看SPEC看的滿仔細的,能設的暫存器都設了... 實在不知道是怎麼一回事....是否可以幫我確認一下 ....感謝先!! #include <htc.h> __CONFIG(UNPROTECT&BORDIS&MCLRDIS&PWRTDIS&WDTDIS&XT); //Initial Function //--------------------------------------------------------------- void Initial(void) { // Bank0 RP0=1; // Bank1 OPTION = 0b10000111; TRISIO = 0b00000000; PIE1 = 0b11000001; OSCCAL = 0b10000000; INTCON = 0b00000000; //disable all interrupt ADRESL = 0x00; // clear A/D datas ANSEL = 0b00000000; //6-4 // 000 A/D conversion clock Fosc/2 //3 ANS2 as a A/D input WPU = 0x00; IOCB = 0xFF; // Bank0 RP0=0; // Bank0 } //Interrupt Function //--------------------------------------------------------------- void interrupt isr(void) { if(TMR1IF==1) { TMR1IF=0; } if(ADIF==1) { ADIF=0; } if(CMIF==1) { CMIF=0; } if(EEIF==1) { EEIF=0; } } //Main Function //--------------------------------------------------------------- void main(void) { Initial(); while(1) { GPIO = 0x00; GPIO = 0xFF; } } Attach file: Link only for registered users
發表於: 2009/8/21 17:28
|
|||
|