Skip to main content
Associate
September 11, 2023
Solved

Modifying Open drain and push pull frequency of I3C messages with appropriate duty cycle

  • September 11, 2023
  • 1 reply
  • 5988 views

Hi
How can we define separate frequency for open drain and push pull modes for I3C communication ?

In the documentation only the low phase is mentioned but for high phase there's no separate option for OD & PP modes.

Asfand_0-1694444071076.png

 

Ideally I would like to do something like this 

Asfand_1-1694444249955.png


<Context> I am working with  STM32H5RB03 as the controller and a MEMS sensor as the target. I want to do I3C communication at 12.5Mhz but the initial OD phase should have much lower frequency(<2Mhz) in order for the sensor to ACK(respond). I'm a newbie so might make basic mistakes while formulating my question, please ask if you need more clarity.

This topic has been closed for replies.
Best answer by Foued_KH

Hello @Asfand , 

Sorry ! The I3C_CtrlTimingComputation function is not available in the I3C files .

But you can just define LL_I3C_CtrlBusConfTypeDef and add the parameters for the new timing : 

This mean, configure the parameters SDAHoldTime, WaitTime, SCLPPLowDuration, SCLI3CHighDuration, SCLODLowDuration, SCLI2CHighDuration, BusFreeDuration, BusIdleDuration in the LL_I3C_CtrlBusConfTypeDef structure through i3c Init structure.
Then call : 
HAL_I3C_Ctrl_BusCharacteristicConfig(I3C_HandleTypeDef *hi3c,const LL_I3C_CtrlBusConfTypeDef *pConfig); 

Foued

1 reply

Foued_KH
ST Employee
September 11, 2023

Hello @Asfand , 

You can't define separate frequency for open drain and push pull modes for I3C communication in STM32CubeMx.
So after generate code, you should set the desired frequency 

 

/* Set bus speed to 1MHz for example*/
LL_I3C_CtrlBusConfTypeDef CtrlBusConf;
/* Calculate the new timing for Controller */
I3C_CtrlTimingComputation(&CtrlBusConf,
 HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_I3C1),
 1000000,
 0,
 50,
 I3C_PURE_I3C_BUS);
/* Update Controller Bus characteristic */
HAL_I3C_Ctrl_BusCharacteristicConfig(&hi3c1, &CtrlBusConf);

 

after you can change it, before the transfer : 

/* Set bus speed to 5MHz for example*/
/* Calculate the new timing for Controller */
I3C_CtrlTimingComputation(&CtrlBusConf,
 HAL_RCCEx_GetPeriphCLKFreq(RCC_PERIPHCLK_I3C1),
 5000000,
 0,
 50,
 I3C_PURE_I3C_BUS);
/* Update Controller Bus characteristic */
HAL_I3C_Ctrl_BusCharacteristicConfig(&hi3c1, &CtrlBusConf);


Hope it helps!
Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
AsfandAuthor
Associate
September 12, 2023

Hi @Foued_KH 
Thanks for the prompt reply.
I am using STM32CUBEIDE and it can not recognize the function 'I3C_CtrlTimingComputation' & definition 'I3C_PURE_I3C_Bus'. I have generated the example 'I3C Controller Inband interrupt' from STM32CubeMx by selecting appropriate board(not using example from Git repo).
Are these functions/definitions not included when we generate code from STM32CubeMx? If yes, can you point to the specific files I should look for ?
For ref:

Asfand_0-1694511770420.png

Let me know If I'm missing something.

Regards,

Asfand

Foued_KH
Foued_KHBest answer
ST Employee
September 12, 2023

Hello @Asfand , 

Sorry ! The I3C_CtrlTimingComputation function is not available in the I3C files .

But you can just define LL_I3C_CtrlBusConfTypeDef and add the parameters for the new timing : 

This mean, configure the parameters SDAHoldTime, WaitTime, SCLPPLowDuration, SCLI3CHighDuration, SCLODLowDuration, SCLI2CHighDuration, BusFreeDuration, BusIdleDuration in the LL_I3C_CtrlBusConfTypeDef structure through i3c Init structure.
Then call : 
HAL_I3C_Ctrl_BusCharacteristicConfig(I3C_HandleTypeDef *hi3c,const LL_I3C_CtrlBusConfTypeDef *pConfig); 

Foued

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.