2014-04-25 08:13 AM
Hello everyone
I had this question in the back of my mind for some time now, i have a vague answer, but that is not what engineers are about -precision , right !? :)The question pertains to any MCU or DSP, how do you determine if an MCU can handle computations in a given application/project. For example:Suppose i have the STM32 (M4) board, and i want to control two BLCD motor with 2 feedback position control. How do you determine if this will be more than what the STM32 (M4) can chew or it can totally handle it. Assume , there is no Flash code limit and FreeRTOS is used.If you could explain to me, how an embedded engineer decides what suitable platform for certain application in terms of M-FLOPS, MSPS, and RAM.Thank you very much #multi-tasking #mflops #stm322014-04-25 10:10 AM
Step#1 figure out what math you're doing, and how frequently you need to do it
2014-04-25 11:07 AM
Depends very much on your specific project requirements.
However, motor control often requires medium complex calculation in very short times, say, a PID control algorithm in a cycle-by-cycle loop of a few microseconds. This is not the specialty of Cortex-M devices. Be clear about your requirements, and evaluate possible candidates - which means MCUs/boards including toolchain. IMHO real DSPs like TI's Piccolo series are much better suited for this purpose. Perhaps because they were designed for it...2014-04-25 02:06 PM
2014-04-25 06:36 PM
You seem a bit green at this, I would suggest you do some coding on a micro-controller, or two, and measure the cycles you need to do assorted tasks.
If I had to take a stab at your previous question I would say you'd probably be able to do something simple on a 2 MHz 8-bit micro at a rate of about 1 KHz, the same things on a 168 MHz STM32F4, you'd probably be able get to 250 KHz with ease.2014-04-26 09:37 AM
... you'd probably be able to do something simple on a 2 MHz 8-bit micro at a rate of about 1 KHz, the same things on a 168 MHz STM32F4, you'd probably be able get to 250 KHz with ease.
That rate should come from your application requirements. If you have a rate of 250kHz, you need to pick up the measurement values (probably ADC + DMA), filter it, and calculate and output the next set value (probably PWM) in less than 4us. Include interrupt latencies, other interrupt service routines, remaining computing requirements and reserves for future improvements/requirements to the picture. If you end up with significantly less than 100% core usage, your project seems at least feasible. Contradicting requirements for fast servicing interrupts can still break it. Several silicon vendors have ASSP's (standard MCU cores with application specific peripherals), which do most of this stuff in hardware. This might be an alterative for you. Usually, they offer them only to commercial customers.