TI TMS320F28335 vs STM32 Cortex M4 - Page 1
Forum section: electronics / general

author: VSV_electron
author_rank: Regular Contributor
timestamp: November 04, 2022, 09:37:51 am
content: When looking into options of getting into some MCU DSP/FPU introduction I've noticed that while ARM based boards are all over the Internet forums and blog entries and the information is abundant for them, when it comes to the TI C2000 series in this case available with the TMS320F28335 onboard these are barely mentioned at all (in fact I haven't found any user's information but only the official TI documentation) and there is an impression they are forgotten and neglected. Why is that?

author: bidrohini
author_rank: Regular Contributor
timestamp: November 04, 2022, 01:09:16 pm
content: I think it's because TMS320F28335 is less used than STM32 Cortex M4. Naturally, ARM chips are advanced. Those are not as user-friendly as the Arduino. And when it comes to ARM, STM chips are more popular. However, here I found a tutorial series on TMS320F28335. May be you have already seen it:

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 04, 2022, 01:43:53 pm
content: Accessibility and familiarity.ARMs generally make poor DSPs, in relative terms -- they're general-purpose CPUs and MCUs -- but even the lowest level options are more than capable for a lot of simple applications like audio mixing and effects, or, Idunno, MP3 decoding? Not to mention vector controls like FOC, or, Idunno, some SDR maybe, even some light video processing or rendering (obligatoryitrunsdoom).And, that said, you can get ARMs with a ton of extensions, whether in terms of instructions (FMAC, FP, SIMD, etc.), or hardware support (advanced DMA, say?).I know a lot of TI and other relatively small or proprietary MCUs/ISAs require buying dev tools, haven't looked at that family specifically but needless to say it's a huge differentiator between hobby/amateur use (PCs, ARMs and Arduinos everywhere!) and professional use. And no one's talking about the latter, because it's all on internal forums, or served by internal support, and concerning confidential projects for companies/clients. So, confirmation bias too, but that also happens to feed back in marketing terms as ARMs for example are so popular, found in basically anything, has broad support from free tools, that aren't even awful (indeed GCC is supported by many manufacturers).That last point, kinda just to say -- I mean, there are many reasons why and why not, some good, some bad -- but a basic review of avr-gcc (e.g. Arduino on any AVR platform) output shows it's pretty rough; whereas the optimization for ARM, x86, etc. is quite good (AFAIK). And this is a minor point, of course -- if you need sheer CPU cycles, you're simply barking up the wrong tree using AVR, anyway.But, that said, AVR can be used to modest effect, perhaps with a bit of optimization effort (and fortunately AVR asm is rather easy, as ISAs go) -- I made a reverb effects box, mono 12 bit x 25kSps, using an XMEGA. That's just about rough enough to still be useful; any fewer bits, or a lower sample rate, and it would be probably too unpleasant to use. 16 bit x 44.1kHz stereo would of course be preferred -- that's not going to happen here, but would be easy on ARM.Not that this is all that relevant, if you're talking TMS320s versus Cortex M4s.Tim

author: bhave
author_rank: Contributor
timestamp: November 04, 2022, 03:12:02 pm
content: I use the C2000 series professionally for large motor drives. This is the sort of application they are intended for and excel at. TI is rolling new versions out pretty regularly and they are certainly not neglected. As for performance, you have to step up to the Cortex M7 to be in the same ballpark. Even then, certain operations such as trigonometric calculations are not close. I would also argue the C2000 analog and PWM peripherals are superior to anything I have used on an M7.

author: ace1903
author_rank: Regular Contributor
timestamp: November 04, 2022, 05:23:42 pm
content: STM32s are more present on net because investment to start is basically 5$. Blue pill and st-link clone and that is.I own several dev boards for 28335/377, but cost was something like 300$.And also one don't need DSP to blink LED or to read some sensor on I2 bus.If you filter out stuff like that and look for some DSP related things, you will that basically there is no examples for STM too.If I want to do something, I usually pick some small STM with 48pin max and start designing with Nucleo-32 board.To do the same with TMS I need first to make PCB for the chip and that is boring since smallest package is 176pins.Even to solder that package I need hot air station and fiddling couple of hours.Hope some day someone will make something like blue pill for TMS28F335 too.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 04, 2022, 06:12:37 pm
content: What exactly is the question? A "specialty" line of processors is of course going to be less "popular" than a very general-purpose series of MCU. News at 11.Popularity is by no means an indicator of quality or performance. Should be kinda obvious by now.And if, on top of that, your references are internet forums, random blogs and YT videos, yeah. Very distorted view of reality. By that measure, you'd assume billions of products would be made using 20+-years old ATMEGA MCUs and ARM-Cortex stuff would be almost non-existent, except maybe the STM32F103 (which is itself 15 years old already!).And yes, TI processors in general tend to be pretty good, and I think TI have been clever enough not to try and compete in the wrong areas. They tried a very general-purpose Cortex-based MCU with the MSP432, and while it's an OK MCU, I don't think it's been that successful. OTOH, they have a range of MCUs and processors that are less general-purpose and much better at what they do.

author: peter-h
author_rank: Super Contributor
timestamp: November 04, 2022, 10:20:53 pm
content: I remember the early DSPs and it looks like most of their original applications have now been eaten by general purpose CPUs like arm32, running at 150MHz+ and being good enough for DSP work in the audio range.They also suffered from weird software tools, only later getting C compilers for example. So there is generally less programming and hardware design expertise around the place.BTW the TMS320F28335 is very popular in Iranian drones right nowThese use solid state gyros (not FOGs AFAIK) and GPS.On a similar topic, I used to do tons of FPGA and ASIC design work and was really glad to get out of it. Everything was just weird, weird and crap tools, weird quirks to get stuff to work, tools licensed with protection, etc. I know a lot had changed since but in the end if you are trying to produce a solution it is better to use tools which you knowandwhich you can still get back into in a few years' time. So I would always prefer the 32F4xx I am working on now (and maybe work a bit harder to get the required system performance) than to use a better suited CPU (e.g. a DSP).Of course if you are employed and paid by the hour then weird ways give you better job security - assuming the management is technically inept which mostly they are

author: mkissin
author_rank: Regular Contributor
timestamp: November 13, 2022, 10:39:06 pm
content: I also use the C2000 micros professionally, and I can say that as digital controllers they're excellent.The software support used to be very weird and came with a very bad user license agreement (so much so that originally, I was forbidden by our legal department from using them).Now however it's excellent (Code Composer Studio is just Eclipse, and the C2000Ware code library is very complete), and the chips have excellent data sheets and application notes available.One thing to be aware of is that the 28335 chips are older generation now, so newer variants (the 28002x, 28003x, and 28004x) are probably better choices for playing with. Also, availability is a disaster zone, but that's not out of the ordinary! The LaunchPad devboards for them are very good and there's a very decent ecosystem of boosterpacks available.

author: coppice
author_rank: Super Contributor
timestamp: November 13, 2022, 10:43:46 pm
content: Current ARM parts do a pretty good job of most DSP work. What makes the C2000 special is not its DSP capability, but its ability to do signal processing with extremely low latency in control loops, like in motor control and digital power supplies. Its one of the very best choices for that kind of work.

author: JPortici
author_rank: Super Contributor
timestamp: November 14, 2022, 06:38:40 am
content: Quote from: coppice on November 13, 2022, 10:43:46 pmTrue, anybody doing digital power i talked with, or almost any application note on digital power uses the C2000. Of say 100 cases 96 are C200, 2 are STM32F3/Other simillar arm, 2 are dsPIC

author: peter-h
author_rank: Super Contributor
timestamp: November 15, 2022, 11:09:56 am
content: What kind of interrupt latency is involved (in microseconds)?The ST HAL ISRs are very inefficient because they step through a load of possible interrupt sources, checking each one and calling a function to service it (if pending) but nobody would do that in real code they wrote for a real job.

