欢迎访问ic37.com |
会员登录 免费注册
发布采购

PIC16F628-04/SS 参数 Datasheet PDF下载

PIC16F628-04/SS图片预览
型号: PIC16F628-04/SS
PDF下载: 下载PDF文件 查看货源
内容描述: 基于闪存的8位CMOS微控制器 [FLASH-Based 8-Bit CMOS Microcontrollers]
分类和应用: 闪存微控制器
文件页数/大小: 160 页 / 1657 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC16F628-04/SS的Datasheet PDF文件第45页浏览型号PIC16F628-04/SS的Datasheet PDF文件第46页浏览型号PIC16F628-04/SS的Datasheet PDF文件第47页浏览型号PIC16F628-04/SS的Datasheet PDF文件第48页浏览型号PIC16F628-04/SS的Datasheet PDF文件第50页浏览型号PIC16F628-04/SS的Datasheet PDF文件第51页浏览型号PIC16F628-04/SS的Datasheet PDF文件第52页浏览型号PIC16F628-04/SS的Datasheet PDF文件第53页  
PIC16F62X  
6.3.1  
SWITCHING PRESCALER ASSIGNMENT  
To change prescaler from the WDT to the TMR0  
module use the sequence shown in Example 6-2. This  
precaution must be taken even if the WDT is disabled.  
The prescaler assignment is fully under software  
control (i.e., it can be changed “on the fly” during  
program execution). To avoid an unintended device  
EXAMPLE 6-2: CHANGING PRESCALER  
RESET,  
the  
following  
instruction  
sequence  
(WDTTIMER0)  
(Example 6-1) must be executed when changing the  
prescaler assignment from Timer0 to WDT.  
CLRWDT  
;Clear WDT and  
;prescaler  
EXAMPLE 6-1: CHANGING PRESCALER  
BSF  
STATUS, RP0  
(TIMER0WDT)  
STATUS, RP0 ;Skip if already in  
MOVLW  
b'xxxx0xxx' ;Select TMR0, new  
;prescale value and  
;clock source  
1.BCF  
; Bank 0  
2.CLRWDT  
3.CLRF  
4.BSF  
;Clear WDT  
;Clear TMR0 & Prescaler  
STATUS, RP0 ;Bank 1  
MOVWF  
BCF  
OPTION_REG  
STATUS, RP0  
TMR0  
5.MOVLW '00101111’b ;These 3 lines (5, 6, 7)  
6.MOVWF OPTION  
; are required only if  
; desired PS<2:0> are  
; 000 or 001  
7.CLRWDT  
8.MOVLW '00101xxx’b ;Set Postscaler to  
9.MOVWF OPTION ; desired WDT rate  
10.BCF STATUS, RP0 ;Return to Bank 0  
TABLE 6-1:  
REGISTERS ASSOCIATED WITH TIMER0  
Value on  
Value on  
POR  
Address  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
All Other  
Resets  
01h  
TMR0  
Timer0 module register  
GIE T0IE  
xxxx xxxx uuuu uuuu  
0000 000x 0000 000u  
1111 1111 1111 1111  
0Bh/8Bh/  
10Bh/18Bh  
INTCON  
INTE  
T0SE  
RBIE  
PSA  
T0IF  
PS2  
INTF  
PS1  
RBIF  
PS0  
81h  
85h  
OPTION RBPU INTEDG T0CS  
TRISA TRISA7 TRISA6  
TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 11-1 1111 11-1 1111  
Legend: — = Unimplemented locations, read as ‘0’, u = unchanged, x = unknown  
Note: Shaded bits are not used by TMR0 module.  
1999 Microchip Technology Inc.  
Preliminary  
DS40300B-page 49  
 
 
 复制成功!