2
Vote

SPI and Pins.GPIO_PIN_D4

description

As discussed at http://forums.netduino.com/index.php?/topic/1844-pin-4-cant-be-used-at-a-high-speed/

I just tested this bug with the latest build of 4.2 rc3 I have and it's still there :-)

Schematic attached, repro-code:
        SPI.Configuration Config = new SPI.Configuration(
             Pins.GPIO_PIN_D4,
             false,
             0,
             0,
             true,
             false,
             1000,
             SPI_Devices.SPI1
         );

        SPI Leds = new SPI(Config);

        byte[] WriteBuffer = new byte[1];
        while (true)
        {
            WriteBuffer[0] = 1; Leds.Write(WriteBuffer);
            Thread.Sleep(100);
            WriteBuffer[0] = 2; Leds.Write(WriteBuffer);
            Thread.Sleep(100);
            WriteBuffer[0] = 4; Leds.Write(WriteBuffer);
            Thread.Sleep(100);
            WriteBuffer[0] = 8; Leds.Write(WriteBuffer);
            Thread.Sleep(100);
            WriteBuffer[0] = 16; Leds.Write(WriteBuffer);
            Thread.Sleep(100);
            WriteBuffer[0] = 32; Leds.Write(WriteBuffer);
            Thread.Sleep(100);
            WriteBuffer[0] = 64; Leds.Write(WriteBuffer);
            Thread.Sleep(100);
            WriteBuffer[0] = 128; Leds.Write(WriteBuffer);
            Thread.Sleep(100);
        }

file attachments

comments

Garrcomm wrote Oct 18, 2011 at 9:01 PM

Ps. I've tested this on:
SolutionReleaseInfo.solutionVendorInfo: Netduino Plus (v4.2.0.0 RC3) by Secret Labs LLC
SoftwareVersion.BuildDate: Oct 16 2011

Garrcomm wrote Feb 6, 2012 at 5:31 PM

Still exists in 4.2 RC4 ;)

davervw wrote Mar 18, 2012 at 4:02 AM

I reproduced this in 4.2 RC4 trying to talk to a Microchip 25AA1024 EEPROM at 20MHz. Couldn't use chip select for GPIO_PIN_D4, but all the others in the range GPIO_PIN_D10..GPI_PIN_D2 work okay.