Electronic Components Datasheet Search
  English  ▼

X  

PIC16C781 Datasheet(PDF) 53 Page - Microchip Technology

Part # PIC16C781
Description  8-Bit CMOS Microcontrollers with A/D, D/A, OPAMP, Comparators and PSMC
PDF  186 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC16C781 Datasheet(HTML) 53 Page - Microchip Technology

Back Button PIC16C781 Datasheet HTML 49Page - Microchip Technology PIC16C781 Datasheet HTML 50Page - Microchip Technology PIC16C781 Datasheet HTML 51Page - Microchip Technology PIC16C781 Datasheet HTML 52Page - Microchip Technology PIC16C781 Datasheet HTML 53Page - Microchip Technology PIC16C781 Datasheet HTML 54Page - Microchip Technology PIC16C781 Datasheet HTML 55Page - Microchip Technology PIC16C781 Datasheet HTML 56Page - Microchip Technology PIC16C781 Datasheet HTML 57Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 53 / 186 page
background image
 2001 Microchip Technology Inc.
Preliminary
DS41171A-page 51
PIC16C781/782
5.0
TIMER0 MODULE
The Timer0 module timer/counter has the following
features:
• 8-bit timer/counter
• Readable and writable
• Internal or external clock select
• Edge select for external clock
• 8-bit software programmable prescaler
• Interrupt on overflow from FFh to 00h
Figure 5-1 is a simplified block diagram of the Timer0
module.
Additional information on timer modules is available in
the
PICmicro™
Mid-Range
Reference
Manual,
(DS33023).
5.1
Timer0 Operation
Timer0 can operate as either a timer or a counter.
Programming Timer0 is via the OPTION register (see
Register 2-2).
Timer0 mode is selected by clearing/setting the bit
T0CS (OPTION_REG<5>). In Timer mode (T0CS = 0),
the Timer0 module increments every instruction cycle
(without prescaler). If the TMR0 register is written, the
increment is inhibited for the following two instruction
cycles. The user can work around this by writing an
adjusted value to the TMR0 register.
Counter mode is selected by setting bit T0CS
(OPTION_REG<5>).
In
Counter
mode,
Timer0
increments either on every rising, or falling edge of pin
RA4/T0CKI. The incrementing edge is determined by
the
Timer0
Source
Edge
Select
bit
T0SE
(OPTION_REG<4>). Clearing bit T0SE selects the ris-
ing edge, setting selects the falling edge. Restrictions
on the external clock input are discussed below.
When an external clock input is used for Timer0, it must
meet certain requirements. The requirements ensure
the external clock can be synchronized with the internal
system clock. Also, there is a delay in the actual incre-
menting of Timer0 after synchronization.
Additional information on external clock requirements
is available in the PICmicro™ Mid-Range Reference
Manual, (DS33023).
EXAMPLE 5-1:
INITIALIZING TIMER0
;* This code block will configure Timer0
;* for Polling, internal clock & 1:16
;*
prescaler
;*
;* Wait for TMR0 overflow code included
BANKSEL
TMR0
; Select Bank 0
CLRF
TMR0
; Clear Timer0
; Register
BANKSEL
OPTION_REG
; Select Bank 1
MOVLW
B’11000011’
; INT on L2H
MOVWF
OPTION_REG
; Internal clk,
; pscaler 1:16
********************************************
;*
Wait for TMR0 overflow
;*
T0_OVFL_WAIT
TBFSS
INTCON,T0IF
; Check for TMR0
; overflow
GOTO
T0_OVFL_WAIT
; If clear, test
; again
BCF
INTCON,T0IF
; Clear interrupt
FIGURE 5-1:
TIMER0 BLOCK DIAGRAM
Note
1:
T0CS, T0SE, PSA, PS<2:0> (OPTION_REG<5:0>).
2: The prescaler is shared with Watchdog Timer (refer to Figure 5-2 for detailed block diagram).
RA4/T0CKI
T0SE
0
1
1
0
pin
T0CS
FOSC/4
Programmable
Prescaler
Sync with
Internal
Clocks
TMR0
PSOUT
(2 TCY Delay)
PSOUT
Data Bus
8
PSA
PS<2:0>
Set Interrupt
Flag bit T0IF
on Overflow
3



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com