4 Replies Latest reply on Aug 19, 2019 4:51 AM by PaPr_4065716

    Why has the I2C write buffer (SCB_I2CMasterWriteBuf) size (cnt) been reduced from uint32 in PSoC4 to uint8 in PSoC5 ?

    PaPr_4065716

      The I2C component in PSoC4 was able to write the contents of a modest OLED display (1kB data) in one transaction, easily. It is not possible with a PSoC5. Both are 'fixed function' SCB resources.

       

      The PSoC4 component datasheet quotes the following API for the write:

      uint32 SCB_I2CMasterWriteBuf(uint32 slaveAddress, uint8 * wrData, uint32 cnt, uint32 mode)

      Description:

      Automatically writes an entire buffer of data to a slave device. Once the data transfer is initiated by this function, further data transfer is handled by the included ISR.

      Enables the I2C interrupt and clears SCB_ I2C_MSTAT_WR_CMPLT status.

      Parameters:

      uint32 slaveAddress: Right-justified 7-bit Slave address (valid range 8 to 120).

      uint8 wrData: Pointer to buffer of data to be sent.

      uint32 cnt: Number of bytes of buffer to send.

       

      Now my project doesn't fit in a PSoC4M anymore, so I 'upgraded' to a PSoC 5LP.  Everything seemed bigger and better, except that my display code was buggy.

       

      The PSoC5  component datasheet says:

      uint8 I2C_MasterWriteBuf(uint8 slaveAddress, uint8 * wrData, uint8 cnt, uint8 mode)

      Description:

      This function automatically writes an entire buffer of data to a slave device. After the data transfer is initiated by this function, the included ISR manages further data transfer in byte-by-byte mode. Enables the I2C interrupt.

      Parameters:

      uint8 slaveAddress: Right-justified 7-bit slave address (valid range 0 to 127).

      uint8 wrData: Pointer to the buffer of the data to be sent.

      uint8 cnt: Number of bytes of the buffer to send.

       

      This seems like an enormous retrograde step.  I was under the assumption the 5LP was designed to be technically superior to the PSoC 4 series.  What is the reason for going from 32-bit capability to 8 on such a common interface?  If there is an option to specify the size of this buffer in the 5LP I2C component configurator I haven't found it.

       

      Interestingly the return value of this API function also has been reduced, as has the 'mode' parameter type.  Both the PSoC4 and 5LP return values (from this particular API function) require 3 bits. The PSoC4  expects uint32, and the PSoC 5LP expects uint8.  Eight bits for this is reasonable; was the change of cnt to uint8 possibly a mistake made while rationalising the API return value (and 'mode' parameter) type?

       

      Any explanation or suggestion for a workaround with 5LP would be really appreciated.

       

      Paul