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.
Hi Aron,
Is the hardware a development board or a custom one?
I've attached the HRPWM example project, do check that out too.
Regards,
Gautam
Hi Gautam,
The hardware is the F28069 experimenters kit.
That example runs just fine. I need the HRCAP function as well though, as this will ultimately form a feedback loop.
Any thoughts?
Aron
While researching this I found two errors in the example. Here, it lists the HRCAP2 input as GPIO26:
//! //! \b External \b Connections \n //! - HRCAP1 is on GPIO26 //! - ePWM1A is on GPIO0 //! - Connect output of ePWM1A to input of HRCAP1 (GPIO0->GPIO26) //!
It is actually GPIO27. Then, there is an EALLOW which was not followed by an EDIS:
void HRCAP2_Config(void) { EALLOW; HRCap2Regs.HCCTL.bit.SOFTRESET = 1; HRCap2Regs.HCCTL.bit.HCCAPCLKSEL = 1; // HCCAPCLK = PLL2CLK = SYSCLK2 x 2 #if RISETEST HRCap2Regs.HCCTL.bit.RISEINTE = 1; // Enable Rising Edge Capture Event Interrupt HRCap2Regs.HCCTL.bit.FALLINTE = 0; // Disable Falling Edge Capture Event Interrupt OLED_write_int(4, '5'); #elif FALLTEST HRCap2Regs.HCCTL.bit.FALLINTE = 1; // Enable Falling Edge Capture Event Interrupt HRCap2Regs.HCCTL.bit.RISEINTE = 0; // Disable Rising Edge Capture Event Interrupt #endif HRCap2Regs.HCCTL.bit.OVFINTE = 0; // Enable Interrupt on 16-bit Counter Overflow Event }
After adding EDIS to the end of the above function, the error stopped.