This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430FR2633: Captouch library I2C register mode buffer sizing

Part Number: MSP430FR2633

Tool/software:

Hello,

I have a customer who's looking at using the captivate library in I2C register mode, and he had some questions on supported message formats and supported lengths that we were hoping to clear up?

In register mode, does the library support the general purpose packet? It doesn't seem to get referenced in this operation mode.

Another question on the general purpose packet is that the captivate technology guide suggests that the max length of the general purpose packet is 58 bytes, but in code I see the I2C transmit buffer is capped at 32 bytes, and then elsewhere I see the tx ping pong buffers get set up at 48 bytes. What's the max length of the general purpose packet?

The last question was in register mode, for a cycle packet does the firmware support sending all 12 channels of data in one cycle packet? Again since the I2C tx buffer is 32 bytes which would not support 12 * 4 bytes of data + the packet header.

Munan

  • Hi Munan,

    Oooo, those are really good questions.  I'll have to dig to find some answers.  I'll see what I can find before end of day tomorrow, Friday.

  • Hi Munan,

    I apologize for not getting back to you as promised.

    In register mode, does the library support the general purpose packet? It doesn't seem to get referenced in this operation mode.

    See: https://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/CapTIvate_Design_Center/latest/exports/docs/users_guide/html/CapTIvate_Technology_Guide_html/markdown/ch_library.html#format-general-purpose-packets

    Another question on the general purpose packet is that the captivate technology guide suggests that the max length of the general purpose packet is 58 bytes, but in code I see the I2C transmit buffer is capped at 32 bytes, and then elsewhere I see the tx ping pong buffers get set up at 48 bytes. What's the max length of the general purpose packet?

    General Purpose protocol was designed for sending data from the MSP430 to the GUI via USB. The max number of bytes in a USB packet is 64 bytes. If you can send 64 or less bytes at a time, it is more efficient, due to the USB packet overhead.  Now, not exactly sure on why 58 bytes being the maximum number of bytes. There are 2 bytes in the General Purpose protocol packet + data bytes.  So 64 - 2 would leave 62 bytes available to send in the General Purpose packet, not 58. So I suspect the extra bytes are consumed in the USB packet for CRC or something.  I'm not a USB expert.

    The last question was in register mode, for a cycle packet does the firmware support sending all 12 channels of data in one cycle packet? Again since the I2C tx buffer is 32 bytes which would not support 12 * 4 bytes of data + the packet header.

    The current implementation of the Captivate IP supports up to a max of 4 elements per cycle.  This number comes from the number of measurement blocks in the IP and since only 1 pin per block (= 1 element) is measured per cycle, the max number of elements is 4.  Now, the IP was designed to support up to 12 elements per cycle, which hints to the fact the IP can support up to 12 measurement blocks.  But no MSP430 beyond the current family was developed with more than the 4 measurement blocks.

    Now, for the cycle packet the max byte size is (3cmd + 3state + 16data) = 22 bytes, the maximum bytes possible.  In the file CAPT_comm_config.h the TX buffer is 48 bytes.  As described below, a ping-pong buffer scheme is used so 2 x 24.  This means the buffer is 2 bytes larger than needed and I suspect was done on purpose to accommodate a furture need to add 2 bytes into the packet.

    //*****************************************************************************
    //
    //! def CAPT_TRANSMIT_BUFFER_SIZE defines the size of the transmit buffer.
    //! Note that 2x this size will be allocated, since ping-pong buffering is
    //! used.  This should be at least 2x the size of the largest packet, to allow
    //! for byte stuffing.
    //
    //*****************************************************************************
    #define CAPT_TRANSMIT_BUFFER_SIZE			(48)
    
    //*****************************************************************************
    //
    //! def CAPT_QUEUE_BUFFER_SIZE defines the size of the receive queue buffer.
    //
    //*****************************************************************************
    #define CAPT_QUEUE_BUFFER_SIZE				(256)
    
    //*****************************************************************************
    //
    //! def CAPT_REGISTER_I2C_BUFFER_SIZE defines the size of the I2C Rx buffer.
    //
    //*****************************************************************************
    #define CAPT_I2C_RECEIVE_BUFFER_SIZE		(32)
    
    //*****************************************************************************
    //
    //! def CAPT_I2C_REGISTER_RW_BUFFER_SIZE defines the size of the I2C
    //! register mode working buffer.
    //
    //*****************************************************************************
    #define CAPT_I2C_REGISTER_RW_BUFFER_SIZE	(32)
    

**Attention** This is a public forum