尊敬的所有人:
在我们的应用中、位置计数器配置为在索引事件发生时的位置计数器复位模式下运行。
根据 SPNU515C 秒 21.4.1位置计数器工作模式、当位置计数器递增计数时发生溢出 更新 QPOSMAX 值。
根据测试结果、我们观察到溢出在位置计数器递增计数时发生 感应 QPOSMAX 值。
配置中的错误是否可能会导致观察到的行为? 我们假设 SPNU515C 是真正的参考。
提前感谢您的观看。
顺祝商祺、
路易斯
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.
尊敬的所有人:
在我们的应用中、位置计数器配置为在索引事件发生时的位置计数器复位模式下运行。
根据 SPNU515C 秒 21.4.1位置计数器工作模式、当位置计数器递增计数时发生溢出 更新 QPOSMAX 值。
根据测试结果、我们观察到溢出在位置计数器递增计数时发生 感应 QPOSMAX 值。
配置中的错误是否可能会导致观察到的行为? 我们假设 SPNU515C 是真正的参考。
提前感谢您的观看。
顺祝商祺、
路易斯
尊敬的 Jagadish:
感谢您的快速响应。
继续跟进您的回答、如果 SPNU515C 正确、那么您的回答与 SPNU515C 不匹配、也与我的说法不匹配。
我的意思是 SPNU515C 几秒钟就可以完成了 21.4.1表示"[.] 当位置计数器递增计数时、发生溢出 更新 QPOSMAX 值。" 我(您也在回答中)说:"[.]当位置计数器递增计数时溢出 感应 QPOSMAX 值"
观察到溢出 感应 在之后写入 SPNU515C 中的 QPOSMAX 值和 更新 QPOSMAX 值。
您能否澄清一下您的答案?
感谢您的时间和支持。
此致、
路易斯
您好 Jagadish:
很抱歉耽误你的时间。 下面您可以找到我们使用的初始化、
static void fn_qep_reg_init_qepctl(qep_reg_t* p_qep_reg) { /** * Setup eQEP Control Register QEPCTL (SPNU515C, p. 920, p. 921). * * PCRM: Select Position counter Reset Mode: * * 0h = Position counter reset on any index event, * 1h = Position counter reset on the maximum position, * 2h = Position counter reset on the first index event. */ BITMOD_CLR_BITS_16(0x3u, 12u, p_qep_reg->u16_qepctl); /* SEI: Enable & Select Strobe event initialization of position counter. * * 0h = Do nothing (action is disabled). */ BITMOD_CLR_BITS_16(0x3u, 10u, p_qep_reg->u16_qepctl); /* IEI: Enable & Select Index event initialization of position counter. * * 0h = Do nothing (action is disabled), * 2h = Initializes the position counter on the rising edge of the QEPI * signal (QPOSCNT = QPOSINIT). */ BITMOD_CLR_BITS_16(0x3u, 8u, p_qep_reg->u16_qepctl); /* SWI: Enable / Disable Software Initialization of Position counter. * * 0h = Do nothing (action is disabled). */ BITMOD_CLR_BIT_16(7u, p_qep_reg->u16_qepctl); /* SEL: Select Strobe event latch of position counter. * * The position counter is latched on the rising edge of QEPS * strobe (QPOSSLAT = POSCCNT). Latching on the falling edge is * done by inverting the strobe input using the QSP bit in the * QDECCTL register. * * The position counter is latched on the rising edge of QEPS strobe * (QPOSSLAT = QPOSCNT). */ BITMOD_CLR_BIT_16(6u, p_qep_reg->u16_qepctl); /* IEL: Select Index event latch of position counter. * 1h: Latches position counter on rising edge of the index signal. */ BITMOD_CLR_BIT_16(5u, p_qep_reg->u16_qepctl); BITMOD_SET_BIT_16(4u, p_qep_reg->u16_qepctl); /* QPEN: Quadrature position counter enable/software reset. * * Reset the eQEP peripheral internal operating flags/read-only * registers. Control/configuration registers are not disturbed by a * software reset. * * 0h: Reset the eQEP peripheral internal operating flags/read-only * registers. */ BITMOD_CLR_BIT_16(3u, p_qep_reg->u16_qepctl); /* Enable Position Counter (QPEN) (SPNU515C, p. 921). * QPEN = 1h: Enable Position Counter */ BITMOD_SET_BIT_16(3u, p_qep_reg->u16_qepctl); /* QCLM: Select EQEP capture Latch mode (SPNU515C, p. 921). * * Latch on position counter read by CPU. Capture timer and * capture period values are latched into QCTMRLAT and QCPRDLAT * registers when CPU reads the QPOSCNT register. * * Latch on position counter read by CPU. */ BITMOD_CLR_BIT_16(2u, p_qep_reg->u16_qepctl); /* Disable Unit Timer. */ BITMOD_CLR_BIT_16(1u, p_qep_reg->u16_qepctl); /* WDE: eQEP watchdog enable. * * Disable eQEP watchdog timer. */ BITMOD_CLR_BIT_16(0u, p_qep_reg->u16_qepctl); } With BITMOD* documentation: /** * \brief Helpers to set/clear/toggle multiple bits of `uint16_t` value * * `bits_` must be of unsigned integer type with max. width of `val_`. * `pos_` must be unsigned integer or non-negative enumeration type with value * < 16 - non-zero-MSB(`bits_`). * `val_` must be `uint16_t` type. */
感谢您的时间和支持。
此致、
路易斯
您好、Luis:
最后,您是否发现所提供的初始化代码存在任何问题或改进点?
我在您的初始化代码中没有发现任何问题。
稍后我们将重新检查并发布任何进一步的问题。
好的、我们将等待您的反馈。
--
谢谢。此致、
Jagadish。