spi.net-micro-frameworknetduino

Is it possible to customize SPI of MICROFRAMEWORK?


I am using NETDUINO. I'd like to communicate with a device using SPI.
in order to transfer data to the device, I need the following steps.

  1. make some clock pulses
  2. send the data at SPI Standards
  3. some more clock pulses
  4. trigger a LATCH to process the received data

writing to SPI is no problem, I generate the clock and the Latch trigger outside the SPI method.
my problem is reading from the device:
I need to send the address to the SPI then it returns the relevant data. SPI.WriteRead is writing the data, then read it. but since theres no LATCH trigger, the device is not processing the received data.

I need that LATCH trigger after writing, and before reading. How can I generate Latch trigger while using SPI.WriteRead method ?


Solution

  • my solution:
    I defined two different SPI slaves.
    1. My real device
    2. Virtual Device

    the read process is as follow:
    1. Write the data I want to my device.
    2. generating the pulse as required
    3. WriteRead to the virtual device (Since in my case I need the SS to be disabled)
    (My device will respond after the pulse)

    Some more useful info regard spi.WriteRead
    http://wiki.netduino.com/Using-SPI-Write-and-WriteRead.ashx