MCP2221A GPIO and ADC from the browser

Set the MCP2221A’s four GP pins as inputs, outputs or analog inputs, switch outputs, and read voltages on ADC1 to ADC3 with the supply or an internal reference.

How to use it

  1. Connect the MCP2221A (or the simulated board) and open GPIO and ADC.
  2. Set each GP pin as an input, an output or (GP1 to GP3) an analog input; switch outputs high or low.
  3. Read the voltages on ADC1 to ADC3, against the supply or the 1.024, 2.048 or 4.096 V internal reference.

Questions

Do the pin settings stay after unplugging?

No. The page changes the chip’s working settings only; the power-up settings in its flash are left as they were.

How accurate is the ADC?

It has 10 bits: about 3.2 mV a step against a 3.3 V supply, 2 mV against the 2.048 V reference. Against the supply, enter the measured supply voltage for the best result.

Can a GP pin drive a relay?

Not directly: the pins drive a few milliamps at the supply voltage. Use a transistor or a relay module with its own driver.

Is anything sent to a server?

No. The page talks to the adapter from this tab only.

Related tools

  • I²C bus scanner and register reader (MCP2221A, WebHID): Scan an I²C bus from the browser through an MCP2221A USB bridge, identify the parts by their ID registers, read and write registers, dump an EEPROM, and read a BME280, INA219 or MPU-6050 live.
  • Logic analyser capture viewer and protocol decoders: Saleae CSV/binary, sigrok .sr and VCD captures decoded as UART, CAN, LIN, SPI and I²C, on a waveform with zoom; CSV, ASC and candump export.
  • Serial terminal (Web Serial): UART console in the browser: baud, parity, text/hex, timestamps, log to file, macros, DTR/RTS; a live plotter and send/expect scripts.
  • Electronics calculators: Divider/ADC, NTC, pull-ups, RC/PWM filter, wire drop, power and heat, CAN bus length.
  • Cortex-M debugger in the browser (ST-LINK, CMSIS-DAP): Halt, step and reset an Arm Cortex-M; watch and write global variables from the ELF live with plots; SEGGER RTT terminal; live SVD peripheral registers; breakpoints, watchpoints and HardFault capture. Over WebUSB, nothing to install.
  • ECU test bench: lab supply, multimeter, relays, PPK2: Drive the instruments on an ECU bench from the browser: a lab power supply (SCPI on LAN or USB, Korad, Riden), a multimeter, a USB relay board for KL30 and KL15, and a Nordic PPK2. Live charts, voltage profiles, ignition cycles and a sleep-current test. Or try the simulated bench.

Also useful for: mcp2221 gpio, usb gpio, usb adc, read voltage usb, gpio from pc, webhid gpio, mcp2221a adc.