author: Jester
author_rank: Frequent Contributor
timestamp: November 15, 2022, 12:05:54 pm
content: I have used the 28335 for a few projects stretching back quite a few years, I quite like it. Years ago I was tasked with commercializing a crazy design that had IIRC 256 PICs spread over 10 boards. I replaced all of them with one 28335 on a small board and improved performance. Cost reduced by 95%. Code composer studio is free.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 16, 2022, 02:38:13 pm
content: Quote from: coppice on November 13, 2022, 10:43:46 pmExcept that this low-latency signal processing is completely unnecessary in motor control or digital power supply. Motor controllers run signal processing at rate of tens of kHz max, and this "signal processing" usually means a few PID controllers. You can do a decent, modern, high-performance motor controller on Cortex-M0 part like STM32F030.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 16, 2022, 06:24:47 pm
content: Quote from: Siwastaja on November 16, 2022, 02:38:13 pmOh, absolutely. You can even do that with an 8-bit PIC with fixed-point calculations. And with say a RP2040, you can definitely implement a pretty beefy multi-channel motor controller.For switching power supplies, that is more relevant, where hundreds of kHz to a few MHz is not uncommon, and latency can be critical. For motors, given the mechanical inertia, latency is never that critical as long as it's not ridiculously long.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 16, 2022, 07:08:52 pm
content: There may be some experimental or otherwise special switch mode topologies / control schemes where stock peripherals are not useful and CPU needs to nearly or totally bit-bang the control. Although, classically these are done with a CPLD; actually CPLDs can be found in many AC induction motor VFDs because having peripherals capable of motor PWM generation with pulse-by-pulse current limiting and safety features in $1 microcontrollers is a 2010-era thing. In 1990's or early 2000's, there was no other way but to have CPLD the PWM or space vector modulation plus pulse-by-pulse current limiting, and let a separate MCU handle the FOC / speed control loops.There is certain niche for a highly performant CPUs, but it is much smaller than people tend to assume.But, if you look at for example the HRTIM peripheral in STM32F334, it is very capable of offloading the CPU, even with special snowflake topologies, because it is so flexible.Motors, on the other hand, not only have mechanical inertia, but also shitloads of inductance (thanks to that iron core thing). There are special cases of course, like tiny 200 000 krpm ferrite-cored micromotors that require PWM in excess of 100kHz. Which of course is still totally doable with STM32F030.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 16, 2022, 07:32:40 pm
content: Quote from: SiliconWizard on November 16, 2022, 06:24:47 pmI've got an induction heater working up to 50kHz, on an AVR-DA. Along with ADC and timer overhead, the inner loop (phase detect, comparison, PID) takes about 80% CPU at max frequency (frequency control method, loop runs once per cycle).I wouldn't be confident in running anything as fully featured, much faster than that.You could do a peak current mode control at some 100s kHz, but that's mainly because those things have fast comparators and programmable logic onboard. Average current control wouldn't be as easy, not without errors from ripple aliasing I think.Indeed, motor controls have been feasible even on old MEGAs, though the slow ADC and comparator makes that a little dicey; you aren't going to have something like peak current fault detection, not without external hardware.Tim

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 16, 2022, 07:44:16 pm
content: Now with motors, if working with brushless DC motors, you may actually need strict timings to get any kind of efficiency, as the switching timings are "critical" (as opposed to just controlling regular DC motors with PWM.) I would personally not be very fond of implementing that in pure software bit-banging IOs, but very low-cost products are not my area. I can understand why a few-cent MCU could be an option in applications where every cent counts. (But then again that wouldn't be a fit for those TMS320 processors or similar either, so...)

author: coppice
author_rank: Super Contributor
timestamp: November 16, 2022, 07:49:33 pm
content: Quote from: Siwastaja on November 16, 2022, 02:38:13 pmIt depends what class of power supply you are building. If you are switching at hundreds of killohertz, and expect an impulse response at the output consistent with that kind of switching rate, you need per sample processing. That requires the control loop to update every cycle. So you need an ADC running at the switching rate, without internal filtering causing big delays (e.g. sigma-delta is useless), able to get its results directly into the control loop, along with any protection sensing, and have a result going out to the switcher timing well before the next ADC sample is taken. If you want tight control you can't do much more than simple PID control. The latency in the filters themselves becomes too large for crisp control. That's what high end switcher customers expect, for decent impulse response, and its what high end switchers do. Things like the SMPS oriented C2000 devices have been crafted, by closely working with key customers, to have all its peripherals and its core optimised for that kind of low latency operation.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 16, 2022, 07:52:57 pm
content: I tend to prefer small FPGAs for this, and coupling them with a small MCU for interface and higher-level tasks such as UI/communication.I have limited trust in full software implementations for controlling hardware at such a low-level, and using the above approach allows you not to be tied to any specific vendor/series. Porting the design to a different FPGA is usually very straightforward.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 16, 2022, 08:00:23 pm
content: Quote from: SiliconWizard on November 16, 2022, 07:44:16 pmDo they not run those with PWM, anyway? For best efficiency, I mean? Or is the open-circuit phase enough degree of freedom for that not to be a problem? (...Or do they shape the poles so a square wave drive is kind of close..?!)Tim

author: Siwastaja
author_rank: Super Contributor
timestamp: November 17, 2022, 09:46:43 am
content: Quote from: SiliconWizard on November 16, 2022, 07:44:16 pmI have done BLCD controllers and have absolutely no idea what strict timings you are talking about. Commutation is inmillisecondsor hundreds of microseconds. Efficiency is just perfect as long as electrical angle is estimated within a few degrees, and fundamental frequency rarely exceeds say 500Hz. Inductance of windings prevent any fast change in current anyway.Unless, of course, it is said 200krpm micromotor, but it's still microsecond range, even that is doable on lowest tier Cortex-M0.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 17, 2022, 10:01:58 am
content: Quote from: coppice on November 16, 2022, 07:49:33 pmButeverythingyou described: ADC at >1MHz switching rate, protection sensing (sub-microsecond comparator inputs directly into PWM generation break signal), and so on, is available in any STM32 MCU, has been for at least 15 years. $0.50 MCU now does this up to about ~1MHz PWM and $2 MCU up to about ~2.5MHz.And this is exactly what happens: it's 1990's, and you have an exceptional product which can do X, so it's the greatest thing since sliced bread. But time goes on, it's now 2005 and everybody starts to include the same features in lower-end products. And finally comes 2010's, and we are at the point all of this is completely standard feature set.Then greybeards continue talking about the dinosaur product series, and the younger generation have hard time understanding what's the big deal.And because both the great old DSP from 1990's, and the modern-day $0.50 part provide exactly the same end result, the discussion diverges into some weird, totally unimportant (in 99% of cases) detail, like saving two clock cycles of loop overhead.

author: coppice
author_rank: Super Contributor
timestamp: November 17, 2022, 12:24:26 pm
content: Quote from: Siwastaja on November 17, 2022, 10:01:58 amA lot of C2000 customers started with the STM32 before they switched. Perhaps they've noticed some limitations you haven't. If a 50 cent chip does what you need, use it.

author: Siwastaja
author_rank: Super Contributor
timestamp: November 17, 2022, 01:37:58 pm
content: Sounds like marketing speech, not technical discussion. It's quite revealing you had nothing to say to the technical arguments.Thread title says "TI TMS320F28335 vs STM32 Cortex M4". You listed bunch of features supposedly possible on C2000, but (implicated) not on STM32 Cortex M4. But in reality, I thinkevery single STM32 M4 partin existence is capable of everything you listed. If not, please elaborate, instead of bullshitting something about some customers noticing something I didn't.Per sample processing not possible on a few hundreds kHz SMPS on Cortex-M4? Are you freaking serious? And all you have to say back is "you did not notice something". This is not engineering, this is the definition of cargo cult science. Magical things only C2000 users know, which can't be elaborated on.In reality, competition works wonders and if something used to be the only solution to a problem in past, now there are many different ways to achieve the same. But marketing of course will only sell their own product like a 2MSPS ADC is something miraculous no one else has.And yes, I will continue selling my expertise, please go on and sell yours. I will not use XMOS or C2000 or some other "the only magic sauce" to achieve the same you do.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 17, 2022, 09:54:48 pm
content: FYI, probably a technical comparison is not possible in this venue due to NDAs/licensing. That is, you'd have to dive deep and show what all functions are being performed. Which might not even be contractually possible, let alone worth bringing to a mere forum conversation.I certainly haven't had to do a project complicated enough to need more than so-and-so CPU, but I certainly don't discount the need for more. Or even just different, even if the price options seem irrational. Rarely is an MCU the dominant cost in an overall project.Tim

author: Phoenix
author_rank: Frequent Contributor
timestamp: November 18, 2022, 06:26:06 am
content: Quote from: Siwastaja on November 17, 2022, 01:37:58 pmLet's compare ST's G4 series, which is their power converter aimed line:ST STM32G484 (top end) - $10.74 (octopart)TI TMS320F280049 (mid range) - $7.86 (octopart)Processing coresTI has C280(FPU, TMU) + CLA @ 100MHz (two processing cores)ST has Cortex M4F @ 170MHz (single processing core)TI's C280 core is generally faster clock for clock and more code efficient than the M4F.https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/873371/tms320f280049c-how-to-benchmark-c28x-fpu-with-arm-cortex-m4-especially-in-math-capabilityComparatorsST has 7 comparators - each of which is a single comparator.TI has 7 comparator sub-systems - each of which contains 2 comparators with individual DACs, filters/qualification and logic control.PWMTI has 16 PWM - each pair operates from an entirely independent ePWM, with their own counters, output control logic etc.ST has 24? PWM - but only 3 timers (4 pairs share 1 counter, logic).Comms PeripheralsTI has 1xI2C, 2xSPI, 2+1xUART, 2xCANST has 4xI2C, 4xSPI, 3xUART, 3xCAN, USB (ST definitely wins here).Quote from: Siwastaja on November 17, 2022, 01:37:58 pmAgreed. TI stagnated in products and price until chips like the dsPIC, STM32, Infineon and others started offering better peripherals and value.None of these are show stoppers for STM32 - in fact they do get used; but this certainly shows that TI has been in this space for a while, listen to their customers, know what they are doing and still value competitive.(Yes, I am am experienced TMS320 fanboi)

author: Harjit
author_rank: Regular Contributor
timestamp: November 19, 2022, 07:03:49 pm
content: The STM32G484 should have the HRTIM which can provide many more PWMs.Comparing the performance between the TI and ST part is a little difficult. For example, if it works for your application, you could use the CORDIC, the CPU and the Filter MAC at the same time and get some insane throughput.I think the TI part is a monster but so is the STM32G4.

author: Smokey
author_rank: Super Contributor
timestamp: November 19, 2022, 10:52:39 pm
content: Quote from: coppice on November 13, 2022, 10:43:46 pmThis. I've also worked with TMS320 parts professionally for quite some time.TI essentially owns the high end motor control industry with this line of DSPs. Look under the hood of just about any professional servo drive/inverter and you will find a TMS320.I'm pretty much just repeating what everyone has been saying already.... but... It's not just the processor performance (which is excellent), but their peripherals have more advanced configurability options than just about anything (super advanced PWM control, excellent encoder support, excellent ADC timing/triggering, etc). Their move from a custom IDE to Eclipse based Code Composer was the first pro level supported tool that I remember doing that. Now pretty much everyone has an Eclipse based IDE.The TMS320 parts do require their own (expensive) type of programmer, so don't expect your JLink to work very well if you already have one of those.If you are doing motion control or power electronics, then it's probably a good idea to consider skipping the general purpose ARM whatever and look at a TMS320 series. If you are flipping an LED, then go STM all day long.

author: uer166
author_rank: Super Contributor
timestamp: November 19, 2022, 11:10:13 pm
content: Quote from: Smokey on November 19, 2022, 10:52:39 pmI think out-dated/ignorant stuff such as this is largely the reason why you don't see more STM32G4-type micros in motion controls, as opposed to any kind of technical reason.

author: uer166
author_rank: Super Contributor
timestamp: November 19, 2022, 11:21:53 pm
content: Quote from: Phoenix on November 18, 2022, 06:26:06 amSTM32G484hasway more timers than this, datasheet figure is 17 timers. The HRTIM alone is 7 individual timebases with 2 PWM outputs each that can be independent or chained in whichever way. That's 7 timers/14PWM, not including the "normal" stuff. Each instance has 4 compare and 2 capture registers, and a full set/reset matrix that can run to stuff like other timers, comparators, external pins. Chip also 6 opamps, and while the TMS320 has PGAs, they're less flexible I believe. STM32G4 and has more integrated analog than TMS320, making it more suitable for "all-in-one" DSMPS or drive system controllers when compared to the TMS320. You basically connect all analogue stuff internally: inputs go to opamps, those go to comparators and ADCs, DACs input to the comparators, etc etc. You save a great amount of pins by using the analog crossbar that way.All of the stuff saying that somehow TMS320 is more suitable in general because "insert some strawman about faster realtime processing" is more-or-less BS, and has been for many years. I think the real difference is the high-end where the STM32 lacks. Stuff like dual/quad core TMS320 running at hundreds of MHz with ASIL D, but that's about to change with ST Stellar series, though it won't be available for a few years.

author: coppice
author_rank: Super Contributor
timestamp: November 19, 2022, 11:38:06 pm
content: Quote from: uer166 on November 19, 2022, 11:21:53 pmYou have created the straw man argument by saying its being argued that the C2000s benefit is faster real time processing. Its not. Its all about latency. Latency is irrelevant in most DSP, but for almost anything in a control loop it is the most critical factor.

author: JPortici
author_rank: Super Contributor
timestamp: November 20, 2022, 07:39:32 am
content: Quote from: uer166 on November 19, 2022, 11:21:53 pmI saw the announcement some time ago, but are they really coming out to the general public? and for how long? Bosch was using them already in 2019 (the high end ECUs with the stellar were already in production for some time, i want to say 2016)The only manufacturer of cortex R that you can actually buy is TI, not even NXPAlso from the briefs they don't look like they care much about power converters/motor drives

author: peter-h
author_rank: Super Contributor
timestamp: November 20, 2022, 04:46:50 pm
content: I think if you are good with CPU X then you will achieve Product Y in less time than with CPU Z on which you have less expertise.Same with languages...And 3 phase motor drives (AC drives, inverters, whatever they are called) are a specific area which has specific players in it, and these firms have had the same people working there, who they work hard to retain, for many years.I've never done 3 phase motor drives but heard that one needs to do stuff on microsecond timescales, when driving motors going at say 10000 rpm. One is synthesising all the waveforms in the CPU, either with PWM or with table-driven waveform generation. There is high speed current sensing to do too. I imagine that if you are doing a dumb drive, where you just generate 3 phase sinewave, it is pretty simple. With 3 DACs you can generate 3 arbitrary waveforms trivially, with a circular DMA->DAC mode, almost zero software running. I have such a generator running. 128 samples per cycle, up to a few kHz. That is how it was done 40 years ago, in the pioneering days of that business.I've been working on a 32F4 project the last 2-3 years and no way would I change now. I will use this platform for absolutely totally everything! And if it doesn't do the job then I might use a coprocessor, FPGA, etc. Well, maybe not an FPGA; they are truly horrible (used to do FPGA/ASIC design consultancy).Also the current chip hoarding situation has taught a lot of people to focus their stock profile.

author: coppice
author_rank: Super Contributor
timestamp: November 20, 2022, 05:49:50 pm
content: Quote from: peter-h on November 20, 2022, 04:46:50 pmWhen people ask what is the best MCU to use the best answer is "one you are very familiar with". If none of the ones you are familiar with is going to do a great job in the current application, only then should you even look around the market for a best choice. However, mismatches are rarely due to the CPU, unless its a speed issue. People write most MCU code in C these days, and any adaptation needed from one small machine C's specialisations to another's is usually trivial. Its the peripherals which really allow you to carry over expertise from one project to another. "Nothing I'm familiar with can do a decent job here" is usually about peripherals, memory size, or price, rather than the CPU. Few MCUs are designed for a general market place. They are mostly a mix of things needed for one or two applications bundled together from available modules, with perhaps one or two very domain specific modules specially developed. If an MCU has a weird looking mix of elements, you just don't recognise the target applications.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 20, 2022, 10:47:18 pm
content: Quote from: peter-h on November 20, 2022, 04:46:50 pmI once took apart a drive (even older than that), chock full of DTL chips I think it was; want to say, two large boards for control? Didn't spend any time tracing the circuits (or inspecting the service diagrams -- they're classical gibberish anyway, big unlabeled buses routed everywhere, a nightmare to follow the logic). So, no idea what all they were doing with it, but I recall recovering an ovenized(!) ICL8038 function generator from it, maybe for master clock or something, but who knows; like, three with a PLL would make more sense for generating the phases, but that could also be done with integrators and comparators and no fancy-pants osc chip. Anyway, power stages were SCR input (phase controlled DC link) into 3-phase SCR bridge, plus a couple diodes (or SCRs too, I forget?) for commutation. I salvaged some rather large inductors from that...That thing was a piece of work in its day... and all that for 10 HP of variable speed control!Oh, I don't even remember what kind of interface it had... I don't recall a CPU, and there wouldn't have been enough logic to construct a full one; maybe just enough to build a state machine for something like Modbus, but that might not've been around at the time either. Might've been analog inputs (0-10V etc.) and all that logic is a byzantine state machine just managing gate pulse timings.Oh... it was an Eaton Dynamatic, if anyone was curious. Don't remember what model or year, but it was 10 or 15HP, and I recall the contemporary models (bigger? smaller? newer?) were trilington BJT output, not SCR. The service dept. (where I saw the thing) didn't have many other SCR units on file, as I recall, so it was kind of special. And, perhaps, marked for replacement as a result. We replaced it with a modern VFD of cubic proportions, and a tiny fraction of the size, obviously.Oh yeah, they also had a MG set or two still floating around(!), which also got upgraded. This was back in the mid-late 2000s....As for relevance today, I mean... op-amps haven't gone away, I guess, right?Anyway, reminiscence aside:The biggest and oldest VFDs I think are just like that, largely open circuit, little room for error but it Never(TM) missteps, nor the load faults, etc...Partly by necessity, like the biggest inverters, for HVDC transmission, the SCRs (or IGCTs or whatever they're using these days) are basically useless switching any faster than mains frequency, so they tend to use multilevel inverters, and of course big stacks of devices and optical isolation (drive signal via fiber, maybe even drive power via PV) to achieve the high voltages. I wonder what the controls on those look like. They probably don't much care about short circuits, because accidentally shorting out (or cutting) a gigawatt transmission line is going to make a hell of a lot bigger problem at the fault itself, and upstream, and downstream.Huh, now I wonder if, like, an aircraft has ever accidentally (or not..) hit an HVDC line, and what that does. The cables are pretty big, I wouldn't be surprised actually if they can withstand a direct hit from GA craft, but at some point it'd be enough to snap. Shorts would be easy by sabotage but would require specific equipment (shooting or towing a metal cable over the tall wire) so it's pretty safe from domestic nuisances like people hand-throwing wires or chains I guess.Anyways, at modest power levels and below (some MW say?), more switching edges is reasonable, and you can do harmonic reduction, like magic sinewaves, or just full-on PWM and wave synthesis. Magic sinewaves are the most computationally intensive; they are nontrivial to solve for amplitude variation. But you have hundreds of thousands of CPU cycles to prepare for the next output cycle, so the full matrix solution isn't a huge challenge by the kinds of CPUs we're talking about here. And that still assumes high latency (per quarter cycle or thereabouts), and any less latency required, will be on an exponentially simpler problem (like current regulation and PWM). Well, almost any; I suppose you could do a full state space solution with respect to every switching edge (and that might be something you'd use an FPGA and wideband ADC for), but cycle-average (that is, over the PWM cycle) solutions could also be derived from such a system, I'll bet.Tim

