DebD21
Newbie level 3
Hi there... my first post on this forum! Coming to the point right-away, I'm working on a 48V 1kW sensored BLDC Motor control project for EV application. I'm using the STM8S series MCUs for this purpose (STM8S Discovery Board, based on STM8S105C6T6 48 pin MCU)
I'm planning to feed the hall sensor outputs from the motor into the 3 channels of Timer 2 of my MCU and I want the Timer 2 to issue an interrupt every time a hall sensor makes transition either from 0 to1 or from 1 to 0, so that Timer 1 channel outputs can be configured accordingly, to switch on and off the correct pair of switches (6 step commutation strategy)
Could someone give me a rough idea of how to configure the Timer 2 for this purpose i.e. which registers/bits do I need to modify so that Timer 2 channels are able to capture every hall transition (both 1 to 0 and 0 to 1) and subsequently generate an interrupt event on Timer 1.
P.S. I've gone through a sample program released by STMicroelectronics to generate 6 step PWM using software generated interrupts by configuring Timers 1 and 4. I just need to know which registers do I need to modify so that I can generate interrupts using hardware i.e. Hall Sensors instead of software.
I'm planning to feed the hall sensor outputs from the motor into the 3 channels of Timer 2 of my MCU and I want the Timer 2 to issue an interrupt every time a hall sensor makes transition either from 0 to1 or from 1 to 0, so that Timer 1 channel outputs can be configured accordingly, to switch on and off the correct pair of switches (6 step commutation strategy)
Could someone give me a rough idea of how to configure the Timer 2 for this purpose i.e. which registers/bits do I need to modify so that Timer 2 channels are able to capture every hall transition (both 1 to 0 and 0 to 1) and subsequently generate an interrupt event on Timer 1.
P.S. I've gone through a sample program released by STMicroelectronics to generate 6 step PWM using software generated interrupts by configuring Timers 1 and 4. I just need to know which registers do I need to modify so that I can generate interrupts using hardware i.e. Hall Sensors instead of software.