Re: pic16f946使用crystal 32768做real time用之問題

作者 Ryang 於 2020年01月09日 14:22:27
如貼圖所示: LP OSC 的控制是使用 T1OSCEN=1 and Fosc= 0x000 後才能開啟外部的 32768Hz 的震盪器。

T1CS = 1 也要設定。使用非同步模式,這樣在睡眠模式下才可以計時。

所以 T1CON = 0b00001111 + Fosc= 0b000

bit 2-0 FOSC<2:0>: Oscillator Selection bits
111 = RC oscillator: CLKO function on RA6/OSC2/CLKO/T1OSO pin, RC on RA7/OSC1/CLKI/T1OSI
110 = RCIO oscillator: I/O function on RA6/OSC2/CLKO/T1OSO pin, RC on RA7/OSC1/CLKI/T1OSI
101 = INTOSC oscillator: CLKO function on RA6/OSC2/CLKO/T1OSO pin, I/O function on RA7/OSC1/CLKI/T1OSI
100 = INTOSCIO oscillator: I/O function on RA6/OSC2/CLKO/T1OSO pin, I/O function on RA7/OSC1/CLKI/T1OSI
011 = EC: I/O function on RA6/OSC2/CLKO/T1OSO pin, CLKI on RA7/OSC1/CLKI/T1OSI
010 = HS oscillator: High-speed crystal/resonator on RA6/OSC2/CLKO/T1OSO and RA7/OSC1/CLKI/T1OSI
001 = XT oscillator: Crystal/resonator on RA6/OSC2/CLKO/T1OSO and RA7/OSC1/CLKI/T1OSI
000 = LP oscillator: Low-power crystal on RA6/OSC2/CLKO/T1OSO and RA7/OSC1/CLKI/T1OSI

附加檔案:



jpg  擷取.JPG (83.51 KB)
16_5e16c6a334d5b.jpg 1022X617 px

來自: http://www.microchip.com.tw/newbb/viewtopic.php?forum=1&topic_id=22790&post_id=80207