2018-10-15 09:37 PM
Hello all,
I've been working on and off with the timers on the STM32F7 and I've noticed a few inconsistencies, though it may well be me not setting something right.
I'm using:
STM32CubeMX 4.27
STM32 Workbench
Firmware 1.12 for F7
STM32F767ZI
Getting the timer to run is relatively straightforward, and I'm having two issues at the moment:
Clock Division doesn't have any effect when changed (from the code generated by CubeMX):
htim4.Init.ClockDivision = TIM_CLOCKDIVISION_DIV4;
//htim4.Init.ClockDivision = TIM_CLOCKDIVISION_DIV2;
//htim4.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1;
All of the above act the same after calling:
HAL_TIM_ConfigClockSource(&htim4, &sClockSourceConfig)
Secondly, I have a reset pulse, 10Hz square wave, 50% cycle, 0 - 3.3V from a signal generator, which should reset the timer only on the rising edge. However, it seems that the reset is happening on both rising and falling edge (measured on an oscilloscope and printing the counter values). the pulse is being input to TI1_ED. Slave configuration is as follows:
sSlaveConfig.SlaveMode = TIM_SLAVEMODE_RESET;
sSlaveConfig.InputTrigger = TIM_TS_TI1F_ED;
sSlaveConfig.TriggerFilter = 0;
sSlaveConfig.TriggerPolarity = TIM_TRIGGERPOLARITY_FALLING;
Line 4 changes do not have any effect on the outcome.
If you could point me out in the right direction I'd really appreciate it.
Cheers,
Albert
2018-10-15 09:55 PM
Ok, figured that one out by myself, CLK division refers only to the digital filters, not the counting clock.
On to the next one...
2018-10-15 10:45 PM
Changed the input trigger to TIM_TS_TI1FP1 and works as expected. Still, couldn't get TIM_TS_TI1F_ED to work as a single trigger.
Cheers,
Albert
2018-10-16 02:46 AM
> the pulse is being input to TI1_ED
What exactly do you mean by "being input to TI1_ED"?
I don't Cube/HAL but you probably try to set the slave mode controller's input to the channel 1's edge detector by setting TIMx_SMCR.TS = 0b100 . There are two edges per pulse, so it works as expected.
JW
2018-10-16 07:13 AM
Hi
Khouloud.