AnsweredAssumed Answered

capture_LDD-result

Question asked by Vijeendra N on Aug 26, 2015
Latest reply on Sep 24, 2015 by Vijeendra N

I used same example code to capture period.

In debug mode, I was reading expression - data, I was able to see Hex value there

 

Can you help me to understand, how to relate this hex value with the Frequency fed at the input pin

and

how to configure the same value in PPG bean to get the same frequency at the output pin

 

 

LDD_TDeviceData *MyCap1Ptr;

LDD_TError Error;

uint32_t Data;

 

 

 

 

int main(void)

/*lint -restore Enable MISRA rule (6.3) checking. */

{

  /* Write your local variable definition here */

 

 

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

  PE_low_level_init();

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

 

 

  MyCap1Ptr = Cap1_Init((LDD_TUserData *)NULL);        /* Initialize the device */

  Error = Cap1_Reset(MyCap1Ptr);                       /* Reset the counter */

 

 

 

 

  /* Write your code here */

  /* For example: for(;;) { } */

  for(;;)

  {

   //Cap1_GetCaptureValue();

   if ((Cap1_GetEventStatus(MyCap1Ptr) & LDD_CAPTURE_ON_CAPTURE) != 0U) { /* Get input capture status */

 

 

         /* Write captured value to variable Data */

         Error = Cap1_GetCaptureValue(MyCap1Ptr, &Data);

 

 

         /* Variable Data contains captured value of a timer */

   }

  }

Outcomes