Hi All,
I am trying to hack some G-35 lights (similar to the Arduino project here: http://www.deepdarc....ristmas-lights/).
The lights need a 100KHz control signal that consists of high and low bits. I assumed that using the SPI port on the Netduino was the only way to achieve writing high and low bits this quickly (switching every 10us).
However, I have run into two issues using the Netduino Plus 1 SPI ports:
1) When I set the SPI clock rate to 100KHz, the SCLK port and MOSI ports do NOT seem to follow the 100KHz clock rate. I need a 100KHz clock rate. (note: after some testing, it only seems to be stable when set to some value >= 200KHz). I define the port like below:
2) Because I need to write ~80 bits to the SPI, I need to send a byte array to the port. When I do this however, I can see a small delay between bytes (using a logic analyzer). Some other post here describes the Delay between consecutive bytes being hardcoded to 0, but there still being a delay because of the way the driver is written. This delay is screwing up the way the lights are interpreting the bits. I need a way to remove this delay between bytes. How I write the bytes is below:
byte[] writebuffer = new byte[16];
//Some code to set all the byte values
//......
objSPIBus.Write(writebuffer);
So my questions are:
1. Is there a way to resolve these issues (either by some update/hack, using the Netduino Plus 2 instead, etc)?
2. If there is not a way to resolve the issue, is there any other approach for doing something like this on the Netduino Plus 1, without using SPI?
I am currently using:
Netduino Plus 1
.NET micro framework 4.2
Netduino firmware 4.2.0