Re: 初學者PIC12F629 OSCCAL設定問題請教謝謝!
|
||||
---|---|---|---|---|
新會員
|
找到原因測試時LED電阻太小造成
發表於: 2008/8/29 15:01
|
|||
|
Re: 初學者PIC12F629 OSCCAL設定問題請教謝謝!
|
||||
---|---|---|---|---|
新會員
|
謝謝您指出初始化BANK 的問題
發表於: 2008/8/28 9:52
|
|||
|
Re: 初學者PIC12F629 OSCCAL設定問題請教謝謝!
|
||||
---|---|---|---|---|
資深會員
|
InitPorts
MOVLW 08H ;PA3=INPUT, OTHERS =OUTPUT TRIS GPIO ; ------ XX MOVLW 02H MOVWF PA MOVLW 08H OPTION ; ---------XX RETURN 12F629 不是 低階 PIC 不能如此設定 修改如下 : InitPorts MOVLW .2 MOVWF PA ; GPIO 位於 BANK 0 BSF STATUS , RP0 ; SET TO BANK 1 MOVLW 08H ;PA3=INPUT, OTHERS =OUTPUT MOVWF TRISIO MOVLW 08H MOVWF OPTION_REG BCF STATUS , RP0 ; SET TO BANK 0 RETURN
發表於: 2008/8/28 3:51
|
|||
|
Re: 初學者PIC12F629 OSCCAL設定問題請教謝謝!
|
||||
---|---|---|---|---|
新會員
|
感謝 版主Ryang提供說明
發表於: 2008/8/26 17:28
|
|||
|
Re: 初學者PIC12F629 OSCCAL設定問題請教謝謝!
|
||||
---|---|---|---|---|
版主
|
使用內部 RC 振盪器較正值方式如下:
list p=12f629 ; list directive to define processor
Mid-range 的校正值存在 0x3FF 的位址,裡用 Call 0x3ff取的校正值後存入 OSCCAL 就可以了。 GPIO2 為什麼不同IC輸出頻率不同? ans: 因為頻率沒有校正。
發表於: 2008/8/25 15:36
|
|||
|
初學者PIC12F629 OSCCAL設定問題請教謝謝!
|
||||
---|---|---|---|---|
新會員
|
OSCCAL EQU 090H
GPIO EQU 5 ; PA EQU 5 INPUT EQU 3 ;GPIO 3 IS INPUT ONLY PIN ;========== MAIN PROGRAM ========= ORG 0 MOVWF OSCCAL CALL InitPorts LOOP: BCF PA,2 NOP NOP BSF PA,2 GOTO LOOP InitPorts MOVLW 08H ;PA3=INPUT, OTHERS =OUTPUT TRIS GPIO ; MOVLW 02H MOVWF PA MOVLW 08H OPTION ; RETURN END GPIO2 為什麼不同IC輸出頻率不同? OSCCAL 如何設定內部4MHZ ?
發表於: 2008/8/25 15:16
|
|||
|