2367284_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

2367284_en-US

2367284_en-US

TPL communication is not works in mc33771c

I have a custom board that functions perfectly with the MC33771B using its BCC driver library. However, when I replace the IC with an MC33771C and switch to the official NXP BCC driver for the C variant (from the EMBEDDED-SW-MC33771C package), communication fails during BCC_AssignCid due to a CRC error. i think TPL communication is not works because all time received only echo frame not able to receive data. same hardware works with mc33771b just change bcc library according to IC.

Re: TPL communication is not works in mc33771c

Miral_0-1779253113801.pngMiral_1-1779253139984.pngMiral_2-1779253161191.png

This is our custom board schematic and this is our code for tpl communication

The communication works correctly with the MC33771B using a specific implementation and BCC library. I can successfully send commands and receive valid response frames.

However, when I use the same communication code and only replace the BCC library/configuration for the MC33771C, I receive only the echo frame and no valid response from the device.

The SPI/TPL timing, frame format, and hardware connections remain the same. The wake-up sequence and INIT sequence are also implemented.

Has anyone experienced this issue with MC33771C?

bcc_status_t BCC_MCU_TransferTpl(uint8_t drvInstance,

uint8_t transBuf[],

uint8_t recvBuf[],

uint16_t recvTrCnt)

{

// Total receive size = 6 bytes * number of transfers

uint16_t recvSize;

if(recvTrCnt>0)

recvSize = (recvTrCnt-1) * 6U;

else

recvSize = 6U;


HAL_SPI_DeInit(&hspi2);

HAL_Delay(2);

HAL_SPI_Init(&hspi2);

memset(recvBuf,0,sizeof(&recvBuf));

// Start SPI communication

HAL_GPIO_WritePin(CS_TX_GPIO_Port, CS_TX_Pin, GPIO_PIN_RESET);

HAL_SPI_Receive_IT(&hspi2, recvBuf, 6);

rxflag = 0;

// --- Transmit one 48-bit frame ---

if (HAL_SPI_Transmit_IT(&hspi1, transBuf, 6) != HAL_OK)

{

HAL_GPIO_WritePin(CS_TX_GPIO_Port, CS_TX_Pin, GPIO_PIN_SET);

return BCC_STATUS_PARAM_RANGE;

}

BCC_MCU_WaitUs(5);

if(spi2_rx_done == 1)

{

HAL_SPI_Receive_IT(&hspi2, recvBuf, recvSize);

spi2_rx_done = 0;

}

HAL_GPIO_WritePin(CS_TX_GPIO_Port, CS_TX_Pin, GPIO_PIN_SET);

return BCC_STATUS_SUCCESS;

}

int MC33771_Init(void)

{

// Enable MC33664 TPL transceiver first

HAL_GPIO_WritePin(EN_GPIO_Port, EN_Pin, GPIO_PIN_RESET);

HAL_Delay(1);

HAL_GPIO_WritePin(EN_GPIO_Port, EN_Pin, GPIO_PIN_SET);

HAL_Delay(10); // Wait for MC33664 ready


// Configure BCC driver

g_bccConfig.drvInstance = 0;

g_bccConfig.commMode = BCC_MODE_TPL;

g_bccConfig.devicesCnt = 1;

g_bccConfig.device[0] = BCC_DEVICE_MC33771C;

g_bccConfig.cellCnt[0] = 14;



// Initialize BCC library

status = BCC_Init(&g_bccConfig);


if (status != BCC_STATUS_SUCCESS) {

return (int)status;

}


}


int MC33771_ReadAllCellVoltages(float cellVoltages[14])

{


uint16_t measurements[BCC_MEAS_CNT];


uint32_t voltage_uv;

uint8_t cell;




if (cellVoltages == NULL) {

return -1;

}


status = BCC_Meas_StartConversion(&g_bccConfig, BCC_CID_DEV1,BCC_AVG_1);

if (status != BCC_STATUS_SUCCESS) {

return status;

}


HAL_Delay(600);

// Read measurements

status = BCC_Meas_GetRawValues(&g_bccConfig, BCC_CID_DEV1, measurements);

if (status != BCC_STATUS_SUCCESS) {

return status;

}


// Extract all cell voltages

for (cell = 0; cell < 14; cell++) {

voltage_uv = BCC_GET_VOLT(measurements[BCC_MSR_STACK_VOLT + cell]);

cellVoltages[13 - cell] = (float)voltage_uv / 1000.0f;

cellVoltages[13 - cell] = (float)cellVoltages[13 - cell] / 1000.0f;

}


return 0;

}

int main(void)

