USB IO Expander
With this project you can control I/O pins, communicate via IIC or SPI and do other things without the need to program a Micro Controller. By simply typing some commands using ASCII characters via a terminal emulator program on your computer you can do that using this USB I/O Expander.
- Reading and writing eight I/O pins
- IIC interface for controlling IIC devices
- SPI interface for controlling SPI devices
- Digital to Analog Conversion (DAC) with 2 selectable analog outputs
- Analog to Digital Conversion (ADC) with 4 selectable analog inputs
- Two channel Pulse Width Modulation (PWM) signal generator
- A breadboard
- 1 * PIC microcontroller 16F1455
- 1 * Electrolytic capacitor 10 uF/16V
- Capacitors: 1 * 100 nF, 1 * 470 nF
- Resistors: 2 * 22 Ohm, 1 * 10k
- 1 * USB connector
- Optional: An 8-pin connector
- Optional: A reset button

- Parsing the commands
- Activating the relevant functions
- Send the response and answer
- IIC library
- SPI library
- ADC library
- DAC library
- PWM library
As mentioned earlier no special tools or libraries are needed to control the USB I/O Expander from your PC. A terminal emulator program is sufficient. The screenshot shows a typical procedure where the contents of an – empty – EEPROM is read, programmed and read again using an IIC interface.
- Ping the device. This is optional, just checking if the device is alive.
- Initialize the IIC interface at 400 kHz.
- Reset the register – word - address of the EEPROM to 0 before reading.
- Read 10 bytes from the EEPROM (starting at word address 0). EEPROM is empty (0xFF).
- Write 10 bytes of data starting at word address 0.
- Reset the register – word - address of the EEPROM to 0 before reading.
- Read 10 bytes from the EEPROM (starting at word address 0)

Want to build a project?
Bring your design to life with the Elektor PCB Service, powered by Eurocircuits. Upload the project files and order professionally manufactured PCBs or assembled boards through a proven European production platform.
Supporting KiCad, Eagle, Gerber, and ODB++ formats, the service is suitable for everything from prototypes and validation builds to series production and volume manufacturing.
Made in Europe. Fast. Reliable. Professional.

Discussion (0 comments)