| 전자부품 데이터시트 검색엔진 |
|
PIC16F88-I/ML 데이터시트(PDF) 79 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
PIC16F88-I/ML 데이터시트(HTML) 79 Page - Microchip Technology |
|
79 / 214 page ![]() 2003 Microchip Technology Inc. Preliminary DS30487B-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 INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u 0Ch PIR1 — ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF -000 0000 -000 0000 8Ch PIE1 — ADIE 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. |
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 All Rights Reserved©Alldatasheet.com |
| 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 |