author: peter-h
author_rank: Super Contributor
timestamp: November 21, 2022, 11:10:32 am
content: 40 years ago one would be generating sinewaves either analog, or digitally with stuff like cordic. Or even by driving an EPROM (containing a sine table and driving a DAC) from a sync counter whose clock frequency you vary - I did that in 1977. So simple variable frequency 3 phase was always trivial. And to start and run a 3 phase motor you just need 3 phases, plus variable amplitude because at lower revs you have to use a lower voltage to achieve a constant torque.I think today's AC drives do much more complicated stuff. For a start with the simple methods you get poor torque at low revs.

author: coppice
author_rank: Super Contributor
timestamp: November 21, 2022, 02:15:29 pm
content: Quote from: peter-h on November 21, 2022, 11:10:32 amToday you don't want to simply drive a motor. You want to collaborate with it.If you implement the control feedback with a bunch of sensors they add cost. So, lots of motor control uses more compute power these days to implement sensorless control. Compute is now cheaper than sensors, and there are less bits to go wrong.

author: peter-h
author_rank: Super Contributor
timestamp: November 21, 2022, 02:46:45 pm
content: I read somewhere that you briefly interrupt the driver to the motor and during this gap you measure the back EMF, and other stuff, to work out what the motor is doing. Also armature position measurement.Sensors are still needed for accurate speed / position control at low revs. I see this in the product ranges of AC drive manufacturers; they sell tachos for those applications.

