AnsweredAssumed Answered

MC33816 solenoid controller SW driver question

Question asked by Dmitriy Plestsov on Mar 17, 2016


I have trying the MC33816 Solenoid Controller. MC33816 Developer Studio SW generates C code for chip drive.  In the datasheet (item I find out that SPI could transfer up to 32 bytes by one frame. But in function void download_RAM(int target) of generated functions.c file I do not see some code that would  check the transferedSPI frame length. Altough this code part is present in void download_register(int r_target) function. Here it is:




      // If the size of the transfer is greater than the maximum SPI burst

      // transfer size, set the size to the maximum SPI burst size and store

      // the remainder size for use in the next SPI transfer

      if (r_size > MAX_SPI_MODE_A_TRANSFER_SIZE)


         remainder_size = r_size - MAX_SPI_MODE_A_TRANSFER_SIZE;

         r_size = MAX_SPI_MODE_A_TRANSFER_SIZE;




         // The size is <= MAX_SPI_MODE_A_TRANSFER_SIZE

         // so there is no remaining data to be sent

         remainder_size = 0;




Question: Why there is no SPI frame length cheking code in void download_RAM(int target) function ?


Thank you in adnvance.

Best regards