参数资料
型号: DM164120-1
厂商: Microchip Technology
文件页数: 35/42页
文件大小: 0K
描述: BOARD DEMO PICKIT 2 LP COUNT
标准包装: 1
系列: PICkit™
类型: MCU
适用于相关产品: 28 引脚 PIC16C、16F、18C、18F
所含物品: 3 个板(1 个装有元件的板,2 个裸板)
产品目录页面: 659 (CN2011-ZH PDF)
LPC Demo Board Lessons
3.2.11
Lesson 11: Indirect Data Addressing
The FSR (File Select Register) allows the specifying of a file register address. A
subsequent read or write to the INDF (Indirect File register) refers to the file register
addressed by the FSR.
This may be used to implement a moving average filter. The moving average keeps a
list of the last n values and averages them together. The Filter needs two parts: A
circular queue and a function to calculate the average.
FIGURE 3-11:
Conceptual View
Time
MOVING AVERAGES
Average
n
n+1
n+2
105
106
110
102
105
106
101
102
105
104
101
102
99
104
101
103
99
104
105
103
99
107
105
103
103
103
104
The rest move down one
Newest value inserted here
Implementation View
Time
Average
n
107
105
101
104
99
101
102
105
103
Pointer to oldest value
n+1
106
105
102
101
99
101
102
105
103
Older value overwritten, pointer advanced
n+2
106
110
103 99 99 101 102 105
104
Pointer advanced
Calculating averages in a mid-range PICmicro is best accomplished by using the FSR
to keep track of where the next value will be inserted. This ensures the oldest value is
always overwritten with the newest and doesn’t waste time moving values within the
memory.
EXAMPLE 3-10:
FILE SELECT REGISTER EXAMPLE
;insert new value into a queue, enter with new value in
;Wreg
MOVF
MOVF
MOVWF
MOVF
MOVWF
? 2005 Microchip Technology Inc.
temp
QueuePointer,w
FSR
temp,w
INDF
;save the latest value
;load FSR with the queue pointer
;Write the latest value to the queue
DS51556A-page 31
相关PDF资料
PDF描述
DM164120-3 BOARD DEMO PICKIT2 28-PIN
DM164120-5 BOARD DEMO PICKIT 2 64/80-PIN
DM164123 KIT MANAGEMENT SYSTEM PICDEM
DM180021 KIT STARTER MPLAB FOR PIC18F MCU
DM183022 BOARD DEMO PIC18FXX22 64/80TQFP
相关代理商/技术参数
参数描述
DM164120-1 制造商:Microchip Technology Inc 功能描述:DEVELOPMENT TOOLS - PICKIT 2 LOW PIN COU
DM164120-2 功能描述:开发板和工具包 - PIC / DSPIC PICkit 2 44-Pin Count Demo Brd RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM164120-3 功能描述:开发板和工具包 - PIC / DSPIC PICkit 2 Count Demo Board RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM164120-4 功能描述:开发板和工具包 - PIC / DSPIC PICkit 2 1 Dem Board RoHS:否 制造商:Microchip Technology 产品:Starter Kits 工具用于评估:chipKIT 核心:Uno32 接口类型: 工作电源电压:
DM164120-4 制造商:Microchip Technology Inc 功能描述:PICkit 2 18-Pin Demo Board