PIC16F818-I/P Microchip Technology, PIC16F818-I/P Datasheet - Page 567

IC MCU FLASH 1KX14 18-DIP

PIC16F818-I/P

Manufacturer Part Number
PIC16F818-I/P
Description
IC MCU FLASH 1KX14 18-DIP
Manufacturer
Microchip Technology
Series
PIC® 16Fr

Specifications of PIC16F818-I/P

Program Memory Type
FLASH
Program Memory Size
1.75KB (1K x 14)
Package / Case
18-DIP (0.300", 7.62mm)
Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Connectivity
I²C, SPI
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
16
Eeprom Size
128 x 8
Ram Size
128 x 8
Voltage - Supply (vcc/vdd)
4 V ~ 5.5 V
Data Converters
A/D 5x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Processor Series
PIC16F
Core
PIC
Data Bus Width
8 bit
Data Ram Size
128 B
Interface Type
I2C/SPI/SSP
Maximum Clock Frequency
20 MHz
Number Of Programmable I/os
16
Number Of Timers
3
Operating Supply Voltage
2 V to 5.5 V
Maximum Operating Temperature
+ 85 C
Mounting Style
Through Hole
3rd Party Development Tools
52715-96, 52716-328, 52717-734
Development Tools By Supplier
PG164130, DV164035, DV244005, DV164005, PG164120, ICE2000, DM163014
Minimum Operating Temperature
- 40 C
On-chip Adc
5-ch x 10-bit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
ACICE0202 - ADAPTER MPLABICE 18P 300 MILAC164010 - MODULE SKT PROMATEII DIP/SOIC
Lead Free Status / Rohs Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC16F818-I/P
Manufacturer:
Microchip Technology
Quantity:
295
29.6
1997 Microchip Technology Inc.
Design Tips
Question 1:
Answer 1:
There are a few possibilities, two are:
1.
2.
Question 2:
Answer 2:
For code compatibility and upgrades to later parts, the use of the TRIS instruction is not recom-
mended. You should note the TRIS instruction is limited to ports A, B and C. Future devices may
not support these instructions.
Question 3:
Answer 3:
No. The TRIS instruction is Bank independent. Again the use of the TRIS instruction is not rec-
ommended.
Question 4:
Answer 4:
An easy example of a Read-Modify-Write (R-M-W) instruction is the bit clear instruction BCF. You
might think that the processor just clears the bit, which on a port output pin would clear the pin.
What actually happens is the whole port (or register) is first read, THEN the bit is cleared, then
the new modified value is written back to the port (or register). Actually, any instruction that
depends on a value currently in the register is going to be a Read-Modify-Write instruction. This
includes ADDWF, SUBWF, BCF, BSF, INCF, XORWF , etc... Instructions that do not depend on
the current register value, like MOVWF, CLRF, and so on are not R-M-W instructions.
One situation where you would want to consider the affects of a R-M-W instruction is a port that
is continuously changed from input to output and back. For example, say you have TRISB set to
all outputs, and write all ones to the PORTB register, all of the PORTB pins will go high. Now, say
you turn pin RB3 into an input, which happens to go low. A BCF PORTB,6 is then executed to
drive pin RB6 low. If you then turn RB3 back into an output, it will now drive low, even though the
last value you put there was a one. What happened was that the BCF of the other pin (RB6)
caused the whole port to be read, including the zero on RB3 when it was an input. Then, bit 6
was changed as requested, but since RB3 was read as a zero, zero will also be placed back into
that port latch, overwriting the one that was there before. When the pin is turned back into an
output, the new value was reflected.
For the midrange devices, there are several instructions that work with a literal and W. For
instance, if it were desired to decrement W, this can be done with an ADDLW 0xFF. (the 0x
prefix denotes hex to the assembler)
Notice that all of the instructions can modify a value right where it sits in the file register.
This means you can decrement it right where it is. You do not even need to move it to W.
If you want to decrement it AND move it somewhere else, then you make W the DESTI-
NATION of the decrement (DECF register,W) then put it where you want it. It is the same
number of instructions as a straight move, but it gets decremented along the way.
How can I modify the value of W directly? I want to decrement W.
Is there any danger in using the TRIS instruction for the PIC16CXXX since
there is a warning in the Data book suggesting it not be used?
Do I have to switch to Bank1 of data memory before using the TRIS instruc-
tion (for parts with TRIS registers in the memory map)?
I have seen references to “Read-Modify-Write” instructions in your data
sheet, but I do not know what that is. Can you explain what it is and why I
need to know this?
Section 29. Instruction Set
DS31029A-page 29-45
29

Related parts for PIC16F818-I/P