参数资料
型号: PIC17CXX
厂商: Microchip Technology Inc.
英文描述: EPROM Memory Programming Specification
中文描述: EPROM存储器编程规范
文件页数: 66/71页
文件大小: 1173K
代理商: PIC17CXX
1996 Microchip Technology Inc.
DS30412C-page 69
PIC17C4X
11.3
Read/Write Consideration for TMR0
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.
11.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 11-1 shows a 16-bit read. To ensure a proper
read, interrupts must be disabled during this routine.
EXAMPLE 11-1: 16-BIT READ
MOVPF
TMR0L, TMPLO
;read low tmr0
MOVPF
TMR0H, TMPHI
;read high tmr0
MOVFP
TMPLO, WREG
;tmplo
> wreg
CPFSLT
TMR0L
;tmr0l < wreg?
RETURN
;no then return
MOVPF
TMR0L, TMPLO
;read low tmr0
MOVPF
TMR0H, TMPHI
;read high tmr0
RETURN
;return
11.3.2
WRITING A 16-BIT VALUE TO 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 rst and
TMR0H next in two consecutive instructions, as shown
in Example 11-2. The interrupt must be disabled. Any
write to either TMR0L or TMR0H clears the prescaler.
EXAMPLE 11-2: 16-BIT WRITE
BSF
CPUSTA, GLINTD ; Disable interrupt
MOVFP RAM_L, TMR0L
;
MOVFP RAM_H, TMR0H
;
BCF
CPUSTA, GLINTD ; Done, enable interrupt
11.4
Prescaler Assignments
Timer0 has an 8-bit prescaler. The prescaler assign-
ment is fully under software control; i.e., it can be
changed “on the y” 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-
cult to take this unknown time into account.
FIGURE 11-4: TMR0 TIMING: WRITE HIGH OR LOW BYTE
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
AD15:AD0
ALE
TMR0L
TMR0H
MOVFP W,TMR0L
Write to TMR0L
MOVFP TMR0L,W
Read TMR0L
(Value = NT0)
MOVFP TMR0L,W
Read TMR0L
(Value = NT0)
MOVFP TMR0L,W
Read TMR0L
(Value = NT0 +1)
T0
T0+1
New T0 (NT0)
New T0+1
PC
PC+1
PC+2
PC+3
PC+4
Fetch
Instruction
executed
相关PDF资料
PDF描述
PALCE16V8Z-25JC EE CMOS Zero-Power 20-Pin Universal Programmable Array Logic
PALCE16V8Z-25JI EE CMOS Zero-Power 20-Pin Universal Programmable Array Logic
PALCE16V8Z-25PC EE CMOS Zero-Power 20-Pin Universal Programmable Array Logic
PALCE16V8Z-25PI EE CMOS Zero-Power 20-Pin Universal Programmable Array Logic
PALCE16V8Z-25SC EE CMOS Zero-Power 20-Pin Universal Programmable Array Logic
相关代理商/技术参数
参数描述
PIC17LC42A-08/L 功能描述:8位微控制器 -MCU 4KB 232 RAM 33 I/O RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
PIC17LC42A-08/P 功能描述:8位微控制器 -MCU 4KB 232 RAM 33 I/O RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
PIC17LC42A-08/PQ 功能描述:8位微控制器 -MCU 4KB 232 RAM 33 I/O RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
PIC17LC42A-08/PT 功能描述:8位微控制器 -MCU 4KB 232 RAM 33 I/O RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT
PIC17LC42A-08I/L 功能描述:8位微控制器 -MCU 4KB 232 RAM 33 I/O RoHS:否 制造商:Silicon Labs 核心:8051 处理器系列:C8051F39x 数据总线宽度:8 bit 最大时钟频率:50 MHz 程序存储器大小:16 KB 数据 RAM 大小:1 KB 片上 ADC:Yes 工作电源电压:1.8 V to 3.6 V 工作温度范围:- 40 C to + 105 C 封装 / 箱体:QFN-20 安装风格:SMD/SMT