Is this SPI speed set from the Raspberry Pi SPI read block correct?
Show older comments
When using the SPI read block (2017b, rpi3b) - I believe the SPI bus speed setting in the generated code is incorrect, can anyone confirm?
I set the spi speed under configuration parameters -> hardware implementation -> target hardware resources -> SPI to 16000kHz but the generated c code file it is still hard coded to 500kHz.
Is there a way to edit the c file and recompile to test?
/* Start for MATLABSystem: '<Root>/SPI Register Read' */
95 untitled_DW.obj.isInitialized = 0;
96 obj = &untitled_DW.obj;
97 untitled_DW.obj.isInitialized = 1;
98 SSPinNameLoc = SPI0_CE1;
99 MOSIPinLoc = MW_UNDEFINED_VALUE;
100 MISOPinLoc = MW_UNDEFINED_VALUE;
101 SCKPinLoc = MW_UNDEFINED_VALUE;
102 obj->MW_SPI_HANDLE = MW_SPI_Open(0U, MOSIPinLoc, MISOPinLoc, SCKPinLoc,
103 SSPinNameLoc, true, 0U);
104 MW_SPI_SetBusSpeed(untitled_DW.obj.MW_SPI_HANDLE, 500000U);
1 Comment
Myles Joseph
on 25 Jan 2018
Answers (1)
Myles Joseph
on 25 Jan 2018
Categories
Find more on MATLAB Support Package for Raspberry Pi Hardware in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!