Chargement…
Chargement…
The module sequences initialization and cyclic reads of an MCP23017. The I2C controller is provided: the FSM to complete only exchanges command and acknowledgement signals with it.
Behavior
first_init='1' selects the initial configuration phase; the FSM then waits for i2c_done.start='1' starts a read and keeps start_i2c='1' until the transaction completes.i2c_done='1', the FSM waits 125,000 clk cycles, which is 500 µs at 250 MHz.get_data_done pulses during the final acknowledgement state, then the FSM returns to its waiting state.reset_n='0' restores the FSM and counter to their initial state.clkreset_nstarti2c_donefirst_initstart_i2cget_data_doneRefer to the official MCP23017 documentation for the device registers and I2C protocol.