PIC16F88-I/SO Microchip Technology Inc., PIC16F88-I/SO Datasheet - Page 76

no-image

PIC16F88-I/SO

Manufacturer Part Number
PIC16F88-I/SO
Description
18 PIN, 7 KB FLASH, 368 RAM, 16 I/O
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC16F88-I/SO

A/d Inputs
7-Channel, 10-Bit
Comparators
2
Cpu Speed
5 MIPS
Eeprom Memory
256 Bytes
Input Output
16
Interface
I2C/SPI/USART
Memory Type
Flash
Number Of Bits
8
Package Type
18-pin SOIC
Programmable Memory
7K Bytes
Ram Size
368 Bytes
Speed
20 MHz
Timers
2-8-bit, 1-16-bit
Voltage, Range
2-5.5 V
Lead Free Status / Rohs Status
RoHS Compliant part Electrostatic Device

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F88-I/SO
Manufacturer:
ROHM
Quantity:
15 000
Part Number:
PIC16F88-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC16F88-I/SO
0
PIC16F87/88
7.5
If control bit T1SYNC (T1CON<2>) is set, the external
clock input is not synchronized. The timer continues to
increment asynchronous to the internal phase clocks.
The timer will continue to run during Sleep and can
generate an interrupt-on-overflow that will wake-up the
processor. However, special precautions in software
are needed to read/write the timer (see Section 7.5.1
“Reading and Writing Timer1 in Asynchronous
Counter Mode”).
In Asynchronous Counter mode, Timer1 cannot be
used as a time base for capture or compare operations.
EXAMPLE 7-1:
EXAMPLE 7-2:
DS30487C-page 74
; All interrupts are disabled
CLRF
MOVLW
MOVWF
MOVLW
MOVWF
; Re-enable the Interrupt (if required)
CONTINUE
; All interrupts are disabled
MOVF
MOVWF
MOVF
MOVWF
MOVF
SUBWF
BTFSC
GOTO
; TMR1L may have rolled over between the read of the high and low bytes.
; Reading the high and low bytes now will read a good value.
MOVF
MOVWF
MOVF
MOVWF
CONTINUE
Timer1 Operation in
Asynchronous Counter Mode
TMR1L
HI_BYTE
TMR1H, F
LO_BYTE
TMR1H, F
TMR1H, W
TMPH
TMR1L, W
TMPL
TMR1H, W
TMPH, W
STATUS, Z
CONTINUE
TMR1H, W
TMPH
TMR1L, W
TMPL
WRITING A 16-BIT FREE RUNNING TIMER
READING A 16-BIT FREE RUNNING TIMER
; Clear Low byte, Ensures no rollover into TMR1H
; Value to load into TMR1H
; Write High byte
; Value to load into TMR1L
; Write Low byte
; Continue with your code
; Read high byte
; Read low byte
; Read high byte
; Sub 1st read with 2nd read
; Is result = 0
; Good 16-bit read
; Read high byte
; Read low byte
; Re-enable the Interrupt (if required)
; Continue with your code
7.5.1
Reading TMR1H or TMR1L while the timer is running
from an external asynchronous clock will ensure a valid
read (taken care of in hardware). However, the user
should keep in mind that reading the 16-bit timer in two
8-bit values itself, poses certain problems, since the
timer may overflow between the reads.
For writes, it is recommended that the user simply stop
the timer and write the desired values. A write conten-
tion may occur by writing to the timer registers while the
register is incrementing. This may produce an
unpredictable value in the timer register.
Reading the 16-bit value requires some care. The
example
Example 7-2 demonstrate how to write to and read
Timer1 while it is running in Asynchronous mode.
codes
READING AND WRITING TIMER1 IN
ASYNCHRONOUS COUNTER
MODE
provided
 2005 Microchip Technology Inc.
in
Example 7-1
and

Related parts for PIC16F88-I/SO