PIC12C672-10/SM Microchip Technology, PIC12C672-10/SM Datasheet - Page 567

no-image

PIC12C672-10/SM

Manufacturer Part Number
PIC12C672-10/SM
Description
IC MCU OTP 2KX14 A/D 8-SOIJ
Manufacturer
Microchip Technology
Series
PIC® 12Cr
Datasheets

Specifications of PIC12C672-10/SM

Core Processor
PIC
Core Size
8-Bit
Speed
10MHz
Peripherals
POR, WDT
Number Of I /o
5
Program Memory Size
3.5KB (2K x 14)
Program Memory Type
OTP
Ram Size
128 x 8
Voltage - Supply (vcc/vdd)
3 V ~ 5.5 V
Data Converters
A/D 4x8b
Oscillator Type
Internal
Operating Temperature
0°C ~ 70°C
Package / Case
8-SOIC (5.3mm Width), 8-SOP, 8-SOEIAJ
For Use With
XLT08SO-1 - SOCKET TRANSITION 8SOIC 150/208AC164312 - MODULE SKT FOR PM3 16SOICISPICR1 - ADAPTER IN-CIRCUIT PROGRAMMING309-1048 - ADAPTER 8-SOIC TO 8-DIP309-1047 - ADAPTER 8-SOIC TO 8-DIPAC124001 - MODULE SKT PROMATEII 8DIP/SOIC
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Connectivity
-
Other names
PIC12C672-10/SMR
PIC12C672-10/SMR
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 PIC12C672-10/SM