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

PIC16F627-20/P 参数 Datasheet PDF下载

PIC16F627-20/P图片预览
型号: PIC16F627-20/P
PDF下载: 下载PDF文件 查看货源
内容描述: 基于闪存的8位CMOS微控制器 [FLASH-Based 8-Bit CMOS Microcontrollers]
分类和应用: 闪存微控制器和处理器外围集成电路光电二极管时钟
文件页数/大小: 160 页 / 1657 K
品牌: MICROCHIP [ MICROCHIP TECHNOLOGY ]
 浏览型号PIC16F627-20/P的Datasheet PDF文件第41页浏览型号PIC16F627-20/P的Datasheet PDF文件第42页浏览型号PIC16F627-20/P的Datasheet PDF文件第43页浏览型号PIC16F627-20/P的Datasheet PDF文件第44页浏览型号PIC16F627-20/P的Datasheet PDF文件第46页浏览型号PIC16F627-20/P的Datasheet PDF文件第47页浏览型号PIC16F627-20/P的Datasheet PDF文件第48页浏览型号PIC16F627-20/P的Datasheet PDF文件第49页  
PIC16F62X
6.0
TIMER0 MODULE
The Timer0 module timer/counter has the following
features:
8-bit timer/counter
Readable and writable
8-bit software programmable prescaler
Internal or external clock select
Interrupt on overflow from FFh to 00h
Edge select for external clock
bit (OPTION<4>). Clearing the T0SE bit selects the
rising edge. Restrictions on the external clock input are
discussed in detail in Section 6.2.
The prescaler is shared between the Timer0 module
and the Watchdog Timer. The prescaler assignment is
controlled in software by the control bit PSA
(OPTION<3>). Clearing the PSA bit will assign the
prescaler to Timer0. The prescaler is not readable or
writable. When the prescaler is assigned to the Timer0
module, prescale value of 1:2, 1:4, ..., 1:256 are
selectable. Section 6.3 details the operation of the
prescaler.
module.
Timer mode is selected by clearing the T0CS bit
(OPTION<5>). In timer mode, the TMR0 will increment
every instruction cycle (without prescaler). If Timer0 is
written, the increment is inhibited for the following two
cycles (Figure 6-2 and Figure 6-3). The user can work
around this by writing an adjusted value to TMR0.
Counter mode is selected by setting the T0CS bit. In
this mode Timer0 will increment either on every rising
or falling edge of pin RA4/T0CKI. The incrementing
edge is determined by the source edge (T0SE) control
6.1
TIMER0 Interrupt
Timer0 interrupt is generated when the TMR0 register
timer/counter overflows from FFh to 00h. This overflow
sets the T0IF bit. The interrupt can be masked by
clearing the T0IE bit (INTCON<5>). The T0IF bit
(INTCON<2>) must be cleared in software by the
Timer0 module interrupt service routine before
re-enabling this interrupt. The Timer0 interrupt cannot
wake the processor from SLEEP since the timer is shut
off during SLEEP. See Figure 6-4 for Timer0 interrupt
timing.
FIGURE 6-1:
RA4/T0CKI
pin
TIMER0 BLOCK DIAGRAM
Data bus
F
OSC
/4
0
1
1
Programmable
Prescaler
0
PSout
Sync with
Internal
clocks
(2 T
CY
delay)
Set Flag bit T0IF
on Overflow
TMR0
PSout
8
T0SE
PS2:PS0
T0CS
Note 1:
2:
PSA
Bits T0SE, T0CS, PS2, PS1, PS0 and PSA are located in the OPTION register.
The prescaler is shared with Watchdog Timer (Figure 6-6)
FIGURE 6-2:
PC
(Program
Counter)
Instruction
Fetch
TIMER0 (TMR0) TIMING: INTERNAL CLOCK/NO PRESCALER
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
PC-1
PC
MOVWF TMR0
PC+1
PC+2
PC+3
PC+4
MOVF TMR0,W
PC+5
MOVF TMR0,W
PC+6
MOVF TMR0,W MOVF TMR0,W MOVF TMR0,W
TMR0
Instruction
Executed
T0
T0+1
T0+2
NT0
NT0+1
NT0+2
T0
Write TMR0
executed
Read TMR0
reads NT0
Read TMR0
reads NT0
Read TMR0
reads NT0
Read TMR0
reads NT0 + 1
Read TMR0
reads NT0 + 2
©
1999 Microchip Technology Inc.
Preliminary
DS40300B-page 45