欢迎访问ic37.com |
会员登录 免费注册
发布采购

PIC18F8620-I/PT 参数 Datasheet PDF下载

PIC18F8620-I/PT图片预览
型号: PIC18F8620-I/PT
PDF下载: 下载PDF文件 查看货源
内容描述: 八十〇分之六十四引脚高性能1 Mbit的增强型闪存微控制器与A / D [64/80-Pin High Performance 1 Mbit Enhanced FLASH Microcontrollers with A/D]
分类和应用: 闪存微控制器和处理器外围集成电路PC时钟
文件页数/大小: 366 页 / 6797 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC18F8620-I/PT的Datasheet PDF文件第137页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第138页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第139页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第140页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第142页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第143页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第144页浏览型号PIC18F8620-I/PT的Datasheet PDF文件第145页  
PIC18FXX20  
EXAMPLE 12-1:  
IMPLEMENTING A REAL-TIME CLOCK USING A TIMER1 INTERRUPT SERVICE  
RTCinit  
movlw  
movwf  
clrf  
0x80  
TMR1H  
TMR1L  
; Preload TMR1 register pair  
; for 1 second overflow  
movlw  
movwf  
clrf  
b’00001111’  
T1OSC  
secs  
; Configure for external clock,  
; Asynchronous operation, external oscillator  
; Initialize timekeeping registers  
;
clrf  
mins  
movlw  
movwf  
bsf  
.12  
hours  
PIE1, TMR1IE  
; Enable Timer1 interrupt  
return  
RTCisr  
bsf  
bcf  
incf  
movlw  
TMR1H,7  
PIR1,TMR1IF  
secs,F  
; Preload for 1 sec overflow  
; Clear interrupt flag  
; Increment seconds  
.59  
; 60 seconds elapsed?  
cpfsgt secs  
return  
; No, done  
clrf  
incf  
movlw  
secs  
mins,F  
.59  
; Clear seconds  
; Increment minutes  
; 60 minutes elapsed?  
cpfsgt mins  
return  
; No, done  
clrf  
incf  
movlw  
mins  
hours,F  
.23  
; clear minutes  
; Increment hours  
; 24 hours elapsed?  
cpfsgt hours  
return  
; No, done  
movlw  
movwf  
return  
.01  
hours  
; Reset hours to 1  
; Done  
TABLE 12-2: REGISTERS ASSOCIATED WITH TIMER1 AS A TIMER/COUNTER  
Value on  
all other  
RESETS  
Value on  
Name  
Bit 7  
Bit 6  
Bit 5  
Bit 4  
Bit 3  
Bit 2  
Bit 1  
Bit 0  
POR, BOR  
INTCON GIE/GIEH PEIE/GIEL TMR0IE  
INT0IE  
TXIF  
TXIE  
TXIP  
RBIE  
SSPIF  
SSPIE  
SSPIP  
TMR0IF  
INT0IF  
RBIF  
0000 0000 0000 0000  
PIR1  
PSPIF  
PSPIE  
PSPIP  
ADIF  
ADIE  
ADIP  
RCIF  
RCIE  
RCIP  
CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000  
CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000  
CCP1IP TMR2IP TMR1IP 0111 1111 0111 1111  
PIE1  
IPR1  
TMR1L  
Holding Register for the Least Significant Byte of the 16-bit TMR1 Register  
xxxx xxxx uuuu uuuu  
TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Register  
T1CON RD16  
Legend: x= unknown, u= unchanged, - = unimplemented, read as '0'. Shaded cells are not used by the Timer1 module.  
xxxx xxxx uuuu uuuu  
T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON 0-00 0000 u-uu uuuu  
2003 Microchip Technology Inc.  
Advance Information  
DS39609A-page 139  
 复制成功!