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.

TMS570LC4357: MIBSPI send 24 bits data frame in one block

Part Number: TMS570LC4357
Other Parts Discussed in Thread: HALCOGEN

Tool/software:

Hi,

I need to use the MIBSPI4 to send a 24 bits length frame to the DAC module AD5422. However, the function which is create by Halcogen use only 16bits of data. The "Charlen" in halcogen is set to 24 which can let me produce  24 clock pulses. But i don't know how to set the halcogene propely and in the code what type of data should i use when call the function : 

void mibspiSetData(mibspiBASE_t *mibspi, uint32 group, uint16 * data).
Here is my halcogene, acutally i use only the TG0 with a length of 24bit (=charlen) :
here is the init of the AD5422 module which cannot be done because the MIBSPI work only with 16bits.

Thank you for your support Slight smile

  • Hi Louis,

    1. configure the charlen as 8 bits,

    2. set the CSHOLD bit: the nCS signal will not be deactivated until the next control field is loaded with new chip select information

    To use the APIs generated by HALCoGen, you need to re-org your data:

    uint32_t Data = 0x1A2B3C;  //24 bit data

    unit16_t txData[3] ={0};

    txData[0] = data & 0x00FF;

    txData[1] = data>>8 & 0x00FF;

    txData[2] = data>>16 & 0x00FF;

    mibspiSetData(mibspiREG1, 1, &txdata[0]) 

    Where the "1" in mibspiSetData(.., 1, ..) is the transfer group number.