PIC16F628AT-E/SS Microchip Technology, PIC16F628AT-E/SS Datasheet - Page 129

IC,MICROCONTROLLER,8-BIT,PIC CPU,CMOS,SSOP,20PIN,PLASTIC

PIC16F628AT-E/SS

Manufacturer Part Number
PIC16F628AT-E/SS
Description
IC,MICROCONTROLLER,8-BIT,PIC CPU,CMOS,SSOP,20PIN,PLASTIC
Manufacturer
Microchip Technology
Series
PIC® 16Fr
Datasheets

Specifications of PIC16F628AT-E/SS

Rohs Compliant
YES
Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Connectivity
UART/USART
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
16
Program Memory Size
3.5KB (2K x 14)
Program Memory Type
FLASH
Eeprom Size
128 x 8
Ram Size
224 x 8
Voltage - Supply (vcc/vdd)
3 V ~ 5.5 V
Oscillator Type
Internal
Operating Temperature
-40°C ~ 125°C
Package / Case
20-SSOP
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
I3DBF648 - BOARD DAUGHTER ICEPIC3AC162053 - HEADER INTERFACE ICD,ICD2 18DIP
Data Converters
-
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
© 2009 Microchip Technology Inc.
SUBWF
Syntax:
Operands:
Operation:
Status
Affected:
Encoding:
Description:
Words:
Cycles:
Example 1:
Example 2:
Example 3:
Subtract W from f
[ label ]
0 ≤ f ≤ 127
d ∈ [0,1]
(f) - (W) → (dest)
C, DC, Z
00
Subtract (2’s complement method)
W register from register ‘f’. If ‘d’ is
‘0’, the result is stored in the W
register. If ‘d’ is ‘1’, the result is
stored back in register ‘f’.
1
1
SUBWF
Before Instruction
After Instruction
Before Instruction
After Instruction
Before Instruction
After Instruction
REG1 = 3
W
C
REG1 = 1
W
C
DC
Z
REG1 = 2
W
C
REG1 = 0
W
C
Z
REG1 = 1
W
C
REG1 = 0xFF
W
C
Z
SUBWF f,d
0010
REG1, 1
= 2
= ?
= 2
= 1; result is positive
= 1
= 0
= 2
= ?
= 2
= 1; result is zero
= DC = 1
= 2
= ?
= 2
= 0; result is negative
= DC = 0
dfff
ffff
PIC16F627A/628A/648A
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Example
SWAPF
Syntax:
Operands:
Operation:
Status Affected:
Encoding:
Description:
Words:
Cycles:
Example
TRIS
Load TRIS Register
[ label ] TRIS
5 ≤ f ≤ 7
(W) → TRIS register f;
None
00
The instruction is supported for
code compatibility with the
PIC16C5X products. Since TRIS
registers are readable and
writable, the user can directly
address them.
1
1
To maintain upward compatibil-
ity with future PIC
products, do not use this
instruction.
Swap Nibbles in f
[ label ]
0 ≤ f ≤ 127
d ∈ [0,1]
(f<3:0>) → (dest<7:4>),
(f<7:4>) → (dest<3:0>)
None
00
The upper and lower nibbles of
register ‘f’ are exchanged. If ‘d’ is
‘0’, the result is placed in W
register. If ‘d’ is ‘1’, the result is
placed in register ‘f’.
1
1
SWAPF
Before Instruction
After Instruction
REG1 = 0xA5
REG1 = 0xA5
W
0000
SWAPF f,d
1110
REG1, 0
= 0x5A
DS40044G-page 129
f
0110
®
dfff
MCU
0fff
ffff

Related parts for PIC16F628AT-E/SS