Electronic Components Datasheet Search
  English  ▼

X  

PIC14000 Datasheet(PDF) 35 Page - Microchip Technology

Part # PIC14000
Description  28-Pin Programmable Mixed Signal Controller
PDF  153 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC14000 Datasheet(HTML) 35 Page - Microchip Technology

Back Button PIC14000 Datasheet HTML 31Page - Microchip Technology PIC14000 Datasheet HTML 32Page - Microchip Technology PIC14000 Datasheet HTML 33Page - Microchip Technology PIC14000 Datasheet HTML 34Page - Microchip Technology PIC14000 Datasheet HTML 35Page - Microchip Technology PIC14000 Datasheet HTML 36Page - Microchip Technology PIC14000 Datasheet HTML 37Page - Microchip Technology PIC14000 Datasheet HTML 38Page - Microchip Technology PIC14000 Datasheet HTML 39Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 35 / 153 page
background image
© 1996 Microchip Technology Inc.
Preliminary
DS40122B-page 35
PIC14000
If the CMBOE bit (CMCON<5>) is set, the RD3/REFB
pin becomes the programmable reference B output
and pin RD2/CMPB becomes the comparator B output.
PORTD<1:0> also serve multiple functions. These pins
act as the I2C data and clock lines when the I2C module
is enabled.
The TRISD register controls the direction of the Port D
pins.
A
‘1’
in
each
location
configures
the
corresponding port pin as an input. Upon reset, this
register sets to FFh, meaning all PORTD pins are ini-
tially inputs. The data register should be initialized prior
to configuring the port as outputs.
Unused inputs should not be left floating to avoid
leakage currents. All pins have input protection diodes
to VDD and VSS.
EXAMPLE 5-3:
INITIALIZING PORTD
Note:
Setting CMBOE changes the definition of
RD3/REFB and RD2/CMPB, bypassing
the PORTD data and TRISD register set-
tings.
CLRF
PORTD
; Initialize PORTD data
;
latches before setting
;
the data direction
;
register
BSF
STATUS, RP0
; Select Bank1
MOVLW
0xFF
; Value used to initialize
; data direction
MOVWF
TRISD
; Set RD<7:0> as inputs
5.4
I/O Programming Considerations
5.4.1
BI-DIRECTIONAL I/O PORTS
Reading the port register reads the values of the port
pins. Writing to the port register writes the value to the
port latch. Some instructions operate internally as
read-modify-write. The BCF and BSF instructions, for
example, 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 PORTC will
cause all eight bits of PORTC to be read into the CPU.
Then the BSF operation takes place on bit5 and
PORTC is written to the output latches. If another bit of
PORTC is used as a bi-directional I/O pin (say 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 particular pin,
overwriting the previous content. As long as the pin
stays in the input mode, no problem occurs. However,
if bit0 is switched into output mode later on, the content
of the data latch may now be unknown.
A pin actively outputting a LOW or HIGH should not be
driven from external devices at the same time in order
to change the level on this pin (“wire-or”, “wire-and”).
The resulting high output currents may damage the
chip.
Example 5-4 shows the effect of two sequential read
modify write instructions (ex. BCF, BSF, etc.) on an I/O
Port.
EXAMPLE 5-4:
READ MODIFY WRITE
INSTRUCTIONS ON AN
I/O PORT
;
;
Initial PORT settings:
PORTC<7:4> Inputs
;
PORTC<3:0> Outputs
;
;
PORTC<7:6> have external pull-up and are not
connected to other circuitry
;
;
PORT
latch
PORT pins
;
----------
----------
BCF PORTC, 7
; 01pp
pppp
11pp pppp
BCF PORTC, 6
; 10pp
pppp
11pp pppp
BSF STATUS,RP0
;
BCF TRISC, 7
; 10pp
pppp
11pp pppp
BCF TRISC, 6
; 10pp
pppp
10pp pppp
;
; Note that the user may have expected the pin
; values to be 00pp pppp. The 2nd BCF caused
; RC7 to be latched as the pin value (High).



Html Pages

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 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  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com