Hello again dear machinists

As some of you know I published earlier this year schematic and firmware for a BLDC servo drive. http://www.cnczone.com/forums/open-s...-software.html
Don't get me wrong, that model is working just fine, but the 8 bit MCU used is somehow limited... So as many other suggested I am migrating now to a STM32 MCU...
Because the price and the fire power of that little thingy is amazing, I intend to integrate in the schematic a prebuild board: STM32F103C8T6 ARM STM32 Minimum System Development Module Board For New Arduino | eBay

Basic MCU specifications:

Model:STM32F103C8T6.
Core:ARM 32 Cortex-M3 CPU.
72MHz work frequency.
64K flash memory, 20K SRAM.
On-board Mini USB interface, you can give the board power supply and USB communication.
Size:53.34mm x 22.86mm.

So... So far I am developing on a STM32F4Discovery board, that has a more powerfull MCU, however I am waiting for the little ebay boards to arrive...

Things that I tested so far and status:

1. PWM generation works great, 16 bit timers are used. Also note that the STM32F103 has a 16-bit, motor control PWM timer with deadtime generation and emergency stop. For now I do not know how to configure it, so I am using timers in a classic fashion. (I will have to rewrite the mikropascal PWM library as it does not support motor control PWM)
2. Communication with the PC will be done using the USB port provided. The board will register as a HID device, no additional driver will be needed. The Servo Tuner program must be rewritten (not such a big deal)
3. External interupts also tested, very nice as they are plenty and they can be mapped on quite any desired pin.
4. ADC not tested yet, but I am pretty sure it works just fine...
5. Flash storing of the configuration parameters. The sample programs from mikroe seem to work just fine... It seems that those MCUs do not have a special EPROM section anymore, but there are instructions capable to write directly to flash part...

What I need to do for now:

- Build another 3 phase MosFET power driver. All that I previously built are in my CNC machine
- Build a dougther board for the STM32F4 discovery board, that will hold very few parts, only the optocouplers for the encoder, step, dir and enable signals, the power regulators and a few connectors.

I intend to add another parameter in the config and to allow user to select what kind of motor it wants: DC or BLDC. When using DC motors only 2 stages from the 3 phase power stage will be connected.
Please let me know if you have any other suggestions, requests for features and so on... It's better to think for them from now when there is no board designed, and there are virtually no limitations...

I will keep you informed on progress

Mihai