參數(shù)資料
型號: PIC27CR43
廠商: Microchip Technology Inc.
英文描述: High-Performance 8-Bit CMOS EPROM/ROM Microcontroller(每個(gè)I/O口有20mA吸收,35mA驅(qū)動,4K位PROM,微控制器)
中文描述: 高性能的8位CMOS存儲器/ ROM的微控制器(每個(gè)的I / O口有20mA的吸收,35毫安驅(qū)動,4K的位胎膜早破,微控制器)
文件頁數(shù): 64/241頁
文件大?。?/td> 1548K
代理商: PIC27CR43
第1頁第2頁第3頁第4頁第5頁第6頁第7頁第8頁第9頁第10頁第11頁第12頁第13頁第14頁第15頁第16頁第17頁第18頁第19頁第20頁第21頁第22頁第23頁第24頁第25頁第26頁第27頁第28頁第29頁第30頁第31頁第32頁第33頁第34頁第35頁第36頁第37頁第38頁第39頁第40頁第41頁第42頁第43頁第44頁第45頁第46頁第47頁第48頁第49頁第50頁第51頁第52頁第53頁第54頁第55頁第56頁第57頁第58頁第59頁第60頁第61頁第62頁第63頁當(dāng)前第64頁第65頁第66頁第67頁第68頁第69頁第70頁第71頁第72頁第73頁第74頁第75頁第76頁第77頁第78頁第79頁第80頁第81頁第82頁第83頁第84頁第85頁第86頁第87頁第88頁第89頁第90頁第91頁第92頁第93頁第94頁第95頁第96頁第97頁第98頁第99頁第100頁第101頁第102頁第103頁第104頁第105頁第106頁第107頁第108頁第109頁第110頁第111頁第112頁第113頁第114頁第115頁第116頁第117頁第118頁第119頁第120頁第121頁第122頁第123頁第124頁第125頁第126頁第127頁第128頁第129頁第130頁第131頁第132頁第133頁第134頁第135頁第136頁第137頁第138頁第139頁第140頁第141頁第142頁第143頁第144頁第145頁第146頁第147頁第148頁第149頁第150頁第151頁第152頁第153頁第154頁第155頁第156頁第157頁第158頁第159頁第160頁第161頁第162頁第163頁第164頁第165頁第166頁第167頁第168頁第169頁第170頁第171頁第172頁第173頁第174頁第175頁第176頁第177頁第178頁第179頁第180頁第181頁第182頁第183頁第184頁第185頁第186頁第187頁第188頁第189頁第190頁第191頁第192頁第193頁第194頁第195頁第196頁第197頁第198頁第199頁第200頁第201頁第202頁第203頁第204頁第205頁第206頁第207頁第208頁第209頁第210頁第211頁第212頁第213頁第214頁第215頁第216頁第217頁第218頁第219頁第220頁第221頁第222頁第223頁第224頁第225頁第226頁第227頁第228頁第229頁第230頁第231頁第232頁第233頁第234頁第235頁第236頁第237頁第238頁第239頁第240頁第241頁
PIC17C4X
DS30412B-page 64
1996 Microchip Technology Inc.
9.5
I/O Programming Considerations
9.5.1
BI-DIRECTIONAL I/O PORTS
Any instruction which writes, operates internally as a
read followed by a write operation. For example, the
BCF
and
BSF
instructions read the register into the
CPU, execute the bit operation, and write the result
back to the register. Caution must be used when these
instructions are applied to a port with both inputs and
outputs defined. For example, a
BSF
operation on bit5
of PORTB will cause all eight bits of PORTB to be read
into the CPU. Then the
BSF
operation takes place on
bit5 and PORTB is written to the output latches. If
another bit of PORTB is used as a bi-directional I/O pin
(e.g. bit0) 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 re-written to the data latch of this particu-
lar pin, overwriting the previous content. As long as the
pin stays in the input mode, no problem occurs. How-
ever, if bit0 is switched into output mode later on, the
content of the data latch may now be unknown.
Reading a port reads the values of the port pins. Writing
to the port register writes the value to the port latch.
When using read-modify-write instructions (
BCF, BSF
,
BTG
, etc.) on a port, the value of the port pins is read,
the desired operation is performed with this value, and
the value is then written to the port latch.
Example 9-5 shows the effect of two sequential
read-modify-write instructions on an I/O port.
EXAMPLE 9-5:
READ MODIFY WRITE
INSTRUCTIONS ON AN
I/O PORT
; Initial PORT settings: PORTB<7:4> Inputs
; PORTB<3:0> Outputs
; PORTB<7:6> have pull-ups and are
; not connected to other circuitry
;
; PORT latch PORT pins
; ---------- ---------
;
BCF PORTB, 7 01pp pppp 11pp pppp
BCF PORTB, 6 10pp pppp 11pp pppp
;
BCF DDRB, 7 10pp pppp 11pp pppp
BCF DDRB, 6 10pp pppp 10pp pppp
;
; Note that the user may have expected the
; pin values to be 00pp pppp. The 2nd BCF
; caused RB7 to be latched as the pin value
; (High).
Note:
A pin actively outputting a Low or High
should not be driven from external devices
in order to change the level on this pin (i.e.
“wired-or”, “wired-and”). The resulting high
output currents may damage the device.
9.5.2
SUCCESSIVE OPERATIONS ON I/O PORTS
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 9-
9). 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 be such to allow
the pin voltage to stabilize (load dependent) before exe-
cuting the instruction that reads the values on that I/O
port. 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.
FIGURE 9-9:
SUCCESSIVE I/O OPERATION
Note:
This example shows a write to PORTB
followed by a read from PORTB.
Note that:
data setup time = (0.25 T
- T
PD
)
where T
CY
= instruction cycle.
T
= propagation delay
Therefore, at higher clock
frequencies, a write followed by a
read may be problematic.
PC
PC + 1
PC + 2
PC + 3
Q1
Q2
Q3 Q4
Q1
Q2
Q3 Q4 Q1
Q2
Q3 Q4
Q1
Q2
Q3 Q4
Instruction
fetched
RB7:RB0
MOVWF PORTB
write to
PORTB
NOP
Port pin
sampled here
NOP
MOVF PORTB,W
Instruction
executed
MOVWF PORTB
write to
PORTB
NOP
MOVF PORTB,W
相關(guān)PDF資料
PDF描述
PIC17C752 64/68 Pin 8 Bit High-Performance 8-Bit CMOS EPROM/ROM Microcontroller(驅(qū)動/吸收電流高,4路捕捉,3路PWM)
PIC17C756 64/68 Pin 8 Bit High-Performance 8-Bit CMOS EPROM/ROM Microcontroller(驅(qū)動/吸收電流高,4路捕捉,3路PWM的微控制器)
pic17c756a 64/68-Pin 8-Bit OTP High-Performance Microcontroller(具ADC的8位CMOS微控制器)
PIC17FR42 High-Performance 8-Bit CMOS FlexROM Microcontroller(每個(gè)I/O口有25mA驅(qū)動/吸收電流,并行從動口,2路捕捉/PWM的微控制器)
PIC17FR43 High-Performance 8-Bit CMOS FlexROM Microcontroller(每個(gè)I/O口有25mA驅(qū)動/吸收電流,并行從動口,2路捕捉/PWM的微控制器)
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
PIC-28041TM2 制造商:未知廠家 制造商全稱:未知廠家 功能描述:Optoelectronic
PIC-28042TM2 制造商:未知廠家 制造商全稱:未知廠家 功能描述:Optoelectronic
PIC-28043TM2 制造商:未知廠家 制造商全稱:未知廠家 功能描述:Optoelectronic
PIC-28044TM2 制造商:未知廠家 制造商全稱:未知廠家 功能描述:Optoelectronic
PIC-28045TM2 制造商:未知廠家 制造商全稱:未知廠家 功能描述:Optoelectronic