2019-09-06 10:22 AM
2019-09-06 11:08 AM
I've shared a non-clock stretching SW I2C Single Master implementation by GPIOs on this forum.
SPI for LCD displays too can be implemented by SW as long as the speed is non critical.
2019-09-06 12:15 PM
You're driving GPIO pins up an down, in a way that conforms with the waveforms described in the data sheet for the I2C/SPI part you're wanting to communicate with, and reading back data on other GPIO pins.
It's pretty basic stuff, not sure it necessitates a 12-step program
2019-09-06 12:19 PM
Well in this case, at list make it rugged: before generating the start bit, if SDA is low, blindly send 9 stop bits.
Try without it and inject glitch or get through a connector and feel the difference.
If you only followed the spec, you are not done yet with the real world.
2019-09-06 12:43 PM
UM10204 - 2C-bus specification and user manual
3.1.16 Bus clear
If the data line (SDA) is stuck LOW, the master should send nine clock pulses. The device that held the bus LOW should release it sometime within those nine clocks. If not, then use the HW reset or cycle power to clear the bus.
2019-09-06 12:52 PM
Implementing bus error recovery is a good practice:
If you only followed the spec, you are not done yet with the real world.
If you want to maximize profit, you need to keep customer returns to a minimum (except if it was a gift which it converted back to cash with gift receipt).
For this, you need to make sure (like a plug test) that your device works in real world with most implementation. Take USB. If your device is spec certified but there is a cheap popular crappy cable out there, you maybe compelled to try to be compatible with that non spec compliant cable, hence improving your device first hand experience with customer, which might boost your brand vs others.
It's the same with phones and carriers, all are 4G but what you want is best connectivity where you go.