PIC16F1934-E/MV Microchip Technology, PIC16F1934-E/MV Datasheet - Page 13

7KB Flash, 256B RAM, 256B EEPROM, LCD, 1.8-5.5V 40 UQFN 5x5x0.5mm TUBE

PIC16F1934-E/MV

Manufacturer Part Number
PIC16F1934-E/MV
Description
7KB Flash, 256B RAM, 256B EEPROM, LCD, 1.8-5.5V 40 UQFN 5x5x0.5mm TUBE
Manufacturer
Microchip Technology
Series
PIC® XLP™ 16Fr

Specifications of PIC16F1934-E/MV

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
Program Memory Size
7KB (4K x 14)
Program Memory Type
FLASH
Eeprom Size
256 x 8
Ram Size
256 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
Package / Case
40-UFQFN Exposed Pad
Processor Series
PIC16F
Core
PIC
Data Ram Size
256 B
Interface Type
MI2C, SPI, EUSART
Number Of Timers
5
Operating Supply Voltage
1.8 V to 5.5 V
Maximum Operating Temperature
+ 125 C
Mounting Style
SMD/SMT
Development Tools By Supplier
MPLAB IDE Software
Minimum Operating Temperature
- 40 C
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Lead Free Status / RoHS Status
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

Related parts for PIC16F1934-E/MV