.Net Micro Framework SPI Bus (Fill more than 1 SPI Device)

Millimeter Wave Products 1 Reputation point
2021-06-24T18:34:49.993+00:00

Hello,

I currently have working synthesizer software to test and lock any frequency on a Synthesizer Microcontroller.

Currently using this amazing library:
https://social.technet.microsoft.com/wiki/contents/articles/22917.net-micro-framework-spi-the-high-speed-serial-bus.aspx

*****Is it possible to create more than 1 instance of the SPI class in order to populate 2 or more SPI's at once on a single microcontroller board?
In other words, is it possible to create another SPI.Configureation spiConfig2 = null; then load settings for another chip to simultaneously run while spiConfig1 is running.*****
.
.
private static SPI.SPI_module spiModuleNumber = SPI.SPI_module.SPI2;
private static SPI bus = null;
private static SPI.Configuration spiConfig = null;
.
. //here is the instance running (would it be possible to create a second InitSPI2??)
public void InitSPI(uint khz)
{
if (bus != null)
{
bus.Dispose();
}
spiConfig = new SPI.Configuration(Pin.PB12,
false, // Chip Select, active-low is false
10, // microseconds setup time
10, // microseconds hold time
false, // Clock low on idle is false
true, // clocking on rising edge is true, falling edge is false (scope shows true samples on second edge).
khz,
spiModuleNumber);
bus = new SPI(spiConfig);
}

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,648 questions
0 comments No comments
{count} votes