DM164120-1 Microchip Technology, DM164120-1 Datasheet - Page 35

BOARD DEMO PICKIT 2 LP COUNT

DM164120-1

Manufacturer Part Number
DM164120-1
Description
BOARD DEMO PICKIT 2 LP COUNT
Manufacturer
Microchip Technology
Type
MCUr
Datasheet

Specifications of DM164120-1

Contents
3 Boards (1 Populated, 2 Bare)
Processor To Be Evaluated
PIC16F690
Silicon Manufacturer
Microchip
Core Architecture
PIC
Core Sub-architecture
PIC16
Silicon Core Number
PIC16F
Silicon Family Name
PIC16F6xxx
Rohs Compliant
Yes
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With/related Products
28-pin PIC16C, 16F, 18C, 18F
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
DM164120-1
Manufacturer:
Microchip Technology
Quantity:
135
© 2005 Microchip Technology Inc.
3.2.11
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:
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:
Conceptual View
Implementation View
;insert new value into a queue, enter with new value in
;Wreg
MOVF
MOVF
MOVWF FSR
MOVF
MOVWF INDF
Time
Time
n + 1
n + 2
n + 1
n + 2
Newest value inserted here
n
n
temp
QueuePointer,w
temp,w
Lesson 11: Indirect Data Addressing
105
106
107
106
106
110
The rest move down one
MOVING AVERAGES
FILE SELECT REGISTER EXAMPLE
102
105
106
105
105
110
Pointer to oldest value
101
102
105
101
102
103
Older value overwritten, pointer advanced
LPC Demo Board Lessons
;save the latest value
;load FSR with the queue pointer
;Write the latest value to the queue
104
101
102
104
101
Pointer advanced
99
104
101
99
99
99
99
103
104
101
101
101
99
105
103
102
102
102
99
DS51556A-page 31
107
105
103
105
105
105
Average
Average
103
103
104
103
103
104

Related parts for DM164120-1