chipKIT® Development Platform

Inspired by Arduino™

PICadillo SPI Channel 1 MOSI/MISO signals

Created Tue, 07 Jul 2015 04:19:42 +0000 by w5uxh


w5uxh

Tue, 07 Jul 2015 04:19:42 +0000

I often get a bit confused dealing with SPI. In both the Uno32 and Max32, I have managed to get SPI channels working with a 25LC256 EEPROM. On both boards I have the SPI jumpers set so the PIC32 is Master.

The PICadillo does not seem to have any jumpers to set Master/Slave. I intend to use SPI Channel 1, connecting to the 6-pin SPI header.

My confusion is the nomenclature. The PICadillo data sheet has a table that lists MOSI as being on SPI header Pin 1 and MISO on SPI header Pin 4. Based on the MOSI and MISO labels, I expect to connect MOSI to the SI input pin on the EEPROM chip, and MISO to the SO output pin on the EEPROM chip.

My confusion is that the datasheet table indicates MOSI, chip pin 49, is serial port pin SDI4. MISO, chip pin 50, is SDO4. So the "Master Output" SPI signal seems to map to a chip pin where the label, SDI4 sounds like an input.

Hopefully this is just a quirk of nomenclature where "input" and "output" are referenced opposite of what I would expect.

Is it correct that the SPI header pin 1 (SDI4 / MOSI) is an output that goes to the eeprom data input pin?

Thanks.


w5uxh

Tue, 07 Jul 2015 21:50:38 +0000

Reply to self: I hooked up the 25LC256 socket and first tested with a scope to determine that the MOSI and MISO labels do seem to be reversed in the table on datasheet page 21, Section 6.3. I then installed the chip and verified that my test routine for the EEPROM works when I connected SDO4 to the SI input of the chip.

I think the MOSI label should be on the line with SDO4 and the MISO label should be on the line with SDI4.

Even if I am confused about some of this, the chip works so that settles it for me :D


majenko

Tue, 07 Jul 2015 23:14:50 +0000

Yeah, it looks like James got his MOSIs and MISOs mixed up there... MOSI is SDO, MISO is SDI. Master Out = Serial Data Out. Master In = Serial Data In.

You can see it better in the table on page 8 where pin 4 of that header is clearly labelled as SDO4 and pin 1 as SDI4.