AnsweredAssumed Answered

32 bit DSPI on K66

Question asked by ahmedtolba on May 16, 2018
Latest reply on May 17, 2018 by Hui_Ma

 

How would I send 32bit data values using SPI of K66.. here is my attempt. The problem is only some parts of the 32bits are shown in the scope

 

 

status_t ADF4158_GenericWriteReg(pll_register_t reg, pll_params_t *params)
{
dspi_command_data_config_t command;
uint32_t value;

if(reg >= kPLL_MAX)
return kStatus_Fail;

/* obtain formatted register value */
value = ADF4158_GetFormattedRegValue(reg, params);

PRINTF("Writing Register R%d with value 0x%08X\r\n", reg, value);

/* Define Chip Select */
command.whichCtar = spiCtar;
command.whichPcs = spiPcs;
command.isPcsContinuous = true;
command.isEndOfQueue = false;
command.clearTransferCount = false;

/* upper 16 bit */
DSPI_MasterWriteDataBlocking(spiBase, &command, (uint16_t)(value >> 16U));

/* lower 16 bit */
command.isPcsContinuous = false;
DSPI_MasterWriteDataBlocking(spiBase, &command, (uint16_t)(value & 0x0000FFFFU));
ADF4158_DelayFunc();

return kStatus_Success;
}

 

Outcomes