STM32 advanced Timer  - Page 1
Forum section: electronics / general

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: February 05, 2016, 11:15:52 pm
content: Hi, i recently used a microchip 16F chip to control a H-bridge using PWM Enhanced Mode capability. basically what it do, it will enable one output with a fixed level, and switch with a fixed duty cycle the complementary side on the other half bridge, with a single bit you can change the outputs configuration to change direction without touching any thing else.example : fix B pulse C and then fix D and pulse A .am using this in as a pure Sin inventer and it works fine.what i like the most is that am totally capable of switching direction by simply writing 1 bit.what am trying to find is an equivalent capability in the STM32 family chips. i used F3,F1 and F0 and i don't think i can figure out any timer configuration that will do the same thing with the same algorithm. what i did with the st chips that i have to manually stop one channel and switch to the other one, i took at least 4 instructions, while it's not fatal i had some bizarre wave slipping. it's like the period is not the same.anyone know about a stm32 chips with timers that may work as described ?

author: Sal Ammoniac
author_rank: Super Contributor
timestamp: February 05, 2016, 11:35:30 pm
content: The Infineon XMC4400 series has timers that are well-suited for use with H-bridges. Just a thought in case the STM32 doesn't do what you want.http://www.infineon.com/cms/en/product/microcontroller/32-bit-industrial-microcontroller-based-on-arm-registered-cortex-registered-m/32-bit-xmc4000-industrial-microcontroller-arm-registered-cortex-registered-m4/XMC4400-F100K512+AB/productType.html?productType=db3a30443784920501380a41329b6c87

author: ve7xen
author_rank: Super Contributor
timestamp: February 06, 2016, 12:33:43 am
content: Most of STM32F10x series has available 'Advanced-control' timers with complimentary output functionality. You can individually enable or disable timer control of either of the outputs in the same register, so I think this can accomplish exactly what you're looking for, using a single instruction to swap outputs.

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: February 06, 2016, 11:10:17 pm
content: Quote from: Sal Ammoniac on February 05, 2016, 11:35:30 pmthanksi saw that and there is alot of documentation about using this chip with motor control.while i will stick to my design for the inverter , i will certainly put this one on the list for a new project that involve motor control with H-bridge

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: February 06, 2016, 11:14:52 pm
content: Quote from: ve7xen on February 06, 2016, 12:33:43 amyes they do, but it's not exactly what am looking for , complementary output will make both output give a PWM signal. and since it's a full bridge, 2 channels are needed, and as far as i tried you can't just pass one to an other just by a single instruction.i could be wrong though just why am askingi did use this stm32 timers capability (complimentary output with deadtime ) with push-pull step up transformer and worked perfectly, but it's not the same for the H-bridge

author: hamdi.tn
author_rank: Frequent Contributor
timestamp: February 06, 2016, 11:17:14 pm
content: for reference this is the kind of signal am expecting

author: TassiloH
author_rank: Regular Contributor
timestamp: February 07, 2016, 12:00:27 am
content: Look at the TIM1->CCER register (or also TIM8 on STM32F4xx devices). These timers have 4 output compare units and complimentary outputs for 3 of the output compare signals, so in total 7 outputs.In the CCER register are bits toenable/disableeach of these 7 outputs (enabled means the output state depends on the compare result, deadtime etc., disabled means the output goes to the inactive state). Furthermore there are bits to define theoutput polarityof each of the 7 outputs.Thus by one write to the CCER register it should be possible to accomplish what you describe: Set some outputs to a fixed level by disabling them and set the polarity so that they have the desired level in the inactive state, and have the other (enabled) outputs switch as determined by the timer compare.