author: abyrvalg
author_rank: Frequent Contributor
timestamp: November 21, 2022, 06:14:24 pm
content: Things like FOC and sensorless angle feedback run with very little effort (convert FP math to fixed point) on pretty basic MCUs like STM32F103. Streets are full of such examples - electric scooters.

author: mkissin
author_rank: Regular Contributor
timestamp: November 21, 2022, 11:24:41 pm
content: While I was still at university, we had a visiting academic from the ABB research center and he was focusing on model predictive control. Very smart guy.He was controlling giant motors at many MW power, and the motor was located several thousand meters away from the drive (it was an offshore application, but the drive was onshore). Switching events were so costly in terms of power loss that they devoted hundreds of watts of power to processing the model just to avoid a single edge. You end up with a variable frequency and the motor kind of coasting on inertia during some moments when you would have otherwise switched.Just an anecdote, but the lesson is...use what's appropriate. Sometimes that's simple, other times complexity is called for. A lot of skill lies in telling the two apart

author: bhave
author_rank: Contributor
timestamp: November 22, 2022, 02:24:12 am
content: The complexity difference between controlling a 1kW BLDC on an e-scooter and controlling dual 2000kW induction wheel motors on a 400T haul truck at 3x base speed is immense. Your favorite vendor's Cortex-M4F is plenty for the scooter and pushing it for the haul truck. TI has been trying to market versions of the C2000 into the former, but their main usage is the later and where they really shine.Horses for courses ... I would use a Cortex-M series all day every day for general purpose MCU work. I would never even consider them for super high performance motor control.Not many hobbyists have access to the high power sources or motors that make our society function and the vendors of the drives are extremely tight-lipped regarding the low level details. Thus, the C2000 series continues to flourish in the background and TI continues to update them with higher end specifications. They are definitely not general purpose processors and will never be popular or mainstream.I would stick with whatever Cortex-M series part you can find for most applications. Unless you just want to try a C2000 out, which is cool too. They have some nice features.

author: mkissin
author_rank: Regular Contributor
timestamp: November 22, 2022, 03:29:54 am
content: Getting off track here a smidge, but one thing I quite enjoy doing is looking at block diagrams for special purpose controllers and seeing what was deemed worthy of being included.For example, NXP announced their new S32E2 ARM processors for automotive use. They're a beast.* 8x Cortex R52 (optionally as lockstep pairs)* 6x Cortex M33 (in lockstep as 3 pairs of cores)* 1x floating point DSP (not sure of the core itself)* 1x Cortex M7* 24x CAN-FD interfaces* 2x gigabit ethernet interfaces

author: AVI-crak
author_rank: Regular Contributor
timestamp: November 22, 2022, 09:03:10 am
content: Quote from: mkissin on November 22, 2022, 03:29:54 amSuch a huge variety of cores - requires very very very fast memory, and a very very very wide data bus.There are three types of events:NXP has managed to trick physics and created space memory. (I do not believe)A new investor with huge capital and no brains. (I do not believe)NXP's engineers have been gorging themselves on mushrooms, and are obviously fooling around. (I believe).

author: JPortici
author_rank: Super Contributor
timestamp: November 22, 2022, 10:20:55 am
content: Quote from: AVI-crak on November 22, 2022, 09:03:10 amhttps://www.nxp.com/docs/en/fact-sheet/S32E2FS.pdfSee the diagram on page 2.The cores have their own dedicated memory, the idea is to have cores dedicated to a specific function instead of a single/dual core switching between threads. Also the documents available to the public don't show how the peripherals are interconnected between the cores, they just throw everithing in a mix

author: nctnico
author_rank: Super Contributor
timestamp: November 22, 2022, 11:47:40 am
content: Quote from: bhave on November 22, 2022, 02:24:12 amI don't want to attack your choice here. What I would like to know though, is that because of the hardware features or the processing power? That much more interesting part of the discussion got snowed under by people claiming 'I can do that too with XYZ'.

author: bhave
author_rank: Contributor
timestamp: November 22, 2022, 02:07:11 pm
content: Quote from: nctnico on November 22, 2022, 11:47:40 amIt is mainly due to low latency processing and peripherals. The C2000 core is optimized to execute things like control loops much faster than most general purpose cores. Once you start stepping up to the Cortex-M7 for more performance, you get longer pipelines and latencies. I benchmarked a complex vector induction motor FOC loop at one point on a few different processors and found the C2000 executed the loop the fastest and with the least jitter. Even a little bit of cycle time jitter can cause unwanted oscillations in large motors running at high speeds.I really like the C2000 EPWM. It is incredibly flexible and well thought out. I have not looked into the newest ST HRTIM, but the previous timers felt lacking when trying to set up complex multi-level configurations.The C2000 trigonometric accelerator is very nice. It supports floating point, unlike the CORDIC implementations I see elsewhere. We have seen a 1.6x speed improvement in some of our algorithms just by moving from an older C2000 without the accelerator to one that supports it.The C2000 CLA lets us run some time sensitive control loops in parallel with our main control loop. This gives us more processor time to do things like communicate with the outside world or run slower non-critical loops such as motor temperature and resistance estimations.

author: voltsandjolts
author_rank: Unknown
timestamp: November 22, 2022, 02:21:09 pm
content: I know nothing about motor control but curious...Quote from: bhave on November 22, 2022, 02:07:11 pmHow does that happen exactly?I mean motor control outputs are driven by hardware peripherals, aren't they?So how does firmware timing jitter propogate through to the motor itself?

author: bhave
author_rank: Contributor
timestamp: November 22, 2022, 02:54:06 pm
content: Quote from: voltsandjolts on November 22, 2022, 02:21:09 pmThe PWM duty cycle is updated every control loop based on feedbacks and calculations. Most of those calculations assume a consistent control loop sample time. Variations of the real sample time make the feedbacks incorrect compared to what is commanded. The control loop then has to try to fix this issue on the next update. This has little to no impact on smaller lossy motors. On large motors, this can vary the current by measurable amounts.

