Try to use the RTC Component in the TWR-K70F120M

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Try to use the RTC Component in the TWR-K70F120M

跳至解决方案
1,669 次查看
ad-hemo
Contributor I

Hi,

I want to use the RTC Component.

I have TWR-K70F120M add i use with KDS and PE to generate the software.

I don't know about the 2 parameters that i can put in the function RTC1_GetTime()  [void RTC1_GetTime(LDD_TDeviceData *DeviceDataPtr, LDD_RTC_TTime *TimePtr)]

See below my source code in the main file :

  /* Write your local variable definition here */

    LDD_RTC_TTime Heure_Courante;

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/

  PE_low_level_init();

  /*** End of Processor Expert internal initialization.                    ***/

  /* Write your code here */

  for(;;) {

      RTC1_GetTime(RTC1_TDeviceData, &Heure_Courante); // Lecture de l'heure

  }

Could you help me?

Thank you.

标记 (1)
0 项奖励
回复
1 解答
1,364 次查看
adriancano
NXP Employee
NXP Employee

Hi,

The function is as follows:

Prototype

    void GetTime(LDD_TDeviceData *DeviceDataPtr, LDD_RTC_TTime *TimePtr)

Parameters

    • DeviceDataPtr: Pointer to LDD_TDeviceData - Pointer to device data structure pointer returned by Init method.

    • TimePtr: Pointer to LDD_RTC_TTime - Pointer to the time structure to fill with current time.

You need to use first the Init method to get the DeviceDataPtr value and declare a LDD_RTC_TTime type variable to store the current time, the code could be as follows:

LDD_TDeviceData *MyRTCPtr;  //Pointer to store the value returned by init method

LDD_RTC_TTime Heure_Courante;  //Structure to store the current time

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/

  PE_low_level_init();

  /*** End of Processor Expert internal initialization.                    ***/

  MyRTCPtr = RTC1_Init((LDD_TUserData *)NULL, FALSE); /* Initialize the device

  /* Write your code here */

  for(;;) {

      RTC1_GetTime(MyRTCPtr , &Heure_Courante); // Lecture de l'heure

  }

The current time will be stored in the Time structure, you can choose to to that just one time in the code or any time you need to store the current time.

In the KDS installation folder following the path:

<install_folder>\KDS_1.1.1\eclipse\ProcessorExpert\Help\ComponentUserGuides

You will find the support documentation for each LDD component, you can refer to the RTC_LDD.pdf file to check more information about the use of this component.


Hope this information can help you.

Best Regards,
Adrian Sanchez Cano
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,365 次查看
adriancano
NXP Employee
NXP Employee

Hi,

The function is as follows:

Prototype

    void GetTime(LDD_TDeviceData *DeviceDataPtr, LDD_RTC_TTime *TimePtr)

Parameters

    • DeviceDataPtr: Pointer to LDD_TDeviceData - Pointer to device data structure pointer returned by Init method.

    • TimePtr: Pointer to LDD_RTC_TTime - Pointer to the time structure to fill with current time.

You need to use first the Init method to get the DeviceDataPtr value and declare a LDD_RTC_TTime type variable to store the current time, the code could be as follows:

LDD_TDeviceData *MyRTCPtr;  //Pointer to store the value returned by init method

LDD_RTC_TTime Heure_Courante;  //Structure to store the current time

  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/

  PE_low_level_init();

  /*** End of Processor Expert internal initialization.                    ***/

  MyRTCPtr = RTC1_Init((LDD_TUserData *)NULL, FALSE); /* Initialize the device

  /* Write your code here */

  for(;;) {

      RTC1_GetTime(MyRTCPtr , &Heure_Courante); // Lecture de l'heure

  }

The current time will be stored in the Time structure, you can choose to to that just one time in the code or any time you need to store the current time.

In the KDS installation folder following the path:

<install_folder>\KDS_1.1.1\eclipse\ProcessorExpert\Help\ComponentUserGuides

You will find the support documentation for each LDD component, you can refer to the RTC_LDD.pdf file to check more information about the use of this component.


Hope this information can help you.

Best Regards,
Adrian Sanchez Cano
Technical Support Engineer
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,364 次查看
ad-hemo
Contributor I

Hi,

Thank you very much.

Now, i can compile and debug the project with KDS.

The time stays always the same after few seconds of used.

Do you have an idea about the issue?

Regards.

0 项奖励
回复