Electronic Components Datasheet Search
  English  ▼

X  

MCP19124 Datasheet(PDF) 107 Page - Microchip Technology

Part # MCP19124
Description  Digitally-Enhanced Power Analog Synchronous Low-Side Dual-Loop PWM Controller
PDF  236 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  MICROCHIP [Microchip Technology]
Direct Link  http://www.microchip.com
Logo MICROCHIP - Microchip Technology

MCP19124 Datasheet(HTML) 107 Page - Microchip Technology

Back Button MCP19124 Datasheet HTML 103Page - Microchip Technology MCP19124 Datasheet HTML 104Page - Microchip Technology MCP19124 Datasheet HTML 105Page - Microchip Technology MCP19124 Datasheet HTML 106Page - Microchip Technology MCP19124 Datasheet HTML 107Page - Microchip Technology MCP19124 Datasheet HTML 108Page - Microchip Technology MCP19124 Datasheet HTML 109Page - Microchip Technology MCP19124 Datasheet HTML 110Page - Microchip Technology MCP19124 Datasheet HTML 111Page - Microchip Technology Next Button
Zoom Inzoom in Zoom Outzoom out
 107 / 236 page
background image
 2016 Microchip Technology Inc.
DS20005619A-page 107
MCP19124/5
17.0 I/O PORTS
In general, when a peripheral is enabled, that pin may
not be used as a general-purpose I/O pin.
Each port has the registers for its operation. These
registers are:
• TRISGPx registers (data direction register)
• PORTGPx registers (read the levels on the pins of
the device)
Some ports may have one or more of the following
additional registers. These registers are:
• ANSELx (analog select)
• WPUGPx (weak pull-up)
Ports with analog functions also have an ANSELx
register, which can disable the digital input and save
power. A simplified model of a generic I/O port, without
the interfaces to other peripherals, is shown in
Figure 17-1.
FIGURE 17-1:
GENERIC I/O PORTGPX
OPERATION
EXAMPLE 17-1:
INITIALIZING PORTGPA
17.1
PORTGPA and TRISGPA Registers
PORTGPA is an 8-bit wide, bidirectional port consisting
of five CMOS I/Os, one open-drain I/O and one
open-drain input-only pin (GPA4 is not available). The
corresponding data direction register is TRISGPA.
Setting a TRISGPA bit to ‘1’ will make the
corresponding PORTGPA pin an input (i.e., disable the
output driver). Clearing a TRISGPA bit set to ‘0’ will
make the corresponding PORTGPA pin an output (i.e.,
enables output driver). The exception is GPA5, which is
input only and its TRISGPA bit will always read as ‘1’.
Example 17-1 shows how to initialize an I/O port.
Reading the PORTGPA register reads the status of the
pins, whereas writing to it will write to the PORT latch.
All write operations are read-modify-write operations.
The TRISGPA register controls the PORTGPA pin
output drivers, even when they are being used as
analog inputs. The user must ensure the bits in the
TRISGPA register are maintained set when using them
as analog inputs. I/O pins configured as analog input
always read ‘0’. If the pin is configured for a digital
output (either port or alternate function), the TRISGPA
bit must be cleared in order for the pin to drive the
signal, and a read will reflect the state of the pin.
17.1.1
INTERRUPT-ON-CHANGE
Each PORTGPA pin is individually configurable as an
interrupt-on-change pin. Control bits IOCB<7:4> and
IOCB<2:0> enable or disable the interrupt function for
each pin. The interrupt-on-change feature is disabled
on a Power-On Reset. Reference Section 18.0
“Interrupt-On-Change” for more information.
17.1.2
WEAK PULL-UPS
PORTGPA <3:0> and PORTGPA5 have an internal weak
pull-up. PORTGPA<7:6> do not have internal weak
pull-ups. Individual control bits can enable or disable the
internal weak pull-ups (refer to Register 17-3). The weak
pull-up is automatically turned off when the port pin is
configured as an output, an alternative function or on a
Power-On Reset setting the RAPU bit in the
OPTION_REG register. The weak pull-up on GPA5 is
enabled when configured as MCLR pin by setting bit 5 in
the CONFIG register, and disabled when GPA5 is an I/O.
There is no software control of the MCLR pull-up.
Q
D
CK
Write LATx
Data Register
Read PORTGPx
Write PORTGPx
TRISGPx
Read LATx
Data Bus
To peripherals
ANSELx
VDD
AGND
I/O pin
; This code example illustrates
; initializing the PORTGPA register. The
; other ports are initialized in the same
; manner.
BANKSEL PORTGPA;
CLRF
PORTGPA;Init PORTA
BANKSEL ANSELA;
CLRF
ANSELA;digital I/O
BANKSEL TRISGPA;
MOVLW
B'00011111';Set GPA<3:0> as
;inputs
MOVWF
TRISGPA;and set GPA<7:5> as
;outputs



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