2016-09-20 07:14 AM
Hello,
I try to count impulses from a rotating motor (pulse length: 280 us) I use STM32CubeMX (Version 4.16.1; STM32Cube V1.0) to configure the STM32F746. I configured TIM9 slave mode for external clock source mode, TI1FP1(GPIO PE5) as trigger source. I want to read the CNT register every 1 second. Is it the right way? Can someone verify, if CubeMX generates the code right? The resulting code seems not to configure the input correctly. (CCMR1 is 0x00), should be 0x01 in my opinion. The CNT register is always 0 (also if motor is rotating) Thanks in advance #stm322016-09-20 02:24 PM
I don't and won't use Cube, but what happens if you set CCMR1 to the value you deem correct?
JW2016-09-21 01:59 AM
Hi twe,
In addition to the STM32CubeMx which is a tool that generate an initialization code, to add user code you can get help from the ready-to-use example of STM32Cube package. I recommend the ''TIM_InputCapture'' example of the firmware package at this path: STM32Cube_FW_F7_V1.4.0\Projects\STM32756G_EVAL\Examples\TIM\TIM_InputCapture You can apply the same call back code there. -Hannibal-