Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

PIC16F87 Datasheet(PDF) 77 Page - Microchip Technology

Part # PIC16F87
Description  18/20/28-Pin Enhanced Flash MCUs with nanoWatt Technology
PDF  230 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC16F87 Datasheet(HTML) 77 Page - Microchip Technology

Back Button PIC16F87 Datasheet HTML 73Page - Microchip Technology PIC16F87 Datasheet HTML 74Page - Microchip Technology PIC16F87 Datasheet HTML 75Page - Microchip Technology PIC16F87 Datasheet HTML 76Page - Microchip Technology PIC16F87 Datasheet HTML 77Page - Microchip Technology PIC16F87 Datasheet HTML 78Page - Microchip Technology PIC16F87 Datasheet HTML 79Page - Microchip Technology PIC16F87 Datasheet HTML 80Page - Microchip Technology PIC16F87 Datasheet HTML 81Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 77 / 230 page
background image
 2002-2013 Microchip Technology Inc.
DS30487D-page 77
PIC16F87/88
EXAMPLE 7-3:
IMPLEMENTING A REAL-TIME CLOCK USING A TIMER1 INTERRUPT SERVICE
TABLE 7-2:
REGISTERS ASSOCIATED WITH TIMER1 AS A TIMER/COUNTER
RTCinit
BANKSEL
TMR1H
MOVLW
0x80
; Preload TMR1 register pair
MOVWF
TMR1H
; for 1 second overflow
CLRF
TMR1L
MOVLW
b’00001111’
; Configure for external clock,
MOVWF
T1CON
; Asynchronous operation, external oscillator
CLRF
secs
; Initialize timekeeping registers
CLRF
mins
MOVLW
.12
MOVWF
hours
BANKSEL
PIE1
BSF
PIE1, TMR1IE
; Enable Timer1 interrupt
RETURN
RTCisr
BANKSEL
TMR1H
BSF
TMR1H, 7
; Preload for 1 sec overflow
BCF
PIR1, TMR1IF
; Clear interrupt flag
INCF
secs, F
; Increment seconds
MOVF
secs, w
SUBLW
.60
BTFSS
STATUS, Z
; 60 seconds elapsed?
RETURN
; No, done
CLRF
seconds
; Clear seconds
INCF
mins, f
; Increment minutes
MOVF
mins, w
SUBLW
.60
BTFSS
STATUS, Z
; 60 seconds elapsed?
RETURN
; No, done
CLRF
mins
; Clear minutes
INCF
hours, f
; Increment hours
MOVF
hours, w
SUBLW
.24
BTFSS
STATUS, Z
; 24 hours elapsed?
RETURN
; No, done
CLRF
hours
; Clear hours
RETURN
; Done
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on
all other
Resets
0Bh, 8Bh,
10Bh, 18Bh
INTCON
GIE
PEIE
TMR0IE
INT0IE
RBIE
TMR0IF
INT0IF
RBIF
0000 000x 0000 000u
0Ch
PIR1
—
ADIF(1)
RCIF
TXIF
SSPIF
CCP1IF
TMR2IF
TMR1IF -000 0000 -000 0000
8Ch
PIE1
—
ADIE(1)
RCIE
TXIE
SSPIE
CCP1IE
TMR2IE
TMR1IE -000 0000 -000 0000
0Eh
TMR1L
Holding Register for the Least Significant Byte of the 16-bit TMR1 Register
xxxx xxxx uuuu uuuu
0Fh
TMR1H
Holding Register for the Most Significant Byte of the 16-bit TMR1 Register
xxxx xxxx uuuu uuuu
10h
T1CON
—
T1RUN T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON -000 0000 -uuu uuuu
Legend:
x
= unknown, u = unchanged, - = unimplemented, read as ‘0’. Shaded cells are not used by the Timer1 module.
Note
1:
This bit is only implemented on the PIC16F88. The bit will read ‘0’ on the PIC16F87.



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