PIC16C558-20/SO Microchip Technology, PIC16C558-20/SO Datasheet - Page 51
![IC MCU OTP 2KX14 18SOIC](/photos/6/76/67656/150-18-soic_sml.jpg)
PIC16C558-20/SO
Manufacturer Part Number
PIC16C558-20/SO
Description
IC MCU OTP 2KX14 18SOIC
Manufacturer
Microchip Technology
Series
PIC® 16Cr
Specifications of PIC16C558-20/SO
Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Peripherals
POR, WDT
Number Of I /o
13
Program Memory Size
3.5KB (2K x 14)
Program Memory Type
OTP
Ram Size
128 x 8
Voltage - Supply (vcc/vdd)
3 V ~ 5.5 V
Oscillator Type
External
Operating Temperature
0°C ~ 70°C
Package / Case
18-SOIC (7.5mm Width)
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Data Converters
-
Connectivity
-
7.2
When an external clock input is used for Timer0, it must
meet certain requirements. The external clock
requirement is due to internal phase clock (T
synchronization. Also, there is a delay in the actual
incrementing of Timer0 after synchronization.
7.2.1
When no prescaler is used, the external clock input is
the same as the prescaler output. The synchronization
of
accomplished by sampling the prescaler output on the
Q2 and Q4 cycles of the internal phase clocks
(Figure 7-5). Therefore, it is necessary for T0CKI to be
high for at least 2T
and low for at least 2T
20 ns). Refer to the electrical specification of the
desired device.
FIGURE 7-5:
7.3
An 8-bit counter is available as a prescaler for the
Timer0 module, or as a postscaler for the Watchdog
Timer, respectively (Figure 7-6). For simplicity, this
counter is being referred to as “prescaler” throughout
this data sheet.
2002 Microchip Technology Inc.
Note:
T0CKI
Note 1: Delay from clock input change to Timer0 increment is 3 T
External Clock/Prescaler
Output after sampling
External Clock Input or
Prescaler output
Using Timer0 with External Clock
Prescaler
Increment Timer0 (Q4)
There is only one prescaler available
which is mutually exclusive between the
Timer0 module and the Watchdog Timer.
Thus, a prescaler assignment for the
Timer0 module means that there is no
prescaler for the Watchdog Timer, and
vice-versa.
EXTERNAL CLOCK
SYNCHRONIZATION
with
2: External clock if no prescaler selected, prescaler output otherwise.
3: The arrows indicate the points in time where sampling occurs.
Therefore, the error in measuring the interval between two edges on Timer0 input = ±4 T
OSC
the
TIMER0 TIMING WITH EXTERNAL CLOCK
(and a small RC delay of 20 ns)
(2)
OSC
Timer0
internal
(and a small RC delay of
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
(3)
phase
clocks
(1)
OSC
Preliminary
is
T0
)
When a prescaler is used, the external clock input is
divided by the asynchronous ripple-counter type
prescaler so that the prescaler output is symmetrical.
For the external clock to meet the sampling
requirement, the ripple-counter must be taken into
account. Therefore, it is necessary for T0CKI to have a
period of at least 4T
divided by the prescaler value. The only requirement
on T0CKI high and low time is that they do not violate
the minimum pulse width requirement of 10 ns. Refer to
parameters 40, 41 and 42 in the electrical specification
of the desired device.
7.2.2
Since the prescaler output is synchronized with the
internal clocks, there is a small delay from the time the
external clock edge occurs to the time the TMR0 is
actually incremented. Figure 7-5 shows the delay from
the external clock edge to the timer incrementing.
The PSA and PS2:PS0 bits (OPTION<3:0>) determine
the prescaler assignment and prescale ratio.
When assigned to the Timer0 module, all instructions
writing
MOVWF 1, BSF 1,x....etc.) will clear the prescaler.
When assigned to WDT, a CLRWDT instruction will clear
the prescaler along with the Watchdog Timer. The
prescaler is not readable or writable.
OSC
to 7 T
to
T0 + 1
TIMER0 INCREMENT DELAY
OSC
the
. (Duration of Q = T
TMR0
OSC
(and a small RC delay of 40 ns)
PIC16C55X
register
T0 + 2
Small pulse
misses sampling
OSC
OSC
max.
DS40143D-page 49
).
(e.g.,
CLRF 1,