Dredwerker,
So there’s two components to SPI - the SPI core connections (MOSI, MISO, SCLK) and the device chip select (CS) line.
If you go into Visual Studio, create a new Fez Panda II project, and in program.cs just after the BOOL LedState line is defined, and start typing:
new SPI.Configuration(
you’ll see the auto-complete start telling you information about SPI.Configuration. This tells you what all those parameters are for.
So from this, GPIO_Pin1 is the Chip Select pin, and SPI1 is the SPI module used. If you look at the Panda II user manual you can see the pin mappings, and SPI1 equates to Di11, Di12, Di13 (as MOSI,MISO, SCLK respectively).
The two SPI.Configuration lines you show are functionally exactly the same. If you use the GHI naming of an IO pin, you need to cast it back to a (Cpu.Pin) as the second code snippet does.
So this should tell you enough about SPI and an indication of the wiring needed. But the good news is that you don’t need to use those pins, you have options !
On the Panda II you can optionally use SPI2, which is D38, D36, D35 on the 40-pin connector.
For the Chip Select (CS) pin you can choose to use any IO port you like - select one that won’t cause you a conflict with anything else that you’re likely to do in this project, but you can also move it if you need to at any time simply by changing the first parameter in the configuration.
I haven’t checked the pressure sensor’s wiring diagram, but you need to connect those 4 pins, plus VCC and GND at a minimum.
hope that helps… if you have any more specific questions, ask away 