This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

QUADRATURE PULSE

Other Parts Discussed in Thread: HALCOGEN

#include "sys_common.h"
/* USER CODE BEGIN (1) */
#include "eqep.h"
#include "sys_core.h"
/* USER CODE END */
/* USER CODE BEGIN (2) */
#define UNIT_POSITION_X 60U
/* USER CODE END */
void main(void)
{
/* USER CODE BEGIN (3) */
uint16 deltaT = 0U;
float velocity = 0U;
/* EQEP initialization based on GUI Configuration. */
QEPInit();
/* Enable Position Counter */
eqepEnableCounter(eqepREG1);
/* Enable Unit Timer. */
eqepEnableUnitTimer(eqepREG1);
/* Enable capture timer and capture period latch. */
eqepEnableCapture(eqepREG1);
while(1)
{
/* Status flag is set to indicate that a new value is latched in the QCPRD register. */
if((eqepREG1->QEPSTS & 0x80U) !=0U)
{
/* Elapsed time between unit position events */
deltaT = eqepREG1->QCPRD;
/* Calculate Velocity from deltaT and the value of the unit position. */
/* The value of Unit Position is a sample value and should be changed by the User as per the actual value in the UNIT_POSITION_X macro above. */
velocity = (float)(UNIT_POSITION_X/deltaT);
/* Clear the Status flag. */
eqepREG1->QEPSTS |= 0x80U;
}
}
/* USER CODE END */
}
this example  code  of  quadrature   encoder  but  for  this  i need to  provide  pulses  using  PWM  will it  be  possible  then  what  is   code  and  holcogen , iam  using  controller TMS570LS4357 ,  can u provide me soon as possible