What do you mean by "sync problem"? If your microcontroller is the master on the SPI bus he controls everything, so I do not see a requirement for any synchronization. I'm not familiar with the device (I think it was the one with the number of clock cycles different to a multiple of eight, right?), but with the bitbanging method you are able to transfer as many bits as you want. There is a for loop for your GAIN and there is a define of 128 for GAIN at the top of your code (currently not used), but I don't think the device wants additional 128 clock pulses for a gain of 128, does it?
↧