cancel
Showing results for 
Search instead for 
Did you mean: 

Generating firmware for 1kW Traction Motor Controller with STM8 MCU

Tamojit
Associate II

We wanted to design 1kW traction motor controller for 3 phase BLDC motor., Therefore we were referring to this document found here.

We tried generating the library with e STM8 MC FW builder and it worked fine. But these were only header file and no source code. We expected that we would get bare minimum source code so that we can further develop. Please help us so that we can start developing the controller and any reference to document(s) for writing the firmware.

4 REPLIES 4
Javier1
Principal

>>But these were only header file and no source code

Veery weird.

I have no experience with STM8 MC builder, but i do with STM32 MC builder and it does generate .c files.

Are you sure you clicked the right things? maybe share your MC files

we dont need to firmware by ourselves, lets talk
Tamojit
Associate II

Can you share link to STM32 MC Builder?

I found it. Thanks.

I'm facing the same issues too. The snippet of the code is below. Please help me with the .c files.

#ifndef __MC_PORT_PARAM_H
#define __MC_PORT_PARAM_H
 
#include "MC_ControlStage_param.h"
#include "MC_PowerStage_param.h"
 
 
#define MCO1_PORT GPIOC
#define MCO1_PIN	GPIO_PIN_1
#define MCO3_PORT GPIOC
#define MCO3_PIN	GPIO_PIN_2
#define MCO5_PORT GPIOC
#define MCO5_PIN	GPIO_PIN_3
#define MCO6_PORT GPIOE
#define MCO6_PIN	GPIO_PIN_3
 
#ifndef TIM1_CHxN_REMAP
	#define MCO0_PORT GPIOH
	#define MCO0_PIN	GPIO_PIN_7
	#define MCO2_PORT GPIOH
	#define MCO2_PIN	GPIO_PIN_6
	#define MCO4_PORT GPIOH
	#define MCO4_PIN	GPIO_PIN_5
#else
	#define MCO0_PORT GPIOB
	#define MCO0_PIN	GPIO_PIN_0
	#define MCO2_PORT GPIOB
	#define MCO2_PIN	GPIO_PIN_1
	#define MCO4_PORT GPIOB
	#define MCO4_PIN	GPIO_PIN_2
#endif
 
// DEBUG 0 - 3 PORT PIN
#define DEBUG0_PORT GPIOH
#define DEBUG0_PIN GPIO_PIN_0
#define DEBUG1_PORT GPIOH
#define DEBUG1_PIN GPIO_PIN_1
#define DEBUG2_PORT GPIOH
#define DEBUG2_PIN GPIO_PIN_2
#define DEBUG3_PORT GPIOH
#define DEBUG3_PIN GPIO_PIN_3
// User interface configuration KEY_UP port/pin
#define KEY_UP_PORT GPIO
#define KEY_UP_BIT  GPIO_PIN_6
 
// KEY_DOWN PORT PIN
#define KEY_DOWN_PORT GPIO
#define KEY_DOWN_BIT  GPIO_PIN_7
 
// KEY_RIGHT PORT PIN
#define KEY_RIGHT_PORT GPIO
#define KEY_RIGHT_BIT  GPIO_PIN_5
 
// KEY_LEFT PORT PIN
#define KEY_LEFT_PORT  GPIO
#define KEY_LEFT_BIT   GPIO_PIN_4
 
// KEY_SEL PORT PIN
#define KEY_SEL_PORT   GPIO
#define KEY_SEL_BIT    GPIO_PIN_7
 
// USER_BUTTON PORT PIN
#define USER_BUTTON_PORT GPIO
#define USER_BUTTON_BIT  GPIO_PIN_0
 
/* LCD Chip Select I/O definition */
#define LCD_CS_PORT (GPIO)
#define LCD_CS_PIN  (GPIO_PIN_0)
 
// Brake command
#define DISSIPATIVE_BRAKE_PORT GPIOD
#define DISSIPATIVE_BRAKE_BIT GPIO_PIN_0
 
#endif /* __MC_PORT_PARAM_H */