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

PIC17C752T-25I/P 参数 Datasheet PDF下载

PIC17C752T-25I/P图片预览
型号: PIC17C752T-25I/P
PDF下载: 下载PDF文件 查看货源
内容描述: 高性能8位CMOS微控制器的EPROM [High-Performance 8-Bit CMOS EPROM Microcontrollers]
分类和应用: 微控制器可编程只读存储器电动程控只读存储器
文件页数/大小: 320 页 / 2172 K
品牌: MICROCHIP [ MICROCHIP ]
 浏览型号PIC17C752T-25I/P的Datasheet PDF文件第85页浏览型号PIC17C752T-25I/P的Datasheet PDF文件第86页浏览型号PIC17C752T-25I/P的Datasheet PDF文件第87页浏览型号PIC17C752T-25I/P的Datasheet PDF文件第88页浏览型号PIC17C752T-25I/P的Datasheet PDF文件第90页浏览型号PIC17C752T-25I/P的Datasheet PDF文件第91页浏览型号PIC17C752T-25I/P的Datasheet PDF文件第92页浏览型号PIC17C752T-25I/P的Datasheet PDF文件第93页  
PIC17C75X  
12.3.2 WRITING A 16-BIT VALUE TO TMR0  
12.3  
Read/Write Consideration for TMR0  
Since writing to either TMR0L or TMR0H will effectively  
inhibit increment of that half of the TMR0 in the next  
cycle (following write), but not inhibit increment of the  
other half, the user must write to TMR0L first and  
TMR0H second in two consecutive instructions, as  
shown in Example 12-2. The interrupt must be dis-  
abled. Any write to either TMR0L or TMR0H clears the  
prescaler.  
Although TMR0 is a 16-bit timer/counter, only 8-bits at  
a time can be read or written during a single instruction  
cycle. Care must be taken during any read or write.  
12.3.1 READING 16-BIT VALUE  
The problem in reading the entire 16-bit value is that  
after reading the low (or high) byte, its value may  
change from FFh to 00h.  
EXAMPLE 12-2: 16-BIT WRITE  
Example 12-1 shows a 16-bit read. To ensure a proper  
read, interrupts must be disabled during this routine.  
BSF  
CPUSTA, GLINTD ; Disable interrupts  
MOVFP  
MOVFP  
BCF  
RAM_L, TMR0L  
RAM_H, TMR0H  
CPUSTA, GLINTD ; Done, enable  
interrupts  
;
;
EXAMPLE 12-1: 16-BIT READ  
MOVPF  
MOVPF  
MOVFP  
TMR0L, TMPLO  
TMR0H, TMPHI  
TMPLO, WREG  
;read low tmr0  
;read high tmr0  
;tmplo −> wreg  
;tmr0l < wreg?  
;no then return  
;read low tmr0  
;read high tmr0  
;return  
;
CPFSLT TMR0L  
RETURN  
12.4  
Prescaler Assignments  
MOVPF  
MOVPF  
RETURN  
TMR0L, TMPLO  
TMR0H, TMPHI  
Timer0 has an 8-bit prescaler. The prescaler assign-  
ment is fully under software control; i.e., it can be  
changed “on the fly” during program execution. When  
changing the prescaler assignment, clearing the pres-  
caler is recommended before changing assignment.  
The value of the prescaler is “unknown,and assigning  
a value that is less then the present value makes it dif-  
ficult to take this unknown time into account.  
FIGURE 12-4: TMR0 TIMING: WRITE HIGH OR LOW BYTE  
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4  
AD15:AD0  
ALE  
PC+1  
PC+2  
PC+3  
PC+4  
PC  
T0  
T0+1  
New T0 (NT0)  
New T0+1  
TMR0L  
Fetch  
MOVFP W,TMR0L MOVFP TMR0L,W MOVFP TMR0L,W MOVFP TMR0L,W  
Instruction  
executed  
Write to TMR0L  
Read TMR0L  
(Value = NT0)  
Read TMR0L  
(Value = NT0)  
Read TMR0L  
(Value = NT0 +1)  
TMR0H  
1997 Microchip Technology Inc.  
Preliminary  
DS30264A-page 89  
 
 
 复制成功!