필터 지우기
필터 지우기

NI 8452 bitrate issues

조회 수: 5 (최근 30일)
Myles Joseph
Myles Joseph 2018년 3월 20일
댓글: Walter Roberson 2019년 11월 13일
I am working with the NI 8452 SPI I2C reader for the Instrument Control Toolbox Support Package.
I would like to read a device at 20 MHz as the pamphlet advertises but am seeing some strange results.
It takes my desktop 0.0416.. seconds to digest 9840 bytes... 9840*8 = 78720 bits... / .0416 seconds ~ 1.8 MHz
perhaps there is a bit of overhead in the protocol... but I cant imagine that much?
any help appreciated
spiObject = spi('ni845x', 0, 0);
spiObject.BitRate = 20000000;
spiObject.ClockPhase = 'SecondEdge';
spiObject.ClockPolarity = 'IdleHigh';
spiObject.ChipSelect = 0;
connect(spiObject);
pause(1)
tic
read(spiObject,9840);
toc
disconnect(spiObject);
2017b
  댓글 수: 2
Engineer18
Engineer18 2019년 11월 13일
Excuse me,
I want to know if NI-845x I2C/SPI Interface Support Package is 32-bit or 64-bit .
Walter Roberson
Walter Roberson 2019년 11월 13일
It is available in 64 bits for all supported releases, R2014b and later.
It might possibly also work on Windows 32 in R2014b and R2015a and R2015b

댓글을 달려면 로그인하십시오.

채택된 답변

Priyank Sharma
Priyank Sharma 2018년 4월 4일
Even though the clock rate is 20 MHz, there is a timing overhead for each SPI transaction. This timing overhead is mainly caused by the vendor driver.
You can observe the duration for a transaction by opening NI IO Trace:
1. In Tools > Options > View Selections, select Duration as one of the columns
2. Start capture
Execute the code in MATLAB and compare the timing for each read function execution with the duration for ni845xSpiWriteRead driver function. This appears to be a limitation of the vendor's SPI Basic API which the MATLAB spi interface calls.
The vendor provides an SPI Stream API, which is probably a better option for reading data sent from the FLIR Lepton. However, the spi interface in Instrument Control Toolbox does not support calling the vendor's SPI Stream API functions.
To read more about the SPI Basic API vs the SPI Stream API, open help file for NI-845x vendor API "845xAPI.chm" located in C:\Users\Public\Documents\National Instruments\NI-845x\Documentation
NI-845x SPI Stream API is a C based API, so there might be a workaround possible by calling the NI-845x SPI Stream API functions from MATLAB by using the MATLAB external interfaces functionality. The vendor provides C code examples in "C:\Users\Public\Documents\National Instruments\NI-845x\Examples\MS Visual C\SPI\Stream". You can try converting it to MATLAB by using LOADLIBRARY/CALLLIB or MEX.
  댓글 수: 1
Myles Joseph
Myles Joseph 2018년 4월 5일
I understand the issue, thank you for the response.
Unfortunate because this kit was purchased to meet a data rate requirement. This information is very useful to know when evaluating the capabilities of the device for future users!
I hope the Instrument Control Toolbox team gets around to it!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Instrument Control Toolbox Supported Hardware에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by