PIC10F220-E/OT Microchip Technology, PIC10F220-E/OT Datasheet - Page 25

384B Flash, 16B RAM, 4 I/O, 8bit ADC 6 SOT-23 BAG

PIC10F220-E/OT

Manufacturer Part Number
PIC10F220-E/OT
Description
384B Flash, 16B RAM, 4 I/O, 8bit ADC 6 SOT-23 BAG
Manufacturer
Microchip Technology
Series
PIC® 10Fr
Datasheet

Specifications of PIC10F220-E/OT

Processor Series
PIC10F
Core
RISC
Data Bus Width
8 bit
Program Memory Type
Flash
Program Memory Size
256 B
Data Ram Size
16 B
Interface Type
RS-232, USB
Maximum Clock Frequency
8 MHZ
Number Of Programmable I/os
4
Number Of Timers
1
Maximum Operating Temperature
+ 125 C
Mounting Style
SMD/SMT
Package / Case
SOT-23-6
Operating Temperature Range
- 40 C to + 125 C
Processor To Be Evaluated
PIC10F220
Supply Current (max)
100 nA
Core Processor
PIC
Core Size
8-Bit
Speed
8MHz
Connectivity
-
Peripherals
POR, WDT
Number Of I /o
4
Eeprom Size
-
Ram Size
16 x 8
Voltage - Supply (vcc/vdd)
2 V ~ 5.5 V
Data Converters
A/D 2x8b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 125°C
Lead Free Status / Rohs Status
 Details
TABLE 5-3:
5.4
5.4.1
Some instructions operate internally as read followed
by write operations. The BCF and BSF instructions, for
example, read the entire port into the CPU, execute the
bit operation and re-write the result. Caution must be
used when these instructions are applied to a port
where one or more pins are used as input/outputs. For
example, a BSF operation on bit 2 of GPIO will cause
all eight bits of GPIO to be read into the CPU, bit 2 to
be set and the GPIO value to be written to the output
latches. If another bit of GPIO is used as a bidirectional
I/O pin (say bit 0) and it is defined as an input at this
time, the input signal present on the pin itself would be
read into the CPU and rewritten to the data latch of this
particular pin, overwriting the previous content. As long
as the pin stays in the Input mode, no problem occurs.
However, if bit 0 is switched into Output mode later on,
the content of the data latch may now be unknown.
Example 5-1 shows the effect of two sequential
Read-Modify-Write instructions (e.g., BCF, BSF, etc.)
on an I/O port.
A pin actively outputting a high or a low should not be
driven from external devices at the same time in order
to change the level on this pin (“wired-or”, “wired-and”).
The resulting high output currents may damage the
chip.
FIGURE 5-5:
© 2007 Microchip Technology Inc.
N/A
N/A
03h
06h
Legend:
Note 1:
Instruction
Instruction
Address
Executed
GP<2:0>
Fetched
I/O Programming Considerations
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
MOVWF GPIO
TRISGPIO
OPTION
STATUS
GPIO
Shaded cells not used by PORT registers, read as ‘0’, – = unimplemented, read as ‘0’, x = unknown, u = unchanged,
q = depends on condition.
If Reset was due to wake-up on pin change, then bit 7 = 1. All other Resets will cause bit 7 = 0.
BIDIRECTIONAL I/O PORTS
Name
PC
SUMMARY OF PORT REGISTERS
SUCCESSIVE I/O OPERATION
GPWUF
GPWU
Bit 7
MOVF GPIO, W
(Write to GPIO)
MOVWF GPIO
Port pin
written here
PC + 1
GPPU
Bit 6
MOVF GPIO,W
T0CS
Bit 5
(Read GPIO)
Port pin
sampled here
NOP
PC + 2
T0SE
Bit 4
TO
I/O Control Registers
Bit 3
PSA
GP3
PD
PC + 3
NOP
NOP
EXAMPLE 5-1:
5.4.2
The actual write to an I/O port happens at the end of an
instruction cycle, whereas for reading, the data must be
valid at the beginning of the instruction cycle (Figure 5-5).
Therefore, care must be exercised if a write followed by
a read operation is carried out on the same I/O port. The
sequence of instructions should allow the pin voltage to
stabilize (load dependent) before the next instruction
causes that file to be read into the CPU. Otherwise, the
previous state of that pin may be read into the CPU rather
than the new state. When in doubt, it is better to separate
these instructions with a NOP or another instruction not
accessing this I/O port.
;Initial GPIO Settings
;GPIO<3:2> Inputs
;GPIO<1:0> Outputs
;
;
;
;
BCF
BCF
MOVLW
TRIS
Note:
Bit 2
GP2
PS2
Z
Bit 1
GP1
GPIO,
GPIO,
007h;
GPIO
PS1
DC
SUCCESSIVE OPERATIONS ON I/O
PORTS
This example shows a write to GPIO followed
by a read from GPIO.
Data setup time = (0.25 T
where: T
Therefore, at higher clock frequencies, a
write followed by a read may be problematic.
The user may have expected the pin values to
be ---- pp00. The second BCF caused GP1
to be latched as the pin value (High).
PIC10F220/222
Bit 0
GP0
PS0
C
1 ;---- pp01
0 ;---- pp10
T
CY
PD
;---- pp10
GPIO latch
----------
I/O PORT READ-MODIFY-
WRITE INSTRUCTIONS
= instruction cycle
= propagation delay
---- 1111
1111 1111
0001 1xxx
---- xxxx
Power-On
Value on
Reset
CY
DS41270E-page 23
GPIO pins
----------
– T
All Other Resets
---- pp11
---- pp11
---- pp11
q00q quuu
---- 1111
1111 1111
---- uuuu
PD
Value on
)
(1)

Related parts for PIC10F220-E/OT