SPI pin labeling complaint
Rayman
Posts: 14,844
I've had to modify some SPI code recently from OBEX and I can't help but complain about the way people are labelling the SPI pins...
What I am trying to avoid is having the In and Out hooked up backwards (either by me or a customer...).
It appears to me that the majority of code is calling the pins DO and DI, presumably for data in and data out.
But, I think it would be better for everybody if they were called MOSI and MISO, like it is on Wikipedia...
Most chips I've seen, label the pins SI and SO for slave-in and slave-out, which is fine.
But, on the Prop side, I think they should be called MI and MO or the full MOSI and MISO.
Anyway, that's my little rant for the day. This is what happens when I stay up too late...
What I am trying to avoid is having the In and Out hooked up backwards (either by me or a customer...).
It appears to me that the majority of code is calling the pins DO and DI, presumably for data in and data out.
But, I think it would be better for everybody if they were called MOSI and MISO, like it is on Wikipedia...
Most chips I've seen, label the pins SI and SO for slave-in and slave-out, which is fine.
But, on the Prop side, I think they should be called MI and MO or the full MOSI and MISO.
Anyway, that's my little rant for the day. This is what happens when I stay up too late...
Comments
-Phil
I didn't like it at first, but that's the spec so I got used to it.
The full labelling is an attempt to clarify the age old problem of having the pin label at each end being the opposite labels. Traditional and intuitive labelling of wires says use the same label at both ends but this conflicts with the view point of data flow where the data usually goes in one direction on a particular wire and gets labelled accordingly.
I imagine that having these lines reversed messes up a lot of people.
People probably reverse regular serial lines a lot too, but I guess there's nothing to be done there... People just have to learn that TX goes to RX and vice versa...
Perhaps it is about time we put together a set of standards recommended naming for use by the prop pins such as...
And maybe it could be part of the GoldStandard??
Not really sure your SI and SO on 31&30 will help. I think it's just trouble, no matter what you do there...