Jump to content
  • 0

Digital Discovery to collect 16 bit SPI data - multiple slaves with same CS, CLK, MOSI and individual MISO


JAlaj

Question

Hello 

I am looking to use Digital Discovery to capture 16 bit SPI data on multiple slaves, all slaves will have CS, MOSI and CLK shorted, and MISO line will be individual for each slave. I want to capture continuous data for 24 hrs and dump it in a  text file

I also want to power up the part using same HW, so that i can capture SPI right after power up

Pls suggest, 

Thanks,

Jalaj

Link to comment
Share on other sites

Recommended Posts

  • 0

Hello @attila

Could you please guide me towards the implementation of I3C through Digilent discovery. Our new project will be utilizing I3C. Therefore, we will have to send I3C patterns via Digital discovery and further analyze them. In addition, we will have to vary timing with proper control. 

Thanks,

Shalin

Link to comment
Share on other sites

  • 0

Hi @Shalin

You can generate custom pattern with the Pattern Generator and add custom interpreter in Logic Analyzer, but the existing I2C interpreter may also be suitable.
I'll try to implement I3C support later, but unfortunately cannot give you a deadline for this.

Link to comment
Share on other sites

  • 0

Hello @attila

I want to bring to your concern regarding a bug in receiver function (rgRX) of labview. When I send 32 bit pattern from Digilent pattern generator and capture 32 bit rgRX receiver pattern response, it comes constantly as all zero's in labview. I captured the response through Saleae LA and I am able to see 32 bit rgRX pattern there. However, the digilent rgRX is unable to capture the 32 bit pattern. Please check the rgRX functionality for 32bit response. 

I am attaching the screenshot below of 32-bit rgRX response captured through Saleae LA and the Labview VI below for your reference.  

Thanks,

Shalin

image.thumb.png.7234dac51348926c98d54e82ab3526e3.png

SPI_read - Annapurna.vi

Link to comment
Share on other sites

  • 0

Yes, I am seeing rgRX out with cRX = 32. 
I tried but it only shows rgRX for 4 bit and not for 16 bit and 32 bit. 
I would request you to please run my VI once. It will help in identifying the issue.

Link to comment
Share on other sites

  • 0

Hello @attila

Please check the attached zip file below which contains the VI alongwith supporting libraries. I am not able to achieve the value of rgRX from digilent while I can see the MISO output data (rgRX) on other LA. Please try to run this VI and see if you get any output. 

Thanks,

Shalin

SPI read.zip

Link to comment
Share on other sites

  • 0

Hello @attila

Thanks for taking out time and making the effort. The rgRX is still appearing as zero. I probed this response on Scope and it shows that a very weak output MISO response of level 840 mV is appearing (attached screenshot below). Due to a weak output response, the digilent digital discovery DIO pin is interpreting this 840 mV as zero. 

Is there a way out , that this weak output signal response of 840 mV is interpreted as 1 by the digilent and shows 1 in the rgRX ? 

Is it possible to capture this weak signal by using the MISO high-speed LA pins (0-23) and adding a trigger ?    

MicrosoftTeams-image (1).png

Edited by Shalin
Link to comment
Share on other sites

  • 0

Hi @Shalin

Try lower IO voltage. Eventual pullup which can help if the driver has some impedance.
The absolute minimum is around 0.96V but even if you try lower value it will limit to what it can. (The minimum recommended for the FPGA IO supply is 1.1V)

Here with 0.95V the threshold is 0.55V/0.65V
AD3 Wavegen is connected to one DIO of Digital Discovery and another DIO outputs the logic level of the input (with ROM Logic) which is connected to AD3 Scope 1.

image.png

image.png

Link to comment
Share on other sites

  • 0

Hello @attila

According to our specification, we need to set CLK, MOSI and SS as 3.3V. When I lower the IO, it shows no response. My LA which is capturing has been set to 1.2volts digital level. At this level only, I am getting the MISO response of 840mv. Mainly, I will have to set the LA level to 1.2V to capture the MISO waveform. 