author: coppice
author_rank: Super Contributor
timestamp: November 22, 2022, 03:50:01 pm
content: Quote from: bhave on November 22, 2022, 02:07:11 pmI don't think you mean quite what you said in the words I emphasised, and your wording really muddies the waters for people approaching control loops for the first time. The C2000 core takes a pretty low number of cycles to perform control type signal processing operations compared to most general purpose cores. but itslow and predictable latencythat is emphasised in its design, and in the design of the peripherals around it. No amount of super fast CPU operation can compensate for algorithmic latency. That latency needs to be squeezed out of the processing algorithms by the software developer, and out of the hardware pipeline by the silicon developer.

author: coppice
author_rank: Super Contributor
timestamp: November 22, 2022, 03:54:04 pm
content: Quote from: bhave on November 22, 2022, 02:54:06 pmThe real problems start when the jitter forms patterns. Then the jitter no longer represents something like Gaussian noise in the loop updates, and starts to have specific frequency content. If one of those frequencies hits a mechanical resonance the results can be quite destructive, from high mechanical wear to complete self destruction.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 22, 2022, 03:57:52 pm
content: Who doesn't update loop outputs with DMA, buffered timers or the like..? This seems like a non-issue even on your basic AVR...well, some of them.Tim

author: nctnico
author_rank: Super Contributor
timestamp: November 22, 2022, 04:04:15 pm
content: Quote from: T3sl4co1l on November 22, 2022, 03:57:52 pmAll these methods need to cater for worse case execution time. So they increase latency which can eat into your control loop phase margin.

author: coppice
author_rank: Super Contributor
timestamp: November 22, 2022, 04:16:53 pm
content: Quote from: T3sl4co1l on November 22, 2022, 03:57:52 pmPeople don't use DMA if they want low latency.

author: peter-h
author_rank: Super Contributor
timestamp: November 22, 2022, 04:22:30 pm
content: As I said I've never done 3 phase motor control but normally when doing control loops (PID or whatever)digitally, one has to get the algorithm to do its output at a regular "tick".Obviously the computations need to be done before the next tick.One doesn't make use of the CPU's "inherent performance" to achieve this periodic output. It merely needs to finish before the time slot is up.This is the fundamental difference between analog and digital control loops. With analog, your loop time constants are set by Rs and Cs etc. With digital, you need to do the calcs "fast enough" but the output(s) come out on a periodic tick.How does motor control differ from the above?

author: abyrvalg
author_rank: Frequent Contributor
timestamp: November 22, 2022, 04:37:50 pm
content: A typical cheap FOC setup seen on ST's F0xx/F1xx: a timer in PWM mode, 3 channels drive phases, 4th channel triggers current ADC capture, ADC fires a completion IRQ where PWM reload values are calculated for the next cycle (fast enough before reload). Everything looks to be in sync with the timer, no?

author: coppice
author_rank: Super Contributor
timestamp: November 22, 2022, 04:40:41 pm
content: Quote from: peter-h on November 22, 2022, 04:22:30 pmWhether the loop is analogue or digital your loop time constant is set by some simple equations. In one case these are implemented by analogue filters, and in the other by some digital computations. The actual processing is essentially the same, with the same algorithmic delays. The difference with digital approaches is the hardware to get the loop's input data and and put its output data adds additional delay, hurting performance relative to an analogue approach. Most general purpose digital hardware does a weak jobs here, as it is usually optimised for throughput. Try using most DSPs for control loops and you get poor results because they are quite focussed on processing samples in bunches, rather than one by one for low latency. Things like the C2000 don't have massive throughput, but they do squeeze those additional delays to the bone, typically maximising a loop's phase margin. Then you get the benefits of a digital approach - very repeatable results, very tunable results, etc. - with only a modest loop performance hit compared to an analogue solution.

author: bhave
author_rank: Contributor
timestamp: November 22, 2022, 04:42:18 pm
content: Quote from: coppice on November 22, 2022, 03:50:01 pmYou are correct. The wording was sloppy on my part.

author: peter-h
author_rank: Super Contributor
timestamp: November 22, 2022, 04:45:46 pm
content: I think the use of timers for PWM is a distraction; it is done to save the cost of a DAC (or 3 DACs).I know "everybody" uses timers for DACs... it is good because you get high resolution (~16 bits) and they cost nothing. But it leaves you with a lowpass filtering challenge.I guess with motor control you don't lowpass filter but instead, for efficiency, feed the PWM direct to the motor windings and let their inductance do the lowpass filtering.But still the PWM duty cycle update will be done on a "tick".