{



/* Reset of all peripherals, Initializes the Flash interface and the Systick. */

HAL_Init();


/* Configure the system clock */

SystemClock_Config();


/* Configure the peripherals common clocks */

PeriphCommonClock_Config();


/* Initialize all configured peripherals */

MX_GPIO_Init();

MX_DMA_Init();

MX_SPI1_Init();

MX_SPI2_Init();

MX_TIM16_Init();

MX_USART1_UART_Init();


MC33771_Init();

while (1)

{


temp = MC33771_ReadAllCellVoltages(voltage);

HAL_Delay(1000);


}


}

void HAL_SPI_RxCpltCallback(SPI_HandleTypeDef *hspi)

{

if (hspi->Instance == SPI2)

spi2_rx_done = 1;


}

static void MX_SPI1_Init(void)

{


/* USER CODE BEGIN SPI1_Init 0 */


/* USER CODE END SPI1_Init 0 */


/* USER CODE BEGIN SPI1_Init 1 */


/* USER CODE END SPI1_Init 1 */

/* SPI1 parameter configuration*/

hspi1.Instance = SPI1;

hspi1.Init.Mode = SPI_MODE_MASTER;

hspi1.Init.Direction = SPI_DIRECTION_2LINES;

hspi1.Init.DataSize = SPI_DATASIZE_8BIT;

hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;

hspi1.Init.CLKPhase = SPI_PHASE_2EDGE;

hspi1.Init.NSS = SPI_NSS_SOFT;

hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8;

hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;

hspi1.Init.TIMode = SPI_TIMODE_DISABLE;

hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;

hspi1.Init.CRCPolynomial = 7;

hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;

hspi1.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;

if (HAL_SPI_Init(&hspi1) != HAL_OK)

{

Error_Handler();

}

/* USER CODE BEGIN SPI1_Init 2 */


/* USER CODE END SPI1_Init 2 */


}


/**

* @brief SPI2 Initialization Function

* @param None

* @retval None

*/

static void MX_SPI2_Init(void)

{


/* USER CODE BEGIN SPI2_Init 0 */


/* USER CODE END SPI2_Init 0 */


/* USER CODE BEGIN SPI2_Init 1 */


/* USER CODE END SPI2_Init 1 */

/* SPI2 parameter configuration*/

hspi2.Instance = SPI2;

hspi2.Init.Mode = SPI_MODE_SLAVE;

hspi2.Init.Direction = SPI_DIRECTION_2LINES_RXONLY;

hspi2.Init.DataSize = SPI_DATASIZE_8BIT;

hspi2.Init.CLKPolarity = SPI_POLARITY_LOW;

hspi2.Init.CLKPhase = SPI_PHASE_2EDGE;

hspi2.Init.NSS = SPI_NSS_HARD_INPUT;

hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB;

hspi2.Init.TIMode = SPI_TIMODE_DISABLE;

hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;

hspi2.Init.CRCPolynomial = 7;

hspi2.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;

hspi2.Init.NSSPMode = SPI_NSS_PULSE_DISABLE;

if (HAL_SPI_Init(&hspi2) != HAL_OK)

{

Error_Handler();

}

/* USER CODE BEGIN SPI2_Init 2 */


/* USER CODE END SPI2_Init 2 */


}


Re: TPL communication is not works in mc33771c

Dear Miral,

if you use recommended software for the MC33771C, then it looks to be a hardware issue. Please refer to the AN12633. If you are switching from MC33771B to MC33771C you need to change some external components. 

JozefKozon_0-1779177671061.png

E.g. the CLPF, CIN in the low pass filter are different. For the external components between the MC33664 and first MC33771B and/or MC33771C node please refer to the section 13.2.6 in MC33771B full datasheet and in MC33771C full datasheet respectively. The MC33771C full datasheet is publicly available, while the MC33771B full datasheet is confidential, can be downloaded with valid NDA from the Secure section. 

JozefKozon_2-1779178421486.png


JozefKozon_1-1779178371806.png


With Best Regards,

Jozef

Re: TPL communication is not works in mc33771c

Dear Miral,

write commands, global write or invalid frames in the MC33771C do not generate a response; only valid read commands return data. This is stricter than many MC33771B examples, where some drivers expect a reply after every frame.

MC33771C TPL requires:

  • Proper wake sequence
  • AND waiting time
JozefKozon_0-1779338021638.pngJozefKozon_1-1779338087547.pngJozefKozon_2-1779338166772.png

Please try to send a read command (E.g. a STATUS register) and see if the MC33771C responses. 

With Best Regards,

Jozef

Re: TPL communication is not works in mc33771c

Hi Miral,

your schematic looks to be correct for the MC33771C. For the software I have contacted a software engineer. So far no answer from him. As soon as I receive an answer, I will definitely reply to you.

Thank you for your patience.

With Best Regards,

Jozef

Re: TPL communication is not works in mc33771cI checked all the wake-up sequence timing it all looks good but TPL Communication still not works. also we check the required external components for mc33771c I shared my schematic also if there any issue in board.
タグ(1)
評価なし
バージョン履歴
最終更新日:
‎05-30-2026 04:59 AM
更新者: