Hi,
in my first Gadgeteer project i want to use my Cerbuino to do some SPI.
I tried this code:
using System;
using Microsoft.SPOT;
namespace MFConsoleApplication1
{
using System;
using System.Threading;
using Microsoft.SPOT.Hardware;
public class Program
{
public static void Main()
{
SPI.Configuration MyConfig =
new SPI.Configuration(Cpu.Pin.GPIO_Pin1,
false, 0, 0, false, true, 1000, SPI.SPI_module.SPI1);
SPI MySPI = new SPI(MyConfig);
byte[] tx_data = new byte[5];
byte[] rx_data = new byte[5];
for (int j = 0; j < 5; j++)
{
tx_data[j] = (byte)j;
}
while (true)
{
for (int j = 0; j < 5; j++)
{
Debug.Print(tx_data[j].ToString());
}
MySPI.WriteRead(tx_data, rx_data);
Thread.Sleep(1000);
}
}
}
}
From https://www.ghielectronics.com/docs/45/fez-cerbuino-bee-developer#395
i took, that it uses PB3, PB4 and PB5 for SPI1, which are labeled as 11,12 and 13 on the board.
After successfully downloading my program to the cerbuino, i wasn’t able to see anything on pins 11,12,13 with the scope, except that MOSI is always HIGH.
I tried to use SPI2 in the Configuration, but that gave me an “System.ArgumentException”.
Can someone give me a hint?
I also can’t find out what the GPIO_x pins are on the Cerbuino board!?