PIC16F1937-E/ML Microchip Technology, PIC16F1937-E/ML Datasheet - Page 13
![IC PIC MCU FLASH 512KX14 44-QFN](/photos/6/81/68122/150-44-qfn_sml.jpg)
PIC16F1937-E/ML
Manufacturer Part Number
PIC16F1937-E/ML
Description
IC PIC MCU FLASH 512KX14 44-QFN
Manufacturer
Microchip Technology
Series
PIC® XLP™ 16Fr
Datasheets
1.PIC16F722-ISS.pdf
(8 pages)
2.PIC16LF1933-ISS.pdf
(508 pages)
3.PIC16LF1933-ISS.pdf
(46 pages)
4.PIC16F1936-ISS.pdf
(2 pages)
5.PIC16F1936-ISS.pdf
(10 pages)
6.PIC16F1936-ISS.pdf
(40 pages)
7.PIC16F1936-ISS.pdf
(30 pages)
8.PIC16F1936-ISS.pdf
(12 pages)
9.PIC16LF1934-IML.pdf
(418 pages)
Specifications of PIC16F1937-E/ML
Program Memory Type
FLASH
Program Memory Size
14KB (8K x 14)
Package / Case
44-QFN
Core Processor
PIC
Core Size
8-Bit
Speed
32MHz
Connectivity
I²C, LIN, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, LCD, POR, PWM, WDT
Number Of I /o
36
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 ~ 125°C
Processor Series
PIC16F
Core
PIC
Data Bus Width
8 bit
Data Ram Size
512 B
Interface Type
EUSART/MI2C/SPI
Maximum Clock Frequency
32 MHz
Number Of Programmable I/os
36
Number Of Timers
5
Maximum Operating Temperature
+ 125 C
Mounting Style
SMD/SMT
3rd Party Development Tools
52715-96, 52716-328, 52717-734
Development Tools By Supplier
PG164130, DV164035, DV244005, DV164005
Minimum Operating Temperature
- 40 C
On-chip Adc
14-ch x 10-bit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Lead free / RoHS Compliant
ARITHMETIC
Arithmetic on the PIC12/16 is a very basic function but
can be full of small frustrations when working with
multi-byte data. For example, the legacy ADD
instructions do not include an add with Carry, so multi-
byte operations require additional instructions to
precondition the next Most Significant Byte (MSB)
based upon the results of the previous add. New
instructions added to the enhanced PIC12/16 simplify
this work, shaving many instructions from common
algorithms.
Multi-byte Add
Adding two 16-bit values with a PIC12/16 is usually
done as follows:
This code works quite well but has 2 extra cycles in the
middle, due to the missing add with Carry. This code
can be converted to the enhanced PIC12/16 as follows:
The enhanced version saves two instructions. If 16-bit
values are used extensively, the savings will add up.
Multi-byte Subtract
Subtract is similar to add because the Borrow flag must
be handled in the following computations. The legacy
code is as follows:
© 2009 Microchip Technology Inc.
Add16_enhanced
Add16
Sub16
ADDWF
MOVF
ADDWF
MOVF
BTFSC
ADDLW
SUBWF msb_b,f
MOVF
ADDWF
MOVF
ADDWFC
MOVF
SUBWF lsb_b,f
MOVF
BTFSS STATUS,C
ADDLW 0xFF
lsb_a,w
msb_a,w
msb_b,f
msb_b,f
lsb_a,w
lsb_b,f
msb_a,w
lsb_a,w
lsb_b,f
msb_a,w
STATUS,C
0x01
The enhanced version is as follows:
The enhanced version of subtract saves two
instructions.
Shifting
Shifting is the fastest method to divide or multiply by a
power of two, therefore, it is often used instead of
rotates. A rotate instruction can be made to operate like
a shift simply be preconditioning the Carry flag. The
legacy code is as follows:
This code will work but the W register is overwritten by
the first rotate. The ASRF instruction simplifies this
problem by handling the sign extension in hardware.
This is faster by requiring less code. Arithmetic
_Left_Shift does not need to perform a sign exten-
sion. It simply brings zero into the LSB.
If sign extend is not required, the code is simpler.
Simply clearing the Carry flag before performing the
rotate will create a logical shift. These examples can be
converted to single enhanced PIC12/16 instructions.
Logical_Right_Shift
Logical_Left_Shift
Sub16_enhanced
Arithmetic_Right_Shift
RRF
ASRF val,f
RLF
BCF
RRF
BCF
MOVF
SUBWF lsb_b,f
MOVF
SUBWFB msb_b,f
RLF
val,w ;save the MSB
val,f ;rotate right
val,f
STATUS,C
val,f
STATUS,C
lsb_a,w
msb_a,w
in the Carry
(corrupt W
with sign extend.
DS41375A-page 13