Datasheet

2015 Microchip Technology Inc. DS20005292B-page 35
MCP2221
TABLE 3-13: SUB-COMMAND STRUCTURE – WRITE GP SETTINGS SUB-COMMAND
Byte
Index
Function Description Value Effect
0 0xB1 Write Flash Data – command code
1 0x01 Write GP Settings – it will write the MCP2221 flash GP
settings
2 GP0 Power-Up Settings
Bit 7-5: Don’t care
Bit 4: GPIO Output value When GP0 is set as an output GPIO, this value will be
present at the GP0 pin at Power-Up/Reset.
Bit 3: GPIO Direction
(Input/Output) – Works only when
GP0 is set for GPIO operation.
1 GPIO Input mode
0 GPIO Output mode
Bit 2-0: GP0 Designation 111-011 Don’t care
010 Dedicated function operation (SSPND)
001 Alternate function 0 (LED UART RX)
000 GPIO operation
3 GP1 Power-Up Settings
Bit 7-5: Don’t care
Bit 4: GPIO Output value When GP1 is set as an output GPIO, this value will be
present at the GP1 pin at Power-Up/Reset.
Bit 3: GPIO Direction
(Input/Output) – Works only when
GP1 is set for GPIO operation.
1 GPIO Input mode
0 GPIO Output mode
Bit 2-0: GP1 Designation 111-101 Don’t care
100 Alternate function 2 (Interrupt Detection)
011 Alternate function1 (LED UART TX)
010 Alternate function 0 (ADC1)
001 Dedicated function operation (Clock Output)
000 GPIO operation
4 GP2 Power-Up Settings
Bit 7-5: Don’t care
Bit 4: GPIO Output value When GP2 is set as an output GPIO, this value will be
present at the GP2 pin at Power-Up/Reset.
Bit 3: GPIO Direction
(Input/Output) – Works only when
GP2 is set for GPIO operation.
1 GPIO Input mode
0 GPIO Output mode
Bit 2-0: GP2 Designation 111-100 Don’t care
011 Alternate function1 (DAC1)
010 Alternate function 0 (ADC2)
001 Dedicated function operation (Clock Output)
000 GPIO operation