Messing with state machine and spi protocol