2019-11-23 01:23 AM
Hello. In order to drive a stepper motor with CanBus, I want driver a L6208. I would use a timer to generate Npulses. I've read AN4776 (General-purpose timer cookbook ) but I don't understand somethink, I can't run the timer.
Any people have example code ?
2019-11-23 07:18 AM
I don't have examples for new libraries with old parts.
Find a One Shot/Pulse example. OPM?
Use an Advanced TIM, like TIM1 or TIM8.
The Repetition Count can generate up to 256 pulses as I recall.
You can restart at the completion Update event to batch/chain a series of tight pulse trains.
With other TIM, or for longer counts, you'd need to count Update events, either stopping the TIM, or zeroing the pulse width (off)
@brk top level post entry dialog still broken, cursor up/down not working.
2019-11-23 10:51 AM
L6208 is not an old part, I think. There is a library for Nucleo with STM32F0 and STM32F3, but not STM32F1.
I will try with event to stop.
Thanks
2019-11-24 01:12 PM
I will explain that I made for other people.
I would N pulses on PB10 (Timer 2 channel 3)
I use TIM2 in PWM mode to generate the signal on Channel3 and :
I use TIM4 in
after calculation for duration, speed, etc.
I start TIM4 with
and just the line below :
at the first front of TIM2 the TIM4 will start.
for the end, in the TIM4_IRQHandler I add the line :