MISO, MOSI, same difference

I think I’ve already ranted on this topic previously, so I’ll try to be brief this time around. We’ve had a fair bit of trouble with various peripherals on the board, particularly the Bluetooth module, due to the extremely sad state of affairs that is technical documentation in general. The latest casualty of dodgy documentation appears to be the magnetometre; it looks like we’ve hooked up the SPI data pins swapped over. Whoops. Looking at the data sheet now, it’s actually written the way it should be – it labels it’s pins as MISO and MOSI (Master-In, Slave-Out and vice-versa, respectively), which is the standard for SPI. D’oh. Whoever worked that bit out probably assumed the labels were relative to the magnetometre (i.e. it treats itself as the master, which is wrong, but what is written in other datasheets for other things).

So the only device which actually has a correct, straight-forward datasheet, we screw up. D’oh. :)

Luckily it’s not really that big a deal to fix; just swap the wires. Or we could even just write an SPI interface in software, since the magnetometre can only run up to 1MHz anyway, but it’d be nicer on all counts to just swap the pins. Ah well.

Leave a Comment