3 Device Configuration
The MCP2222 stores device configuration settings in NVM (EEPROM) and/or volatile memory (SRAM):
- SRAM: Settings stored in SRAM are referred as active settings.
- EEPROM: Settings stored in NVM are persistent; they are copied into SRAM and are made active at every device reset or up at power-up. These settings are referred as power-up settings.
The active settings can be modified using the following commands:
- IO_SetConfiguration: Used to configure an I/O pin at run-time
- I2C_Config: Used to configure I2C parameters at run-time
- SPI_Config: Used to configure SPI parameters at run-time
- SET_LINE_CODING (CDC ACM Class): Used to configure UART parameters at run-time
The power-up settings are factory-defined and can be modified using the appropriate device configuration commands.
The configuration settings are classified into the following categories:
- USB Vendor ID and Product ID
- USB power attributes, including requested current and bus-powered or self-powered operation
- USB manufacturer, product, and serial number descriptors
USB parameters can be modified using the following commands:
- CNFG_SetUSBParameters
- CNFG_SetManufacturer
- CNFG_SetSerialNumber
- CNFG_SetProductName
I/O pins settings include:
- I/O pin function designation
- I/O pin direction
- I/O pin logic state for output pins
- Open-drain enable for output pins
- Internal pull-up enable for input pins
- Alert trigger edge selection for alert/interrupt pins
- Clock reference output frequency
The available I/O pin function designations and supported configuration options are described in the I/O Designations and Other Pin Settings table.
I/O settings can be modified using the following command: CNFG_SetIOConfiguration
- Peripheral settings include:
- UART settings
- I2C settings
- SPI settings
- Peripheral settings can be modified
using the following commands:
- CNFG_SetI2CSettings
- CNFG_SetSPISettings
Note: No power-up settings are stored for UART, only the active ones. - Configuration protection settings:
The MCP2222 provides configuration protection for power-up settings, including USB parameters, I/O pin settings, and peripheral settings. Protection levels are described in Section 3.5: Configuration Protection Settings.
The configuration protection level and the password if set, are saved in NVM.
