red-scorp / SoftSPIB

Software SPI class for Arduino with support of not 8-bit aligned transfers
BSD 3-Clause "New" or "Revised" License
9 stars 4 forks source link

7-bit clock cycle Read(Rx) and Write(Tx) #3

Open MagnusPer opened 1 year ago

MagnusPer commented 1 year ago

Hi, Trying to decode my hot tub communication to make it available wireless. From my initial measurements I see the clock cycle is 7-bits and not 8-bit that is standard SPI. I see in the SoftSPIB library can configure transmission(Tx) but how about reception(Rx).

Link to my initial measurements - https://github.com/MagnusPer/Balboa-GS510SZ

red-scorp commented 1 year ago

Hi! I've neve tested the read feature. It was not needed in my application. Looking to following code fragment present in function uint16_t SoftSPIB::transferBits(uint16_t val, uint8_t bits):

''' bval = digitalRead(_miso); if (_order == MSBFIRST) { out <<= 1; out |= bval; } else { out >>= 1; out |= bval << (bits - 1); } '''

The read feature should work. Try it out