Hi Paneri,
I am the developer of the SW driver you shared screenshots from. A few notes and recommendations follows:
1. Time values in the BCC datasheet do not count any SW overhead. They asume time for transmission of SOC command (at the physical layer = SPI) + conversion + reading the values back. No time for pre- (and post-) processing of data at MCU is counted.
2. I suppose you are using S32K144 MCU with some code based on the examples provided with the SW driver. Therefore, the time mentioned in the datasheet is extended by packing the SPI frames, calculating/checking CRC and finally by not negligible time overhead of used S32K144 SPI SDK in your case.
3. If you would like to decreace the time for measuring the current to the possible minimum, I would recommend:
- Calling of BCC_Meas_IsConverting() in getMeasurements() is not needed if your BCC_MCU_WaitUs() is implemented accurately. This can be removed as one more read-request causes a time overhead.
- If you are interested only in the current measurement, read back only the MEAS_ISENSE1 and MEAS_ISENSE2 registers (instead of 30 registers by BCC_Meas_GetRawValues()). This will save really a lot of time.
- Optimize pre-processing: Pre-create the content of sent SPI frames including CRCs - i.e. write your own optimized code and do not use the BCC SW driver to dynamically create the frames.
- Optimize SPI transfer: For the SPI transmission, do not use the SDK SPI driver in BCC_MCU_* functions but implement a so-called "pooling" approach for the LPSPI periphery to directly access the LPSPI periphery registers. When the periphery is well configured, only (+-) three register accesses are enough to start the SPI transmission including the movement of transmitted data to LPSPI FIFO.
The same with reading the data received from SPI MISO to LPSPI periphery.
Best regards,
Jan