PIC16F76-E/SS Microchip Technology, PIC16F76-E/SS Datasheet - Page 51

IC MCU FLASH 8KX14 A/D 28SSOP

PIC16F76-E/SS

Manufacturer Part Number
PIC16F76-E/SS
Description
IC MCU FLASH 8KX14 A/D 28SSOP
Manufacturer
Microchip Technology
Series
PIC® 16Fr

Specifications of PIC16F76-E/SS

Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
22
Program Memory Size
14KB (8K x 14)
Program Memory Type
FLASH
Ram Size
368 x 8
Voltage - Supply (vcc/vdd)
4 V ~ 5.5 V
Data Converters
A/D 5x8b
Oscillator Type
External
Operating Temperature
-40°C ~ 125°C
Package / Case
28-SSOP
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Other names
PIC16F76E/SS
6.4
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, which will wake-up
the processor. However, special precautions in soft-
ware are needed to read/write the timer (Section 6.4.1).
In Asynchronous Counter mode, Timer1 cannot be
used as a time-base for capture or compare operations.
EXAMPLE 6-1:
EXAMPLE 6-2:
 2002 Microchip Technology Inc.
; 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
; All interrupts are disabled
CLRF
MOVLW
MOVWF
MOVLW
MOVWF
; Re-enable the Interrupt (if required)
CONTINUE
Timer1 Operation in
Asynchronous Counter Mode
TMR1H, W
TMPH
TMR1L, W
TMPL
TMR1H, W
TMPH,
STATUS,Z
CONTINUE
TMR1H, W
TMPH
TMR1L, W
TMPL
TMR1L
HI_BYTE
TMR1H, F
LO_BYTE
TMR1H, F
W
WRITING A 16-BIT FREE-RUNNING TIMER
READING A 16-BIT FREE-RUNNING TIMER
; 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
; 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
6.4.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 6-2 demonstrates how to write to and read
Timer1 while it is running in Asynchronous mode.
code
READING AND WRITING TIMER1 IN
ASYNCHRONOUS COUNTER MODE
provided
PIC16F7X
in
Example 6-1
DS30325B-page 49
and

Related parts for PIC16F76-E/SS