PIC16F1937-I/ML Microchip Technology, PIC16F1937-I/ML Datasheet - Page 19

IC PIC MCU FLASH 512KX14 44-QFN

PIC16F1937-I/ML

Manufacturer Part Number
PIC16F1937-I/ML
Description
IC PIC MCU FLASH 512KX14 44-QFN
Manufacturer
Microchip Technology
Series
PIC® XLP™ 16Fr

Specifications of PIC16F1937-I/ML

Core Size
8-Bit
Program Memory Size
14KB (8K x 14)
Core Processor
PIC
Speed
32MHz
Connectivity
I²C, LIN, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, LCD, POR, PWM, WDT
Number Of I /o
36
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
512 x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 5.5 V
Data Converters
A/D 14x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
44-QFN
Controller Family/series
PIC16F
No. Of I/o's
36
Eeprom Memory Size
256Byte
Ram Memory Size
512Byte
Cpu Speed
32MHz
No. Of Timers
5
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
There is not such a dramatic speedup in this case but
the clear Carry – shift combination can be eliminated
for a 1 instruction savings. These macros are used 8
times per loop in the main TWIST24 function. That 1
instruction savings does help.
After cleaning up the macros, the next interesting code
section was the setup of the FSR in the TWIST24
function. Each time through the main loop there are 8
tests of bits to determine if the ADD_FSR_FILTER
function should add to the new value or the old value.
This is another very minor change but it is executed
8*UPDATE_COUNT or 256 times. That is a significant
savings.
At the end of the program there is one more code pattern that can be accelerated by the enhanced instruction set.
© 2009 Microchip Technology Inc.
; add one to filter to have proper
; rounding
MOVLW
MOVWF
MOVLW
BTFSC
MOVWF
ADD_FSR_FILTER
MUL_NEWOLD_BY2
MOVLW 0x01
ADDWF NewFilter+2,F
SKPNC
ADDWF NewFilter+1,F
SKPNC
ADDWF NewFilter,F
NewSample+3
FSR
OldFilter+3
FilterWeight,0
FSR
; add it
The switch is performed by changing the address
pointed to by the FSR. This requires a load FSR, test
and reload FSR combination 8 times in the main
function. A faster method is to conditionally execute an
ADDFSR of 4. This will change the FSR to the next value
in one instruction rather than 2. In this example, the
comments
instructions more clear. The comments are left in the
original code.
This change eliminates a part of skip if Carry clear
instructions that implement add with Carry. This
becomes a simple sequence of add with Carry
instructions.
The changes made to this program are very simple;
yet, the effect is a function that runs nearly twice as fast
allowing improved performance or a reduced clock
speed and lower power consumption. The enhanced
PIC12/16 features can result in very high performance
gains for a rather modest effort in porting existing
software.
The complete source to the modified function is
presented in Appendix D: “24-bit 256 Step IIR filter
modified for Enhanced PIC12/16”.
; add one to filter to have proper
; rounding
MOVLW
MOVWF
btfsc
addfsr
ADD_FSR0_FILTER
MUL_NEWOLD_BY2
MOVLW
ADDWF
ADDWFC
ADDWFC
have
0x01
NewFilter+2,F
NewFilter+1,F
NewFilter,F
NewSample+3
FSR0L
FilterWeight,0
.4
been
removed
DS41375A-page 19
to
make
the

Related parts for PIC16F1937-I/ML