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.
/* PCNT: Capture Duty 3 * - Instruction = 31 * - Next instruction = 32 * - Conditional next instruction = na * - Interrupt = na * - Pin = 6 */ { /* Program */ 0x00020700U | (1U << 5U) | (6U), /* Control */ 0x00000000U, /* Data */ 0x00000000U, /* Reserved */ 0x00000000U }, /* PCNT: Capture Period 3 * - Instruction = 32 * - Next instruction = 33 * - Conditional next instruction = na * - Interrupt = na * - Pin = 6 + 1 */ { /* Program */ /*原代码0x00021700U | (1U << 5U) | ((6U) + 1U),*/ 0x00021700U | (3U << 5U) | ((6U) + 0U), /* Control */ 0x00000000U, /* Data */ 0x00000000U, /* Reserved */ 0x00000000U },
#include "system.h" #include "het.h" /* USER CODE BEGIN (0) */ hetSIGNAL_t pluse10; hetSIGNAL_t pluse_pwm; /* USER CODE END */ /* USER CODE BEGIN (1) */ /* USER CODE END */ int main(void) { /* USER CODE BEGIN (2) */ hetInit(); pwmStart(pwm0); while (1) { pwmSetDuty(pwm0, 30); pluse_pwm = pwmGetSignal(pwm0); pluse10 = capGetSignal(cap3); } /* USER CODE END */ return 0; }
e2e.ti.com/.../20210525_2D00_TMS470_2D00_08_5F00_HET_2D00_Capture.rar
您好!
请参阅 pwmGetSignal 和 capGetSignal API。 这些 API 采用三个参数、您只能传递一个参数。 您可以在 HalcogGen->Help->Help topics->Modules->HET 中找到 API 详细信息。
感谢您的回复、但 TMS470两个函数的 API 如下: hetSIGNAL_t capGetSignal (uint32cap)和 hetSIGNAL_t pwmGetSignal (uint32pwm)。 此外、已读取 PWM 波形的周期和占空比的使用、有关详细信息、请参阅上一个图中的变量 pluse_PWM。
您好!
很抱歉、我不是很熟悉 TMS470MF03107。 您能不能读取 HETRAM 中与 CAP3指令相对应的指令。 您是否看到 CAP3指令的数据字段 捕获任何内容? 另请注意、今天是美国假日。 响应将延迟。
好的、谢谢! 我将再次进行学习。