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.

HRCAP module in TMS320F28035

Other Parts Discussed in Thread: TMS320F28035, CONTROLSUITE

Hi,

I am using the TMS320F28035 MicroController and I wish to use the HRCAP feature available to capture a PWM signal. I used the HRCAP1 on pin no. 37 i.e. GPIO 26. I have configured GPIO 26 for HRCAP. 

My problem is I am getting an error during building the project. The error is 'HRCap1Regs is undefined'. Also I get a warning that the line 

status = HRCAP_Cal(1,1,&EPwm7Regs);

is unreachable. 

I would appreciate help regarding this.

Thanks.

  • Hello Sandesh!

    Perhaps you didn't include the header file DSP2803x_HRCap.h to your project: 

    extern volatile struct HRCAP_REGS HRCap1Regs;

    Also please pay attention on the file DSP2803x_GlobalVariableDefs.c (it must be included to project too) : 

    volatile struct HRCAP_REGS HRCap1Regs;

    At controlSUITE there are two example variants of your task:

    ti\controlSUITE\device_support\f2803x\v126\DSP2803x_examples_ccsv4\hrcap_capture_hrpwm\

    ti\controlSUITE\device_support\f2803x\v127\DSP2803x_examples_ccsv5\hrcap_capture_hrpwm\

    Regards,

    Igor

  • Thanks for the reply Igor. However I have a doubt that HRCap is the wrong module to use for my application. 

    I am trying to capture a PWM signal whose period is around 14 ms. The datasheet for TMS320F28035 says that maximum cycle duration for HRCap module is 10 ns. Hence for my application, the 16-bit counter overflows and I get a rolled-over value for the periodwidth. 

    Is there any way to still use the HRCap module that I am missing?

    Thanks in advance,

    Sandesh