[Howto] Raspberry Pi + I²C + MCP23017 + C (minimal example)
minimal working example: read data from MCP23017-register and print it to screen.
minimal working example: read data from MCP23017-register and print it to screen.
purpose: measuring the timespan between rising/falling-edge (=off/on/off-change) of a digital-output-bank (GPA0…GPA7) testing equipment: -Raspberry Pi 3 Modell B-I2C-adress of MCP23017-chip = 0x20-MCP23017 register-adress of 8 digital-outputs: 0x14-Owon SDS7102 digital ocsilloscope conclusion: I²C-baudrate bash Python C 100.000 5,18 ms @ 75 … Continued
short facts: supported i2c-speeds: Standard-Mode (100 kHz) and Fast-Mode (400 kHz) supported 1wire-speeds: Standard-Mode and Overdrive-Mode 8 independent 1-wire channels (1 active channel per-time, default-channel = 00) 8 possible i2c-adresses (selectable via 3 pins) supports 1-wire signal-optimization (3 possiblities: normal-resistor, … Continued
to set the speed you have to load the module with the corresponding option for speed (e.g. for 32k Baudrate). list the actually loaded modules: lsmod unload the i2c-module: rmmod i2c_bcm2708 load the module with the speed-option: … Continued