Try to use the RTC Component in the TWR-K70F120M

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

Try to use the RTC Component in the TWR-K70F120M

ソリューションへジャンプ
1,511件の閲覧回数
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,206件の閲覧回数
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,207件の閲覧回数
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,206件の閲覧回数
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 件の賞賛
返信