image.png.024d5e32540f2b624f2ba1a1da2dbaa4.png

Is it possible to capture this weak MISO signal by using the high-speed LA pins (0-23) and adding a trigger ? 

Once I fetch the MISO signal using Digilent LA pin, then is there a way to set the rgRX in the VI with the array of data received from the LA pin ?

Thanks,

Shalin

Edited by Shalin
Link to comment
Share on other sites

  • 0

Hi @Shalin

The supply voltage applies to all DIO and DIN channels.
The IO and IN channels have different frontends, see:
https://digilent.com/reference/test-and-measurement/digital-discovery/reference-manual#io_level_translators
https://digilent.com/reference/test-and-measurement/digital-discovery/reference-manual#input_dividers
The SPI and other protocols swap the capture order of IO IN channels, so DIOs are first. To use a DIN channel as MISO configure data 1 to be 16+DINnumber, like FDwfDigitalSpiDataSet(hdwf, 1, 16) for DIN-0

Link to comment
Share on other sites

  • 0

Hello @attila,

 Thanks, it is working absolutely fine now. Meanwhile, I need to know the status of development of I3C support in Digilent. I will be requiring to use Digilent for our upcoming I3C based project. I will be performing automation through LabView by using Digilent I3C libraries. 

Thanks and Regards,

Shalin Verma

Link to comment
Share on other sites

  • 0
On 8/9/2023 at 12:42 AM, attila said:

Hi @JAlaj

In newer sw version the CS can be controlled by hardware.
With the SPI/Custom or Script or API if the .Start/Stop() is not called the .Read/Write() will automatically assert CS.

image.png

Hello Attila,

I am trying to capture SPI data every 1ms. Its a 16 bit SPI capture. My target is to capture data for 3 hours. Periodic capture is required as i need to perform FFT on this data. I am unable to achieve this. Please suggest the best way

Link to comment
Share on other sites

  • 0
2 hours ago, attila said:

Hi @JAlaj

If you are listening on signal use Protocol/SPI/Spy 'Receive to File' or for SPI master write a Custom script or Sensor for precise hardware timer.

Thanks Attila

I was trying that but i couldn't understand how FIFO will work here. Since Digilent DD has limited memory, it has to dump data into file to empty buffer and collect next set of data. But how do i make it synchronous. Would be great, if you can share one example code. I was trying to follow example code in script, but didn't get much help

Link to comment
Share on other sites

  • 0
On 3/25/2024 at 8:08 AM, attila said:

Hi @JAlaj

If you are listening on signal use Protocol/SPI/Spy 'Receive to File' or for SPI master write a Custom script or Sensor for precise hardware timer.

Hi Attila,

Is there anyway to mimic in labview the "Sensor" feature implemented in the Waveforms GUI?  We have a 5 axis sensor that I would like to read at very consistent read rates.

Below is a test case I have done using the a script in Sensor tab.  I found that the longer the iterations, the outcome is worse....i.e. timing is not correct.

image.png.5dec187ac62c2f92a0aaf977eda935a6.png

Link to comment
Share on other sites

  • 0

Hi @bobql

1. The Sensor tab on execution first calls the initialize function, where sensor register, global variables, file initialization... can be performed.
2. Calls the software loop function, without executing it in the device, to build a pattern with the transfers, like for CS, CLK and MOSI.
3. Starts to generate this pattern with hardware timer at the specified rate and iterations, and at the same time it captures the transfers.
4. Decodes the received MISO bits by software call of loop function, without executing it in the device.
5. At the end calls the finish function, where sensor register shutdown and file finalize can be performed.
The software timing of the software function calls in not precise but the pattern generation is, which are basically loop function calls in hardware.

Similar can be done in SDK.
Pattern with digitalout functions, see DigitalOut_SPI.py example, repeat can be set to 'infinite'.
Steps 3-4 can be merged, to receive and decode simultaneously, see DigitalIn_Spi_Spy.py. In Sensors tab these are separate since the sw loop execution takes some time and it would be a bottleneck at high rates.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...