Main Site Documentation

SPI on FEZDomino


#1

Hi,

I’m trying to get the SCP1000 pressure sensor working with the FEZDomino but I’m unsure how to read / write from an SPI address.

I’m doing something like this:

        private static void InitPressureSensor()
        {
            Thread.Sleep(1000);

            byte[] arrTxData = { 0x00 };
            byte[] arrRxData = new byte[1];

            m_PressureSensor.WriteRead(arrTxData, arrRxData);

            Debug.Print("SCP1000 ASIC version: " + arrRxData[0].ToString());
        }

but I’m not getting the expected result. According to the datasheet it should return 0x03 but I’m getting 0x00.


#2

That looks correct. Is this how SCP1000 work? You send 0x00 and get back version?

Did you check the chip select pin and the SPI bus? There are 2 on FEZ :wink:


#3

I believe so. I’m doing:


        static SPI.Configuration m_SPIConfig = new SPI.Configuration((Cpu.Pin)FEZ_Pin.Digital.Di10, false, 0, 0, false, true, 250, SPI.SPI_module.SPI1);
        static SPI m_PressureSensor = new SPI(m_SPIConfig);


#4

Hmmm, I’m not measuring any voltage on the 3.3V header pin. The FEZDomino is connected only through the USB. Do I need an external supply? The FEZDomino brochure says it’s only needed for the +5V output.


#5

Sorry, my fault. I’m using the wrong power connections.

Problem is, it’s still not working. :’(


#6

It may have something to do with the firmware. My FEZDomino has firmware 4.0.2.0 and I’m using SDK 1.0.6 which requires firmware version 4.0.3.0. It also had something in the release notes about SPI writes.

I’m now going to attempt upgrading to the latest .NETMF SDK and upgrade the firmware at the same time.


#7

Like the big notice on the download page, always start by loading new firmware


#8

yes, get them all - in order !

Visual Studio 2010
MS Net Framework SDK 4.1
GHI SDK

then apply the firmware to your physical device(s).

It is absolutely critical that you have ALL these in place, to make sure you have no incompatibilities.


#9

OK, I’ve updated my firmware to 4.1.1.0 and changed my project to run on .NET MF 4.1 but…it’s still not working!

Measuring with a voltmeter on the CS (chip select) pin I notice it remains high even though I run the code show above in an endless loop. I also checked with a frequency meter on the SCK pin and it remains a 0hz, so there’s no activity it seems.

Has anyone got anything to work with the SPI bus on FEZDomino?


#10

I removed the SCP1000 and put a scope on the pins directly and I now see the SCK and I believe the MOSI and CS working. When I put in the SCP1000 I see no signal on the SCK and nothing on the MISO and MOSI, I do see activity on the CS, though.

I have come to the conclusion that my SCP1000 breakout board is defective.


#11

I wouldn’t be surprised if the SCP1000 was the cause, these are extremely difficult to reflow with less than a few million dollars of pick and place + huge reflow ovens. They are incredibly sensitive.

If you are using the breakout from SFE, they don’t have a very good average for success on theirs although it has been improving lately with their new technologies.


#12

Yes, I was using a breakout board from Sparkfun. I’ve ordered another one, but I’ll make sure it works right out of the box this time. I had the other one lying on the shelf for almost three years before using it.


#13

On a lighter note: it only took me about half an hour to get my Venus GPS working with FEZDomino ;D


#14

:dance: half an hour :clap:


#15

If the other one was 3yrs old… then yeah not surprised it doesn’t work. Thats from back in the days of home made or modded reflow ovens and hand pick and place. They probably killed the sensor (so easy to do… done a few myself).

Great work on the venus gps! Try doing anything other than blinking a LED on arduino in 30 mins haha.


#16

Here my Venus GPS setup.