Hello. We are using the RM48L952 ZWT. If we want to configure NHET for pulse capture, is there a code example of what functions to use? i.e., in het.c we only found the pwmStart,etc.
Thank you
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 Tammy,
This is the API function to read the capture value (period, duty).
/** @fn void capGetSignal(hetRAMBASE_t * hetRAM, uint32 cap, hetSIGNAL_t signal) * @brief Get capture signal * @param[in] hetRAM Pointer to HET RAM: * - hetRAM1: HET1 RAM pointer * - hetRAM2: HET2 RAM pointer * @param[in] cap captured signal: * - cap0: Captured signal 0 * - cap1: Captured signal 1 * - cap2: Captured signal 2 * - cap3: Captured signal 3 * - cap4: Captured signal 4 * - cap5: Captured signal 5 * - cap6: Captured signal 6 * - cap7: Captured signal 7 * @param[in] signal signal * - duty cycle in %. * - period period in us. * * Gets current signal of the given capture signal. */ /* SourceId : HET_SourceId_013 */ /* DesignId : HET_DesignId_013 */ /* Requirements : HL_SR377 */ void capGetSignal(hetRAMBASE_t * hetRAM, uint32 cap, hetSIGNAL_t *signal) { uint32 pwmDuty = (hetRAM->Instruction[(cap << 1U) + 25U].Data) >> 7U; uint32 pwmPeriod = (hetRAM->Instruction[(cap << 1U) + 26U].Data) >> 7U; signal->duty = (pwmDuty * 100U) / pwmPeriod; if( hetRAM == hetRAM1) { signal->period = ((float64)pwmPeriod * 853.333F) / 1000.0F; } else { signal->period = ((float64)pwmPeriod * 853.333F) / 1000.0F; } }
Hi Anthony. Thank you. Is there something special we have to do to get HalCoGen HET tab to autogenerate the capGetSignal(hetRAMBASE_t * hetRAM, uint32 cap, hetSIGNAL_t signal) function? HalCoGen is not generating this function (uit doesn't exist in our source HalCoGen driver code generated by HalCoGen. Thank you again.
Tammy,
As far as I know all you need to do is have the HET driver enabled and select the blackbox driver in the HET tab.
The function should be output into the file het.c.
Hi Anthony. Thank you. See attached het.c file. Thank you again. Here it is: 1680.het.c