Electronic Components Datasheet Search
  New Zealand  ▼
ALLDATASHEET.CO.NZ

X  

PIC18F6X2X Datasheet(PDF) 124 Page - Microchip Technology

Part # PIC18F6X2X
Description  64/80-Pin High Performance, 64-Kbyte Enhanced FLASH Microcontrollers with A/D
PDF  386 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

PIC18F6X2X Datasheet(HTML) 124 Page - Microchip Technology

Back Button PIC18F6X2X Datasheet HTML 120Page - Microchip Technology PIC18F6X2X Datasheet HTML 121Page - Microchip Technology PIC18F6X2X Datasheet HTML 122Page - Microchip Technology PIC18F6X2X Datasheet HTML 123Page - Microchip Technology PIC18F6X2X Datasheet HTML 124Page - Microchip Technology PIC18F6X2X Datasheet HTML 125Page - Microchip Technology PIC18F6X2X Datasheet HTML 126Page - Microchip Technology PIC18F6X2X Datasheet HTML 127Page - Microchip Technology PIC18F6X2X Datasheet HTML 128Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 124 / 386 page
background image
PIC18F6X2X/8X2X
DS39612A-page 122
Advance Information
 2003 Microchip Technology Inc.
10.7
PORTG, TRISG and LATG
Registers
PORTG is a 6-bit wide port with 5 bi-directional pins
(RG0:RG4) and one optional input only pin (RG5). The
corresponding Data Direction register is TRISG. Setting
a TRISG bit (= 1) will make the corresponding PORTG
pin an input (i.e., put the corresponding output driver in
a high-impedance mode). Clearing a TRISG bit (= 0)
will make the corresponding PORTC pin an output (i.e.,
put the contents of the output latch on the selected pin).
The Data Latch register (LATG) is also memory
mapped. Read-modify-write operations on the LATG
register, read and write the latched output value for
PORTG.
PORTG is multiplexed with both CCP and USART
functions (Table 10-13). PORTG pins have Schmitt
Trigger input buffers.
When enabling peripheral functions, care should be
taken in defining TRIS bits for each PORTG pin. Some
peripherals override the TRIS bit to make a pin an out-
put, while other peripherals override the TRIS bit to
make a pin an input. The user should refer to the corre-
sponding peripheral section for the correct TRIS bit
settings.
The pin override value is not loaded into the TRIS reg-
ister. This allows read-modify-write operations of the
TRIS register without concern due to peripheral
overrides.
The sixth pin of PORTG (MCLR/VPP/RG5) is a digital
input pin. Its operation is controlled by the MCLRE
configuration
bit
in
Configuration
Register
3H
(CONFIG3H<7>).
In
its
default
configuration
(MCLRE = 1), the pin functions as the device Master
Clear input. When selected as a port pin (MCLRE = 0),
it functions as an input only pin; as such, it does not
have TRISG or LATG bits associated with it.
In either configuration, RG5 also functions as the
programming voltage input during device programming.
EXAMPLE 10-7:
INITIALIZING PORTG
FIGURE 10-16:
PORTG BLOCK DIAGRAM (PERIPHERAL OUTPUT OVERRIDE)
Note:
On a Power-on Reset, these pins are
configured as digital inputs.
Note 1: On a Power-on Reset, RG5 is enabled as
a digital input only if Master Clear
functionality is disabled (MCLRE = 0).
2: If the device Master Clear is disabled,
verify that either of the following is done to
ensure proper entry into ICSP mode:
a.) disable low voltage programming
(CONFIG4L<2> = 0); or
b.) make certain that RB5/KBI1/PGM is
held low during entry into ICSP.
CLRF
PORTG
;
Initialize PORTG by
; clearing output
; data latches
CLRF
LATG
; Alternate method
; to clear output
; data latches
MOVLW
0x04
;
Value used to
; initialize data
; direction
MOVWF
TRISG
;
Set RG1:RG0 as outputs
; RG2 as input
;
RG4:RG3 as inputs
PORTG/Peripheral Out Select
Data Bus
WR LATG
WR TRISG
Data Latch
TRIS Latch
RD TRISG
Q
D
Q
CK
QD
EN
Peripheral Data Out
0
1
Q
D
Q
CK
P
N
VDD
VSS
RD PORTG
Peripheral Data In
I/O pin(1)
or
WR PORTG
RD LATG
Schmitt
Trigger
TRIS
Override
Peripheral Output
Logic
TRIS OVERRIDE
Pin
Override
Peripheral
RG0
Yes
CCP3 I/O
RG1
Yes
USART1 Async Xmit,
Sync Clock
RG2
Yes
USART1 Async Rcv,
Sync Data Out
RG3
Yes
CCP4 I/O
RG4
Yes
CCP5 I/O
Enable(2)
Note 1: I/O pins have diode protection to VDD
and VSS.
2: Peripheral output enable is only active
if peripheral select is active.



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