Electronic Components Datasheet Search
  English  ▼
ALLDATASHEET.NET

X  

PIC16F913 Datasheet(PDF) 33 Page - Microchip Technology

Part # PIC16F913
Description  28/40/44-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt Technology
PDF  272 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC16F913 Datasheet(HTML) 33 Page - Microchip Technology

Back Button PIC16F913 Datasheet HTML 29Page - Microchip Technology PIC16F913 Datasheet HTML 30Page - Microchip Technology PIC16F913 Datasheet HTML 31Page - Microchip Technology PIC16F913 Datasheet HTML 32Page - Microchip Technology PIC16F913 Datasheet HTML 33Page - Microchip Technology PIC16F913 Datasheet HTML 34Page - Microchip Technology PIC16F913 Datasheet HTML 35Page - Microchip Technology PIC16F913 Datasheet HTML 36Page - Microchip Technology PIC16F913 Datasheet HTML 37Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 33 / 272 page
background image
© 2005 Microchip Technology Inc.
Preliminary
DS41250E-page 31
PIC16F917/916/914/913
3.0
I/O PORTS
This device includes four 8-bit port registers along with
their corresponding TRIS registers and one four bit
port:
• PORTA and TRISA
• PORTB and TRISB
• PORTC and TRISC
• PORTD and TRISD
• PORTE and TRISE
PORTA, PORTB, PORTC and RE3/MCLR/VPP are
implemented on all devices. PORTD and RE<2:0> are
implemented only on the PIC16F914 and PIC16F917.
3.1
PORTA and TRISA Registers
PORTA
is
a
8-bit
wide,
bidirectional
port.
The
corresponding
data
direction
register
is
TRISA
(Register 3-2). Setting a TRISA bit (= 1) will make the
corresponding PORTA pin an input (i.e., put the
corresponding output driver in a High-impedance mode).
Clearing a TRISA bit (= 0) will make the corresponding
PORTA pin an output (i.e., put the contents of the output
latch on the selected pin). Example 3-1 shows how to
initialize PORTA.
Five of the pins of PORTA can be configured as analog
inputs. These pins, RA5 and RA<3:0>, are configured
as analog inputs on device power-up and must be
reconfigured by the user to be used as I/O’s. This is
done by writing the appropriate values to the CMCON0
and ANSEL registers (see Example 3-1).
Reading the PORTA register (Register 3-1) reads the
status of the pins, whereas writing to it will write to the
port latch. All write operations are read-modify-write
operations. Therefore, a write to a port implies that the
port pins are read, this value is modified and then written
to the port data latch.
The TRISA register controls the direction of the
PORTA pins, even when they are being used as analog
inputs. The user must ensure the bits in the TRISA
register are maintained set when using them as analog
inputs. I/O pins configured as analog input always read
‘0’.
EXAMPLE 3-1:
INITIALIZING PORTA
Note 1: The CMCON0 (9Ch) register must be
initialized to configure an analog channel
as a digital input. Pins configured as
analog inputs will read ‘0’.
2: Analog lines that carry LCD signals
(i.e., SEGx, COMy, where x and y are
segment and common identifiers) are
shown as direct connections to the device
pins. The signals are outputs from the
LCD module and may be tri-stated,
depending on the configuration of the
LCD module.
BCF
STATUS,RP0
;Bank 0
BCF
STATUS,RP1
;
CLRF
PORTA
;Init PORTA
BSF
STATUS,RP0
;Bank 1
BCF
STATUS,RP1
;
MOVLW
07h
;Set RA<2:0> to
MOVWF
CMCON0
;digital I/O
CLF
ANSEL
;Make all PORTA I/O
MOVLW
F0h
;Set RA<7:4> as inputs
MOVWF
TRISA
;and set RA<3:0>
; as outputs
BCF
STATUS,RP0
;Bank 0
BCF
STATUS,RP1
;



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