Valid GPIO configuration/combinations for SPI2 are listed in the Hardware Interfaces Guide online here: WICED Smart Hardware Interfaces
There is also sample code in the document which shows how to initialize SPIFFY2 in the master or slave roles, and how to write and then read a byte from a SPI slave/master.
Per your question, physical pin 25 is tied to the EEPROM WP pin internally, so the alternate functions listed in the current datasheet are not available within the module (only the SOC). In addition, a 10K pull-up is recommended on this pin as well.
Per below, the datasheet is being updated now to reflect these changes:
OK, thanks for the quick response!
I will switch over to use
If I don't plan to drive /WP, do I still need the external pullup?
We are now recommending the pull-up because a handful of users have observed errors while booting when the pin was not used.
Also, if you want to start with a working sample for SPI2, there is the spi_comm_master sample app in SDK 1.1.0 which uses a MASTER2_P24_CLK_P04_MOSI_P25_MISO combination.
Thanks.. i'll put in the pullup.
Also, for the record, using P02 as MOSI doesn't seem to work either. I am using P04 successfully.
I'm using this configuration 'MASTER2_P24_CLK_P04_MOSI_P25_MISO' on SPI_2.
But interesting thing is that I can't find correct mapping from the real output signal.
From picture as above, P4 should be the MOSI, but it turns out as more likely a CLK, and P25 is more like the MOSI as I trying to send 2 data byte '0x55' and '0xcc' in every second.
Besides, I can't find CS working at all. I use P15 as CS (the sample code in pressure_sensor.c).
I have recently worked on this and thought I had issues but it was user (me) error combined with less than stellar documentation. This pins map as indicated on the label (I am using the TAG board), 'MASTER2_P24_CLK_P04_MOSI_P25_MISO' the issue I had was conflict on my CS with PUART. If you are remapping it make sure that you don't have a conflict. Also obey the BCM920732HW Application Note Restriction on the SPI.
1 of 1 people found this helpful
Although I am not out of the woods yet on my BMC20737 TAG SPIFFY2 MASTER issues, here are some things I found useful that might help:
1. If you are using Puart (TAG board does) make sure your MISO/MOSI are on the same bank (high or low). My TAG board and app software uses the high bank for pUART.
2. Check your datasheet for pin port pairings. For example if P8 and P33 are paired so that both ports use the same pinout (as they are on the 737) you must disable the unused port (disable both input and output).
3. Check the TAG board schematic and try to use ports that are not connected to anything like UARTs.
4. Consider using the TPs on the schematic if header pins are not available.
5. If your port doesn't work, see if you can find another one.
6. Try different speed. I seemed to have best result so far with 1000000, but have only tried 500000 and 2000000. 500000 didn't work at all and 2000000 gave funning signals for the data line. Clock looked ok I think.
7. My TAG board uses P32 and P33 for pUart, so stay away from those (or disable pUART) and anything that might be paired with them, e.g. P8.
8. I found that on my TAG board the dip switches must be set as follows: 1, 4, 6 ON all the rest OFF for my application to work. Not sure why but check schematic to see if any switches are connected to the header pins you are using and consider switching those off during application execution. (switch all back on for downloading program).
Hope somebody finds this useful. It took quite a few hours to learn all these tricks.