author: voltsandjolts
author_rank: Unknown
timestamp: November 22, 2022, 04:57:45 pm
content: Quote from: peter-h on November 22, 2022, 04:45:46 pmYeh, that's the crux of my earlier query.I mean, if firmware jitter makes it through to the motor, then PWM updates can't be done on a "tick" but instead as-soon-as the calculation is completed?Maybe the calculations are started on a "tick" (perhaps the ADC saying it's done all input conversions) and PWMs are updated as soon as calcs done?

author: peter-h
author_rank: Super Contributor
timestamp: November 22, 2022, 05:04:24 pm
content: That would work very badly because so many calcs are data dependent.I've just taken apart an aviation AHRS box which was done ~2003 and uses a TMS320 variant. Lots of floating point maths in there.I can see that in 2003 this was perhaps the only way to do it.

author: coppice
author_rank: Super Contributor
timestamp: November 22, 2022, 05:37:40 pm
content: Quote from: peter-h on November 22, 2022, 04:45:46 pmThese days people usually need set of signals to feed some switching transistors, so PWM is exactly what the want. Often people don't properly compensate for the weird frequency characteristics of using PWM like its a DAC (basically it varies between something akin to a Dirac sampler, and a ZOH, with the attendants effects on frequency response), but its still the way to do.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 22, 2022, 05:46:12 pm
content: Quote from: voltsandjolts on November 22, 2022, 04:57:45 pmMy proceeding comment was in regards to this as well.If the modulation method is PWM,And the PWM is fixed frequency (and take your pick, phase balanced or single edge type),And the PWM timer TOP count is fixed,And the PWM timer is free running at all times,And the PWM COMPARE value is updated when the control algorithm has a result ready and it is safe to do so,Then,There is no jitter. It's a buffered system, and the latency is exactly one cycle (maybe two for double buffering). That one qualification, "safe to do so", precludes certain updates on certain timer designs (when the hardware checks for equality only, not magnitude compare, updating the CMP register below current count completely skips the pulse that cycle -- or worse, depending). When buffering is used (i.e., CPU stores new CMP into temp register, timer automatically pulls temp register into actual CMP register the next time it resets), and when the hardware handles the buffer and update proper and atomic: it is safe to do so at any time.The TOP register doesn't need to be fixed either, that can vary too, with the same restrictions on when to update, or if buffered, of course. In that case, if the control runs at the PWM frequency (equal sample rate), the control time constants also vary, which may do weird (non-LTI) things, but it's usually not a concern when the variable range is small.And, give or take number of ADC channels required, or that can be sampled simultaneously or sequentially (most MCUs can auto-increment mux so that subsequent samples are taken at zero cycles jitter), which can be triggered by PWM timer reset event for example (in applicable MCUs, which I think is a lot of them these days?). If that has to be triggered by interrupt, there will be some jitter there (potentially just a few cycles, but usually some atomic sections in main() are needed, making it worse).Now, I can imagine some arbitrary-edge switching controls where it would matter -- and maybe you can't sequence that very well with traditional hardware, putting harder constraints on the CPU (say, if not direct bit-banging, then CPU triggered at least). But it simply sounds like a poor design that can't, say, queue an edge or two in advance; maybe calculated from best assumed inputs at the time. Granted -- these might not be easy designs either, so, "poor" in this particular sense might not be all that tractable given other limitations (project timeline etc.).Tim

author: bhave
author_rank: Contributor
timestamp: November 22, 2022, 05:56:29 pm
content: Quote from: voltsandjolts on November 22, 2022, 04:57:45 pmBingo! Generally, the ADC conversion is triggered by the PWM reaching some particular spot in the cycle. The ADC then fires an interrupt saying it is done. This interrupt is used to make the calculations that determine the next PWM duty cycle.

author: coppice
author_rank: Super Contributor
timestamp: November 22, 2022, 06:19:19 pm
content: Quote from: bhave on November 22, 2022, 05:56:29 pmYou seem to be describing a very specific hardware implementation, rather than a general approach. The ADC triggering the PWM is just as common. The only general principal is the two should be phase locked.

author: peter-h
author_rank: Super Contributor
timestamp: November 22, 2022, 06:21:44 pm
content: What is the ADC measuring?

author: Smokey
author_rank: Super Contributor
timestamp: November 22, 2022, 09:42:29 pm
content: Quote from: peter-h on November 22, 2022, 06:21:44 pmFor control loops: Analog command inputs. Phase currents. Bus voltage. Possibly phase voltages. Possibly resolver or sine/cosine encoder feedback.For other lower priority: System voltages (5V, 3.3V, etc), temp sensors, etc.

author: peter-h
author_rank: Super Contributor
timestamp: November 22, 2022, 10:08:14 pm
content: Doesn't one measure primarily the back EMF?Most 3 phase drives don't use a tacho or any other sensor. Only in less usual (or high end) applications are these used.

author: Smokey
author_rank: Super Contributor
timestamp: November 22, 2022, 11:35:36 pm
content: Quote from: peter-h on November 22, 2022, 10:08:14 pmBy "Phase Voltages" I meant the BackEMF.Just about anyone operating in position mode needs some actual position feedback (incremental, sine/cosine, digital BISS/EnDAT, resolver, etc). Low speed operation typically sucks for sensorless as well.To make another statement that is going to get people riled up: I guess another argument for TMS320 over STM would be that TI designed the TMS320 for motor control (+ other control stuff). ST Purchased an ARM core IP and strapped some motor control stuff on later.

author: nctnico
author_rank: Super Contributor
timestamp: November 22, 2022, 11:43:17 pm
content: But isn't any CPU + PWM peripheral a CPU with motor control strapped on? I don't see that as a particulary inflammatory statement. You can just as well say that TI took a DSP core they already had and strapped motor control hardware onto it. Meh.So far it seems the advantage of using the TI DSP is that it is faster per MHz and has a more predictable execution time.What I have not seen mentioned are things like being able to -somewhat- safely recover from a hardware or software failure. But I don't see how a CPU core by itself makes a difference in that respect.Another differentiator could be that the TI DSP consumes less power to do the same task.

author: abyrvalg
author_rank: Frequent Contributor
timestamp: November 23, 2022, 01:24:29 am
content: Then there are chinese MCUs even more “designed for motor control”, i.e. Fortior FU6818 containing a “FOC accelerator” peripheral fed with the angle and current vector components, doing all stuff like Clarke/Park/SVPWM internally. The core is 8051

author: bhave
author_rank: Contributor
timestamp: November 23, 2022, 02:05:48 am
content: TI has a pretty decent whitepaper describing some of the C2000 benefits with a comparison to competitors:https://www.ti.com/lit/an/spracw5a/spracw5a.pdf

author: mkissin
author_rank: Regular Contributor
timestamp: November 23, 2022, 07:38:14 am
content: Quote from: abyrvalg on November 23, 2022, 01:24:29 amSome of the C2000 variants have similar functionality, with InstaSPIN (-FOC and -MOTION variants) built into ROM inside the chip. You do need to make sure the one you're buying has it though, as it's pretty 50/50.

author: peter-h
author_rank: Super Contributor
timestamp: November 23, 2022, 09:29:17 am
content: That's an interesting comparison paper.The ST chips aren't that much worse, especially allowing for the fact that benchmarks are always rigged. I'd say the differences are in the same ballpark as the old CPU benchmarks which everybody was doing in the late 1970s, when each CPU maker did their best to write an assembler version of the Eratosthenes sieve80x86, Z8000, 68000, TMS9900... max diff was about 30%.The bit where the TMS320 really shines is the variation in execution time, but that's more a matter of doing the software architecture right.As I said before, it's a case of what you are good with. I have just taken apart a pricey Powerware UPS (which, like most UPSs, packed up after a couple of years). There is a controller board in there which basically drives the whole thing, and that has a TMS320. The switch mode stuff is done with dedicated chips so this 320 was doing the overall logic and the front panel LEDs... The 320 got a lot of people on board 20-30 years ago, it really was a great solution for a lot of stuff back then (and the only solution for DSP stuff, and was good for other specialised stuff like crypto) and they have no reason to drop it now, so it gets used for everything possible. The pricing is not out of line, so why not? The 56000 DSP was a one-trick horse and died out.TI and ST are both serious "industrial" players and they run chips for many years. Unlike chinese stuff, there is no geopolitical risk.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 23, 2022, 07:10:14 pm
content: The C2000 line is great. I have a hard time finding out when exactly it was introduced. It's not brand new either and surely a lot of current Cortex M4 MCUs out there can do the job as well. Even much less powerful MCUs can in a lot of cases, especially when they have proper peripherals than can be chained, which is becoming relatively common these days. Alleviates a lot of hard real-time requirements software-wise.I know this is the topic of this thread, but there is almost always more than one way to skin a cat. Engineering is not a contest.Pick whatever fits your requirements. Do not look for silver bullets.

author: Smokey
author_rank: Super Contributor
timestamp: November 23, 2022, 09:35:31 pm
content: Quote from: SiliconWizard on November 23, 2022, 07:10:14 pmEverything is a contestBad designs lose to good designs. The best designs get awards (making more money).

author: nctnico
author_rank: Super Contributor
timestamp: November 23, 2022, 10:29:52 pm
content: Quote from: Smokey on November 23, 2022, 09:35:31 pmIf the latter where true, Microsoft wouldn't exist

author: peter-h
author_rank: Super Contributor
timestamp: November 24, 2022, 10:29:47 am
content: MS got big for good reasons too e.g. backwards compatibility. In the corporate world, you need new "paradigms" like you need a hole in the head. You want to focus on your business objectives, not on learning new tools. In the 1980s I used to sell office automation kit (printer buffers, printer sharers, with 4MB RAM !!! for £2500) to e.g. the banking community which was solidly MS-DOS 6.22, then WFWG3.11, MS Word, MS Excel, etc and these people were making billions using this productivity IT tech. And once centrally administered mainframes with a hundred VT100 VDUs faded in the 1980s, there is a huge risk of people wasting half their working day trying to fix something not working on a PC.This isn't entirely off topic because we choose processors for the same reasons. If a TMS320 costs 5 quid, and you've been using it for 20 years, why change to another chip costing 5 quid? TI is a great company - way above all the opportunistic crooks and shysters and conmen who have come to dominate parts of our business (the likes of Atmel, Maxim, Microchip, FTDI, LT) which I have been busy designing out lately and replacing them with common chips from TI and ST.Why the other DSPs faded away, is a good Q. I think probably because they were never turned into "microcontrollers". The 56000 for example outperformed the 320 in the relevant era by a big margin. But TI turned the 320 into a nice general purpose chip so once lots of people learnt it, and once a C compiler came this was much easier anyway, they stayed with it. Iranians use it in their missiles so there you go

author: nctnico
author_rank: Super Contributor
timestamp: November 24, 2022, 12:12:35 pm
content: Not all DSPs have faded away. Analog has turned some of theirs into general purpose microcontrollers as well which you can find in various pieces of test equipment being used as microcontrollers.The DSPs that did go away are the awkward ones that have strictly seperated code & data busses and could only be programmed effectively using assembly (ADSP21xx series for example). Portability is key nowadays.About 2 decades ago I was in a meeting with a company that had developed some nifty algorithms using Motorola DSPs. We where interested to use those algorithms in a product but it turned out they had programmed everything in assembly and the DSPs they where using where about to go end-of-life which meant all the assembly code had to be adapted to a different DSP. We never proceeded any further and developed our own algorithms. In C.

author: abyrvalg
author_rank: Frequent Contributor
timestamp: November 24, 2022, 01:04:34 pm
content: 20 years old TMS320 and the recent C2000 have little common. There were radically different several subfamilies, i.e. C54x/C55x (modem cores of all classic Nokias) were single-issue, C6x were VLIW, some sub-subfamilies of each were fixed point, others were floating point.

author: coppice
author_rank: Super Contributor
timestamp: November 24, 2022, 08:56:08 pm
content: Quote from: abyrvalg on November 24, 2022, 01:04:34 pmI think your dates are off. The C2000 is very different from other TI DSPs, but the earliest variants have been around for 20 years now.

author: analityk
author_rank: Regular Contributor
timestamp: March 02, 2023, 04:34:46 pm
content: This thread seems to be interesting but from my perspective go ahead in wrong way. Rather I was expecting some technical data or specific hardware differences between two architecture but I get tons of speculation even without any measurements, for example how many times this MCU need to make some filters or FFTs. Nothing.In case of peripheral I have never seen here PSOC4/PSOC6, where you can meet opamps, comparators, two cores (150MHz CM4 plus 100MHz CM0+) etc and even PLD.Even more, I thought half word have been fixed with STM, during STM provide ugly and bugy ide and documentation is poor.

author: JPortici
author_rank: Super Contributor
timestamp: March 02, 2023, 04:53:37 pm
content: Quote from: analityk on March 02, 2023, 04:34:46 pmIn my opinion it is unfortunately a case of "those who know won't say" and the only thing we can do is speculatePSOC are rarely mentioned, true, that should say something (they are niche parts after all. Niche parts, niche features, harder to replace if nothing's available, cost, nonfree tools only, ...)people doing more "serious" development are not using Cube MX. They tend to use IAR and their own libraries.I use mainly microchip, a friend uses mainly STM (IAR IDE and compiler). We both agree that while MPLABX kind of sucks and it's no IAR (lord, i wish) at least it's not some eclipse based crap.

author: coppice
author_rank: Super Contributor
timestamp: March 02, 2023, 05:28:04 pm
content: Quote from: analityk on March 02, 2023, 04:34:46 pmA lot of specific information has been given. Perhaps you are unfamiliar with the needs of tight control loops, and the information doesn't register with you.

author: MitjaN
author_rank: Contributor
timestamp: March 02, 2023, 07:00:49 pm
content: QuoteTI's DSPs started with TMS32010, which was followed by TMS32020 and TMS320C25. These were more or less general purpose fixed point DSPS. From these TI forked TMS320C240 which was first motor control oriented DSP. This was followed by TMS320LF240x family. Then there was TMS320F27x family, but it was not available to the public and IIRC was used only for motor control within hard drives where special control approaches were introduced to keep the drive spinning with really constant speed regardless of torque ripple caused by the motor itself (repetitive control). This was used as a foundation for C28x architecture which is now rebranded as C2000 family.As for makes the C2000 family stand out:- C240 were one of the first motor control dedicated MCU's. Being first in the field really paved the way for all the following families. And with each new family TI introduced something new in the power conversion field (e.g. high resolution timers, ADC sequencers, flexible ADC triggering from PWMs, dead time generation, PWM topology for SMPSs - phase shifting, CLB, CLA, digital adjustable glitch filters on GPIOs, ...).- As they were/are state of the art, they were/are most commonly used for research. Which means that most of the research papers are based upon TI's power conversion portfolio. Getting published in a lot of papers covering power conversion is a significant PR boost. Here is an example showing C2000 controlling a converter with bunch of transistors at moderately high frequencies .- They were the first to introduce real-time debug functionality. By this I mean, that I can stop and step over the code in the background loop/RTOS task, while ADC, PWM and the motor/SMPS control interrupt routine keep on running. This makes it much easier to debug communication stacks or UI code while power stage is active and under control. All of the peripherals have flexible control how they should behave on debug stop events (keep on running, finish current operation, suspend immediately)- The family has register–memory architecture. This gives it speed, but only when code and data are accessed from zero wait state RAM directly without any caching. So usually most of the control code if copied from FLASH to RAM on boot. As such this will limit how fast the core can go in the future. On the other hand ARM is load-store architecture which makes it easy to run the core faster than RAM with cache inserted between. Without cache load-store architecture is not as fast as register-memory at same execution frequency.The family really makes sense to use only and only in power conversion applications. For anything else they can be PITA to use. Especially connectivity. The native minimum 16 bit wide load/store operations make it difficult to write communication stacks as for most communication stacks 8 bit bytes are the fundamental unit (ethernet, USB, modbus, ...). Even TI acknowledges this with triple core offerings (two C2000 cores and one M4 core for connectivity with ETH, USB, ...). Design of a 350 kW DC/DC Converter in 1200-V SiC Module Technology for Automotive Component Testinghttps://www.mdpi.com/1996-1073/16/5/2341

author: peter-h
author_rank: Super Contributor
timestamp: March 04, 2023, 07:16:23 pm
content: QuoteThat would be a handy feature on STM 32F4

author: analityk
author_rank: Regular Contributor
timestamp: March 05, 2023, 05:25:34 pm
content: I have do not observe any of this aspects of PSoC that you wrote. PSoC Creator is complete IDE and it is free, documentation is full for all features and evaluating boards commonly have debugging port, like is meet in Nucleo for example. Entry threshold is lower than in other families of uC.Anyway when we are talking about response time etc the DSP work in LTI system so if algorithm need perform FFT for example some data pack shall be collected before calculations. There is some algorithms that introduces small time delay like FIR filters but it is algorithms dependent not architecture of MCU. Where is this old TMS320 better than newest Cortex M4 with tones of MHz more?

author: coppice
author_rank: Super Contributor
timestamp: March 05, 2023, 11:01:10 pm
content: Quote from: analityk on March 05, 2023, 05:25:34 pmYou still aren't reading the thread. Stop thinking about speed and start thinking about latency. This TMS320 (i.e. the C2000 family) is not old. It basic designs dates from the same period as the ARM M3 and M4.

author: MitjaN
author_rank: Contributor
timestamp: March 08, 2023, 01:14:17 pm
content: Quote from: analityk on March 05, 2023, 05:25:34 pmThe power conversion applications targeted by C2000 are all about control. And to keep your control loop stable you cannot have any big delays in it. So any kind of FFT or FIR filtering is not really an option. thus the control approaches are quite simple. PI or PID with a bit of feedforward compensation are usually enough. Thus the algorithms are not computationally demanding. But:1. you might want to get rid of the usual delay introduced by sample based processing. As most common approaches are: sample, use the sample to calculate actuator response, send this to PWM. So the process has inherent one sample time delay as the update of PWM is latched for the duration. If the sampling and processing is fast enough (1us or faster) then you can apply the actuator response immediately (with some limits on maximum PWM duty cycles but that might already be in place due to gate driver circuitry (bootstraping, ...)). This has a significant impact to control loop bandwidth.2. The MCU in question might control more then one loop (grid side converter, DAB converter for DC voltage translation and and output converter. So while one control loop execution might not be a drain on resources per se, running multiple loops at high frequencies (50kHz+) tend to require non-negligible amount of resources.3. Multi-leg converters. Here you tend to run four or more control loops. While you can run them all from one ISR, you loose a bit of bandwidth. So running 4 ISR, each at 50kHz+ this results at 200kHz+ effective ISR rate.Quote from: coppice on March 05, 2023, 11:01:10 pmThe C2000 might have a bit faster response to pending ISR request than M4. It might even be a bit faster overall at same MHz, but I don't think that this is a dealbraker.What you get with C2000 is a complete ecosystem build with power conversion in mind. CPU core, CPU accelerators/processors, peripherals, peripherals interconnection, compiler, development tools. All these thing together push the scales in C2000 favor for power conversion applications.Just to name a few of this advantages:- you have a compiler option to generate a code without "repeat" instruction. In this code, the code density would drop as compiler would just substitute it with repeated instruction. But because "repeat" instruction blocks interrupts, this can have a significant impact on ISR latency. Even worse the effect is sporadic which makes hunting down the latency real PITA.- Already mentioned real time emulation support.- ADC has an option to request a ISR even before the conversion is complete. You can trim this so that you enter an ISR, complete the context save just for the result to be available.- ADC can be triggered from PWM. Nothing new. But EPWM has four compare registers. You can use two register for PWM signal ggeneration and the other two to precisely position acquisition timing with respect to PWM to compensate for delays (delay of gate drivers, signal isolation, power transistors, current transtucer, ...)- PWM modules support high resolution (150ps) operation. Not just for duty cycle, but for period, phase delay between different PWM channels and for dead time. And you also have high resolution capture- PWM modules can further modulate PWM signal with high frequency (1MHz+). Making it easier to directly use signal transformers for gate driver signal isolation.- Analog comparators are connected quite flexible. They can be used for PWM signal generation and/or ADC triggering or just for the trip events. Besides independent DAC used internally for setting comparator levels, they include slope compensation- CLA core. This core can execute simple controllers independently of the main core. This makes the control code much more robust. If you'd execute high frequency control ISR on main core then any critical sections which block ISRs will increase the control ISR latency. Some times quite significantly. Moving the control ISR code to CLA you get rid of these issues.- CLB block. This is a small CPLD/FPGA, which enables some weird combinations. You can use it to implement different communication protocols (EnDat, Biss, ...) or you can use it to generate exotic PWM signals.- Obviously in power conversion you can have EMC/EMI issues. Having flexible digital filtering on digital input signals (whether for GPIOs or for peripherals) make your life a bit easier.While the disadvantages are:- already mentions native minimum 16 bit wide load/store operations and associated communication stack code complications- only one supported compiler (TI) with weak C/C++ standard support- both together make result in low amount of third party code available. for example FreeRTOS just became available in last year. IT took a while to get FatFs, and even when we got it there was a silly bug due to 16bit data type. And TI was not aware which version worked and which didn't.- core is not really optimized for power. So any low power applications make no sense. But then again, MCU consumption is much smaller than the losses in the power stage it controls.

author: Siwastaja
author_rank: Super Contributor
timestamp: March 08, 2023, 02:48:26 pm
content: That list of features is convincing, but do note that most of those features have been long available in, for example, STM32 devices. I have extensively used these features, such as triggering an interrupt before conversion is finished, nullifying ISR latency, interconnecting peripherals, pulse-by-pulse current limiting from analog comparator, etc. etc. They were originally features for "designed for power conversion" special microcontrollers, but other competitors copied the ideas in their general purpose product ranges because it does not take much silicon to implement them.

author: coppice
author_rank: Super Contributor
timestamp: March 08, 2023, 03:01:56 pm
content: Quote from: MitjaN on March 08, 2023, 01:14:17 pmThat IS what keeps the latency low. The core has some features to keep latency low, but its that whole peripheral environment that keeps the overall loop latency low, and your phase margin high. The core matters, but not to a massive extent. Take an M4 core, turn off the caches to get some level of determinacy, and it doesn't do too badly for control loops. On most control loops a C2000 core still does better, but its not a game changer. If you have one of the C2000s with the CLA (control loop accelerator) modules the core is largely irrelevant, but those CLAs blow away what you can achieve with something like an ARM, RISC/V or even C2000 core.

author: coppice
author_rank: Super Contributor
timestamp: March 08, 2023, 03:08:58 pm
content: Quote from: MitjaN on March 08, 2023, 01:14:17 pmThere are some quirky things there. Take a digital PSU application. If the controller in a 3kW supply takes 3W, that's only a 0.1% impact on efficiency at full load. The predictability of a digital controller means you should be able to make it a lot more than 0.1% more efficient than an analogue controller, so you have a win. However, if the application is to sit waiting for long periods for some event that needs lots of power for short periods, you have that 3W being dissipated day and night, and it can really affect the efficiency.

author: coppice
author_rank: Super Contributor
timestamp: March 08, 2023, 03:14:00 pm
content: Quote from: Siwastaja on March 08, 2023, 02:48:26 pmThe C2000 is 20 years old, and parts from about 2010 were pretty much feature complete for things like digital power supplies. Its not surprising that the things it does well have been copied, because the control market is one of the nicer growth markets to target. I don't think there is anything as feature complete as a C2000 right now, but of course it will all be commoditised in the end.

author: JPortici
author_rank: Super Contributor
timestamp: March 08, 2023, 03:39:19 pm
content: Quote from: coppice on March 08, 2023, 03:14:00 pmdsPIC? the CK/CH families.. a ton of analog peripherals, independent ADC with flexible triggering/DAC with slope generation/Comparators/High speed PWM with picosecond accuracy.. one of the targetet applications is digital power. Lacks a control loop accelerator but it CAN load/store single bytesinterrupt latency IIRC is lower than M4/M7, they have multiple full register sets (that include the LOOP and DSP registers) that can be changed in a single cycle (or automatically on interrupt entry/exit) so each control loop can run on its own context

author: coppice
author_rank: Super Contributor
timestamp: March 08, 2023, 03:53:51 pm
content: Quote from: JPortici on March 08, 2023, 03:39:19 pmThere's also the 56800 family. I've no idea why people keep raising the single byte issue. It affects very few of the types of applications these control oriented devices go into. So, much so that it wasn't seen as very relevant to the core's original instruction set. They looked at what was important in a general purpose DSP core, and refined what was weak about those DSP cores for tight control loops. I had some involvement with development of the precursor to the 56800 family. That was specifically designed to be a hybrid "do DSP well, without doing general purpose MCU work badly" core. I have no idea how well that worked out in real world applications, but it sounded good to us at the time. Intel and ADI went down a similar path with the Blackfin, but not for control applications. The dsPIC core was a messy unfocussed development, that took years to reach the market, with a a messy unfocussed design. The C2000 was very much pure DSP people making a core that focussed on latency over throughput.

author: JPortici
author_rank: Super Contributor
timestamp: March 08, 2023, 04:56:50 pm
content: Quote from: coppice on March 08, 2023, 03:53:51 pmpeople tend to choose weird things to fixate onQuoteTrue, the first parts were "what the hell were they thinking?" but i find them to be very nice to use now.- the instruction set seems well designed, the addressing modes are very powerful- the assembly is easy to understand and write and integrate into C code- the compiler isverygood- the core performs well (the "C" core gave performance another boost with some new instructions and most important the 6 cicle division)- the periperhal set is rich and the analog part is robustThe only two things i don't like are the lack of USB/Ethernet in current parts and the limits that come from the 16bit address space (the PSV window and EDS). I'll also add the fact that configuration words are not placed at a fixed address but are put right after the flash* which makes porting to a different variant a pain, you need to recompile the firmware.*The reason is that configuration is actually stored in flash, loaded in ram at boot. Okay i get it, but they could have aliased the read/write at a fixed address and solve the problem in the flash controller, or put the configuration in a different page altogether (as it happens with OTHER special memory areas)

author: r0d3z1
author_rank: Regular Contributor
timestamp: July 18, 2025, 02:17:19 pm
content: Quote from: uer166 on November 19, 2022, 11:10:13 pmExactly, you’ll never get rid of a C2000 until the last fanatic leaves the company. It’s all about habit and belief. They are very attached to the traps of the TI compiler. Would you compare GCC with TI compiler ?

author: peter-h
author_rank: Super Contributor
timestamp: July 19, 2025, 01:01:01 pm
content: It's funny... I've seen this too 20 years ago the 320 was all the rage in the avionics business, and now the firms struggle to maintain the products because the original dev has left.

author: LM2023
author_rank: Newbie
timestamp: July 24, 2025, 04:07:19 pm
content: Quote from: coppice on March 08, 2023, 03:53:51 pmWorked with DSCs based on 56800EX cores ... they do DSP well, but "classic" MCU work still has horrible performance issues and software development tools have been left to die (old Eclipse IDE with old Metrowerks toolchain, the last iteration for 56800EF just adds support for external FPU and CORDIC units and uses a library structure closer to GCC).I guess they are used in a lot of motor control applications where already developed DSP software is reused or ported with minimal modifications.

author: peter-h
author_rank: Super Contributor
timestamp: July 25, 2025, 12:53:50 pm
content: QuoteIs that really true?Modern chips are fast. I've just been doing some sin/cos trighttps://www.eevblog.com/forum/microcontrollers/anyone-here-using-the-ramtex-graphics-library/msg5988001/#msg5988001and adoublefloat sin or cos takes 18us!This chip (32F417, 168MHz) has hardware single floats. A single float, sinf(), takes under 2us.So the call for CORDIC and other classic high speed algorithms is less and less, plus there are much faster trig funcs than the full sin() etc.In 1991 I worked on a project which had the 56000 DSP, 20MHz or so, and the 168MHz 32F417 would have outperformed it by a big margin.There are now 480MHz versions of these $5-8 CPUs.

author: LM2023
author_rank: Newbie
timestamp: July 28, 2025, 09:18:02 am
content: Quote from: peter-h on July 25, 2025, 12:53:50 pmSorry for the misunderstanding, I was talking about using a DSC with 56800EX core for "classic" MCU work, not about using an MCU in place of it.The (formerly Freescale) NXP MC56F8xxxx family has 8 stage pipelined cores optimized for DSP applications but with an instruction set in theory designed to also do MCU stuff.The core started as a Harward-style DSP (code and data in separate address spaces) optimized for working with 16-bit fractional data and then extended to 32-bit fractional data (56800EF and then the mush better 56800EX) with the latest generation adding CORDIC and 32bit FPU units (56800EF).But the "classic" flow-control MCU instructions have up to 8 clock cycles latency and the register set is asymmetric and oriented to fractional data processing.So you have 1-cycle integer and fractional 32x32 -> 64 multiply, while on the other hand a RTS (return) istruction takes 8 cycles and the fastest conditional jump taken is 5 cycles.There are delayed instruction slot variants like RTSD taking 5 cycles (if you manage to find 3 delayed instructions you can fit from a restricted subset) but either you use carefully hand-optimized code or you have to rely on the compiler set at maximum optimization settings.And then there are specific sequences of instructions that must be avoided or else "bad things happens" (documentation is not clear, some causes just pipeline stalls other are just forbidden).So in the end, when you have code mostly performing PID/filter loops that fit into the two-level hardware loop engine, everything flies at 1 cycle per instructions.But when you also have to do stuff like sending lots of data over UARTs/SPI/I2C, the packet parsing/composing code becomes the real performance bottleneck, unless you inline code a lot (avoiding the minimun 13 cycles call/return cost) and optimize for 16bit data processing whenever possible.As I previously wrote, it's likely that MC56F8xxxx DSC line keeps going because there is a lot of legacy hardware that's easier to replace with newer one using a newer DSC instead of porting to ARM Cortex-M or RISC-V, but I wouldn't reccomend it for new designs.