Author Topic: Completely predictable instruction timing  (Read 12025 times)

0 Members and 1 Guest are viewing this topic.

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Completely predictable instruction timing
« Reply #50 on: May 07, 2025, 08:27:12 am »
The impression I get is that nowadays, applications that need truly cycle-by-cycle deterministic behavior just use an FPGA.

I prefer to characterise the problem based on input->output jitter and minimum latency, computational complexity, amount of (parallel) computation, and ease of development plus modification. Sometimes conventional software is clearly sufficient, sometimes FPGAs are obviously necessary.

The grey area between the the two is interesting, as is blending the two in a particular implementation. Hence I like xCORE and Zync, for different reasons :)
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: tooki

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Completely predictable instruction timing
« Reply #51 on: May 07, 2025, 08:39:11 am »
On another note, many moons ago I dabbled with Ubicom/Scenix/Parallax’s SX28 microcontroller, which relied on a software peripheral approach.

Getting software UART, I2C, and PWM modules to work happily with each other, would almost be impossible without cycle determinism.

In general parallel hardware up to and including multicore MCUs is easy to implement and has been done many times over the decades. Software is a different issue, and is where things become unpleasant.

A key point about the xCORE+xC+toolchain is that they are all designed together. Hence they work together seamlessly[1] and the whole is more than the sum of the parts. That makes writing deterministic hard realtime highly parallel software applications much more tractable - and even fun.

[1] Example: a task's input/output is a message from/to either another task or a peripheral. I.E. there is, correctly, no fundamental distinction between implementing functionality in hardware or software. Uniquely, that is carried through hardware, the language, and the toolchain.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 30417
  • Country: nl
    • NCT Developments
Re: Completely predictable instruction timing
« Reply #52 on: May 07, 2025, 10:35:18 am »
The impression I get is that nowadays, applications that need truly cycle-by-cycle deterministic behavior just use an FPGA.
That is not necessary for as long as your application doesn't need functions beyond the abilities of a standard microcontroller. DSP applications have been done for decades and these need precise timing for ADC/DAC interfaces to maintain the exact samplerate. UART and SPI buffering are also very common features. More recently it is also possible to use DMA to move data and timers to trigger events (like DAC updates or ADC sample points) and some PWM modules have extensively programmable state machine able to do cycle-by-cycle current limiting. All these features relax the requirements towards the software. It is much easier for software to implement a requirement 'this needs to be done before time expires...' compared to 'this needs to be done at this exact point in time'.
« Last Edit: May 07, 2025, 11:08:13 am by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: tooki

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11457
  • Country: fi
Re: Completely predictable instruction timing
« Reply #53 on: May 07, 2025, 11:17:07 am »
The impression I get is that nowadays, applications that need truly cycle-by-cycle deterministic behavior just use an FPGA.

Yeah, or, tggzzz's beloved XMOS stuff, which, fair enough, is a pretty neat concept and product line, sure.

Some of us just give more value of avoiding locked-in single-vendor concepts, for which nothing even similar appears on any other manufacturer, no matter how good it may be.

Then again, truly needing cycle-level determinism within the whole application is exceedingly rare; I don't remember ever thinking "oh, now this xcore thing would come handy!" And all other MCUs can easily give worst-case processing within 1% or so; or +/- a few instructions, depending on details like flash accelerator / icache / branch prediction miss, synchronization across clock barriers, or maybe DMA competing for the RAM access. It is worth noting that on desktop computing CPUs, things like these have massive impact; going from register to L1 cache might be a few times of performance loss, then to L2 cache some other hundreds of %, then to main DRAM again an order of magnitude, not to mention disk. But on microcontrollers, it's a question of if jump takes 2 or 3 cycles, not that if it takes 2 or 200 cycles. And if your critical control piece which has 1000 cycles worth of instructions has ten branches, then the question is whether it takes 1000 or maybe 1010 cycles. And if data cache is available, it has the same latency as internal RAM anyway, so people don't use it. (It has different purpose, see below.)

You have to seriously try to program microcontrollers such that they usually work but sometimes fail because of icache or branch prediction miss, the instruction timing jitter caused by those mechanisms is just so small.

But sure, tggzzz is completely right that these things exist, just blowing the significance out of proportion (plus adding misleading stuff, like mentioning TLBs which do not exist on microcontrollers, and does this repeatedly like any good troll no matter how many times he is proven wrong; for him, all CPUs are microcontrollers, specifically mentioning Cortex-A application processor series). Or data cache which no one uses in timing-critical microcontroller projects because they are designed for external RAM and no one uses external RAM except for special cases like, let's say, graphics.

But yeah, this exact thread is perfect for tggzzz's argument and I'm happy for him. The question was hypothetical, and XMOS is the answer this time.
« Last Edit: May 07, 2025, 11:26:42 am by Siwastaja »
 
The following users thanked this post: macboy, tooki, uer166, gerbay

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Completely predictable instruction timing
« Reply #54 on: May 07, 2025, 04:13:28 pm »
The impression I get is that nowadays, applications that need truly cycle-by-cycle deterministic behavior just use an FPGA.

Yeah, or, tggzzz's beloved XMOS stuff, which, fair enough, is a pretty neat concept and product line, sure.

Some of us just give more value of avoiding locked-in single-vendor concepts, for which nothing even similar appears on any other manufacturer, no matter how good it may be.

Vendor lockin has to be considered, but it is necessary with many many other components - and accommodated.

Quote

Then again, truly needing cycle-level determinism within the whole application is exceedingly rare; I don't remember ever thinking "oh, now this xcore thing would come handy!" And all other MCUs can easily give worst-case processing within 1% or so; or +/- a few instructions, depending on details like flash accelerator / icache / branch prediction miss, synchronization across clock barriers, or maybe DMA competing for the RAM access. It is worth noting that on desktop computing CPUs, things like these have massive impact; going from register to L1 cache might be a few times of performance loss, then to L2 cache some other hundreds of %, then to main DRAM again an order of magnitude, not to mention disk. But on microcontrollers, it's a question of if jump takes 2 or 3 cycles, not that if it takes 2 or 200 cycles. And if your critical control piece which has 1000 cycles worth of instructions has ten branches, then the question is whether it takes 1000 or maybe 1010 cycles. And if data cache is available, it has the same latency as internal RAM anyway, so people don't use it. (It has different purpose, see below.)

Can you guarantee tight hard realtime timing while also doing computation and USB or ethernet comms? Over-specifying the processor by a factor of, say, 1000 is "inelegant".

Quote
You have to seriously try to program microcontrollers such that they usually work but sometimes fail because of icache or branch prediction miss, the instruction timing jitter caused by those mechanisms is just so small.

In some of my applications, a miss is as good as a mile lawsuit.

Quote
But sure, tggzzz is completely right that these things exist, just blowing the significance out of proportion (plus adding misleading stuff, like mentioning TLBs which do not exist on microcontrollers, and does this repeatedly like any good troll no matter how many times he is proven wrong; for him, all CPUs are microcontrollers, specifically mentioning Cortex-A application processor series). Or data cache which no one uses in timing-critical microcontroller projects because they are designed for external RAM and no one uses external RAM except for special cases like, let's say, graphics.

Um. Would you like to rephrase that, not only to make it more comprehensible and but also to avoid "there's no such thing as a true Scotsman MCU" debates :)

Arm devices can indeed have TLBs, e.g. the A9 processors inside Zync FPGAs.
https://stackoverflow.com/questions/30530300/measurement-of-tlb-effects-on-a-cortex-a9#40875169



Quote
But yeah, this exact thread is perfect for tggzzz's argument and I'm happy for him. The question was hypothetical, and XMOS is the answer this time.

It was a good hypothetical question, because it exposes limitations and choices that need to be made.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline gerbay

  • Regular Contributor
  • *
  • Posts: 91
  • Country: tr
Re: Completely predictable instruction timing
« Reply #55 on: May 07, 2025, 05:36:44 pm »
Comparing the application processor with the microcontroller, it turns out that XMOS is more deterministic.. interesting..
 
The following users thanked this post: Siwastaja

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11457
  • Country: fi
Re: Completely predictable instruction timing
« Reply #56 on: May 07, 2025, 05:58:25 pm »
Can you guarantee tight hard realtime timing while also doing computation and USB or ethernet comms? Over-specifying the processor by a factor of, say, 1000 is "inelegant".

Of course. You would know that if you had tried, any embedded programmer worth their salt can do it no worries. This is why we have peripherals, pre-emptive interrupts and interrupt priorities. There is no need to overspecify anything by factor of 1000. I often tend to run things at 70% CPU utilization or so.

On the other hand, XMOS would be seriously underutilized by design most of the time. (Which I don't think as any kind of issue, though. Silicon is cheap nowadays.)

Event-driven is the key. Even Javascript youngsters understand this. Just like OnClick you have a function being called, similarly OnOvercurrent you trigger a function. Within 50ns for example guaranteed by silicon. Yes, it might be just 30ns instead if the interrupt controller decides to add tail-chain optimization. This is the jitter we are talking about.

Then again, if your definition of "tight hard realtime" (lol, we can keep adding adjectives) means that it's wrong to sometimes finish 100ns "too early", before the deadline, then sure, you need XMOS or FPGA. Another case is special snowflake high-speed interfaces for which there is no peripheral available and which are high-speed enough, or very sensitive to even <10ns of jitter, so that a microcontroller won't cut it. Then you use FPGA, helper CPLD, or - maybe XMOS.

Quote
In some of my applications, a miss is as good as a mile lawsuit.

Yet, XMOS is nearly nonexistent in fields like automotive or medical - instead, they mostly use those "good old" CPUs, and you would be horrified how inelegant the processes can be. The key is in a lot of testing. Yes, in the real world, quality is really tested into the product, which you don't like, and I don't like either.

Quote
Arm devices can indeed have TLBs, e.g. the A9 processors inside Zync FPGAs.

Which, again, is not a microcontroller*, but we know for you it doesn't matter. As long as there exists any kind of CPU which has TLBs, then microcontrollers have TLBs. We know that. For the rest of us, the concepts of reality and truth are defined differently.

*) ARM CPUs are divided by naming convention to microcontroller and application CPU series, -M and -A respectively.

Quote
It was a good hypothetical question, because it exposes limitations and choices that need to be made.

I fully agree, and it's nice to have this discussion once again this time it being completely on-topic!
« Last Edit: May 07, 2025, 06:05:48 pm by Siwastaja »
 

Offline gerbay

  • Regular Contributor
  • *
  • Posts: 91
  • Country: tr
Re: Completely predictable instruction timing
« Reply #57 on: May 07, 2025, 06:22:21 pm »
Quote
ARM CPUs are divided by naming convention to microcontroller and application CPU series, -M and -A respectively.

also ARM has -R series;

-R cores are optimized for hard real-time and safety-critical applications

Quote
Real time and safety critical features added include:

- Tightly coupled memory (uncached memory with guaranteed fast access time)
- Increased exception handling in hardware
- Hardware division instructions
- Memory protection unit (MPU)
- Deterministic interrupt handling as well as fast non-maskable interrupts
- ECC on L1 cache and buses
- Dual-core lockstep for CPU fault tolerance

« Last Edit: May 07, 2025, 06:25:49 pm by gerbay »
 
The following users thanked this post: Siwastaja, tooki

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11457
  • Country: fi
Re: Completely predictable instruction timing
« Reply #58 on: May 07, 2025, 06:39:42 pm »
Quote
ARM CPUs are divided by naming convention to microcontroller and application CPU series, -M and -A respectively.

also ARM has -R series;

-R cores are optimized for hard real-time and safety-critical applications

Yes. They are even further away from the "simple" microcontrollers; more like those application processor with features added on top allowing them to also do tight hardcore very hard realtime, while still doing stuff like run the usual linux kernel. I'm sure tggzzz would hate them with passion, and to be fair they are one step further from the "KISS" principle, sure.

The feature list isn't that special coming from microcontroller side - but if you look at it from the opposite direction, coming from "application" / general purpose desktop computing CPUs then sure it makes the difference of being able to meet realtime needs or not, while still being quite performant.

XMOS feels elegant due to its simplicity, but it seems to not cater to real-world needs of today's software development flow. It's basically just gazillion of parallelized "PICs" bitbanging or polling giving huge MIPS numbers for marketing. You need to design the whole software from scratch to this design paradigm. It's much more than just a simple vendor lock-in. It means complete re-write of everything, as algorithms need to be designed around this concept.
 
The following users thanked this post: gerbay

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Completely predictable instruction timing
« Reply #59 on: May 07, 2025, 07:07:34 pm »
Quote
ARM CPUs are divided by naming convention to microcontroller and application CPU series, -M and -A respectively.

also ARM has -R series;

-R cores are optimized for hard real-time and safety-critical applications

Yes. They are even further away from the "simple" microcontrollers; more like those application processor with features added on top allowing them to also do tight hardcore very hard realtime, while still doing stuff like run the usual linux kernel. I'm sure tggzzz would hate them with passion, and to be fair they are one step further from the "KISS" principle, sure.

Why would I hate them? Horses for courses.

Notice that cars are becoming ever more complex, unreliable and outright dangerous, e.g. lane assist software swerving the car in front of oncoming traffic.
https://www.which.co.uk/news/article/car-tech-features-you-could-live-without-axlAN5K2Q5K7
https://www.which.co.uk/news/article/lane-assist-tech-steers-popular-family-car-towards-oncoming-traffic-during-which-testing-afXHU1t7gttC

Memo to self: find out if insurance is valid if I turn those mis-features off; some newly-added Ts&Cs require very careful reading and understanding.

Quote
XMOS feels elegant due to its simplicity, but it seems to not cater to real-world needs of today's software development flow. It's basically just gazillion of parallelized "PICs" bitbanging or polling giving huge MIPS numbers for marketing. You need to design the whole software from scratch to this design paradigm. It's much more than just a simple vendor lock-in. It means complete re-write of everything, as algorithms need to be designed around this concept.

Not quite; that's definitely an overstatement.

They are nothing like PICs.

Number crunching algorithms remain unchanged, and can be lumps of C code.

But there are some long overdue (IMNSHO!) changes in the way of thinking about applications and structure. That's bound to be hard for some people, but comes naturally to others.

Start by presuming parallelism, and make use of it. That is an unavoidable necessity since nowadays processing power is limited by leakage currents and power dissipation. The only way forward is multicore. Start dealing with that.

Given parallelism, a key issue is efficient communication between parallel processes. It always has been an issue, but has been obscured by the previous stunning increases in processor power. Comms is dealt with by CSP's messages sent over channels. Other languages and processors have seen the light, e.g. Go and TMS320. The inter-process comms are integrated into the xC language and into the hardware, just as they should be.

Once you have efficient comms between processes, you can use them to communicate between cores and peripherals. This conceptual merging of hardware processes and software processes is very powerful; all engineers ought to think in those terms, but most are constrained by their background.

Old truism: "organisations constrained to produce products which mirror the org-charts". Newer truism: "products architecture is constrained to mirror the team members' job titles". I was once asked by an HR droid "now are you really hardware or really software", at which point I decided there was no way I would work for that organisation.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Andy Chee

  • Super Contributor
  • ***
  • Posts: 2177
  • Country: au
Re: Completely predictable instruction timing
« Reply #60 on: May 08, 2025, 01:09:16 am »
On another note, many moons ago I dabbled with Ubicom/Scenix/Parallax’s SX28 microcontroller, which relied on a software peripheral approach.

Getting software UART, I2C, and PWM modules to work happily with each other, would almost be impossible without cycle determinism.

In general parallel hardware up to and including multicore MCUs is easy to implement and has been done many times over the decades. Software is a different issue, and is where things become unpleasant.

Like I said, the SX28 does not have hardware peripherals.  Getting a bit-banged UART, bit-banged I2C, and bit-banged PWM to work together, was like voodoo!
« Last Edit: May 08, 2025, 06:19:58 am by Andy Chee »
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11457
  • Country: fi
Re: Completely predictable instruction timing
« Reply #61 on: May 08, 2025, 06:01:11 am »
Notice that cars are becoming ever more complex, unreliable and outright dangerous, e.g. lane assist software swerving the car in front of oncoming traffic.

Yes. And such lane assists would run e.g. on said Cortex-R CPUs. And I can assure you that their malfunctions have nothing to do with caches, TLBs or timing jitter, and everything to do with the complexity of the algorithms (specifically image processing, always correctly recognizing where the lane is) themselves.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Completely predictable instruction timing
« Reply #62 on: May 08, 2025, 08:31:44 am »
Notice that cars are becoming ever more complex, unreliable and outright dangerous, e.g. lane assist software swerving the car in front of oncoming traffic.

Yes. And such lane assists would run e.g. on said Cortex-R CPUs. And I can assure you that their malfunctions have nothing to do with caches, TLBs or timing jitter, and everything to do with the complexity of the algorithms (specifically image processing, always correctly recognizing where the lane is) themselves.

I didn't actually say that caches/interrupts are the source of those malfunctions.

I presume, without evidence, that there are some forms of limited ML being making the decisions. Either way, cars are becoming more and unpredictably dangerous, and can no longer be held up as paragons of reliable engineering.

No, I'm not looking forward to replacing my 20yo car; I'll have to do a lot of research before I select a replacement.

I'm wondering whether I should wander into a Tesla showroom and ask the currently underemployed salesmen to take me for a ride along back roads using the full self driving "beta" thing, while I watch how the car responds to potholes, poor road margins, and semi-blind chicanes.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline jfiresto

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: de
Re: Completely predictable instruction timing
« Reply #63 on: May 08, 2025, 09:24:33 am »
... On another note, many moons ago I dabbled with Ubicom/Scenix/Parallax’s SX28 microcontroller, which relied on a software peripheral approach.

Getting software UART, I2C, and PWM modules to work happily with each other, would almost be impossible without cycle determinism.
I remember studying that part, for a design, and soon recognizing two likely race conditions in the interrupt handling, one of which they acknowledged. I tend to the notion the issues were addressed through marketing, by promoting its speed and "software peripherals".
-John
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Completely predictable instruction timing
« Reply #64 on: May 08, 2025, 09:36:20 am »
On another note, many moons ago I dabbled with Ubicom/Scenix/Parallax’s SX28 microcontroller, which relied on a software peripheral approach.

Getting software UART, I2C, and PWM modules to work happily with each other, would almost be impossible without cycle determinism.

In general parallel hardware up to and including multicore MCUs is easy to implement and has been done many times over the decades. Software is a different issue, and is where things become unpleasant.

Like I said, the SX28 does not have hardware peripherals.  Getting a bit-banged UART, bit-banged I2C, and bit-banged PWM to work together, was like voodoo!

I have no knowledge of that device, but your observation is completely unsurprising.

When I used the xCORE+xC, everything like that just worked as expected. I was gobsmacked. Time from receiving board to first iteration of my hard realtime application working: <1 day :) The performance was also exactly as defined before the hardware arrived :) I was a very happy camper.

8 cores were used for USB comms including debugging, the rest operated completely independently. Debugging is trivial: apart from the usual single-stepping and breakpoints, printf() sends a message to the "USB cores" and the application task continues.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11457
  • Country: fi
Re: Completely predictable instruction timing
« Reply #65 on: May 09, 2025, 08:23:21 am »
When I used the xCORE+xC, everything like that just worked as expected. I was gobsmacked. Time from receiving board to first iteration of my hard realtime application working: <1 day :) The performance was also exactly as defined before the hardware arrived :) I was a very happy camper.

I believe this. Traditional microcontroller approach with peripherals is weird in the sense that many if not most vendors design terrible peripherals. For example, something trivial like UART or SPI, you should get it running in <2 hours the first time, but with companies like ST it can take a day or two when you discover overly complicated, poorly documented or outright silicon-buggy peripheral hardware.

Then again, when you see well though out peripherals, using them is a breeze. nRF52 is a good example of easy-to-use peripherals the design of which makes sense, with consistent events -> tasks routing, consistent simple DMA (no more messing with polling or interrupting on status flags), and absence of fancy special features no one needs but which cause mental overload and bugs elsewhere.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 30417
  • Country: nl
    • NCT Developments
Re: Completely predictable instruction timing
« Reply #66 on: May 09, 2025, 01:43:27 pm »
It always surprises me why ST microcontrollers are so popular. They are about the worst where it gets to peripherals and documentation. Some customers insist on using the STM32 devices because they think the parts are cheap and they sell millions of units (NOT!) and thus completely lose sight of the higher NRE costs and longer time to market. NXP is so much better in that aspect. Right now I'm working on a project with a big iMX8 SOC from NXP which has a Cortex-M4 microcontroller core next to it. Even though the whole thing is insanely complex at first glance, getting the UART going with the Cortex-M4 core was as easy as on their small ARM microcontrollers. Good documentation and simplicity go a long way.
« Last Edit: May 09, 2025, 01:49:21 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 
The following users thanked this post: tooki

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 23122
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Completely predictable instruction timing
« Reply #67 on: May 09, 2025, 02:11:51 pm »
When I used the xCORE+xC, everything like that just worked as expected. I was gobsmacked. Time from receiving board to first iteration of my hard realtime application working: <1 day :) The performance was also exactly as defined before the hardware arrived :) I was a very happy camper.

I believe this. Traditional microcontroller approach with peripherals is weird in the sense that many if not most vendors design terrible peripherals. For example, something trivial like UART or SPI, you should get it running in <2 hours the first time, but with companies like ST it can take a day or two when you discover overly complicated, poorly documented or outright silicon-buggy peripheral hardware.

Then again, when you see well though out peripherals, using them is a breeze. nRF52 is a good example of easy-to-use peripherals the design of which makes sense, with consistent events -> tasks routing, consistent simple DMA (no more messing with polling or interrupting on status flags), and absence of fancy special features no one needs but which cause mental overload and bugs elsewhere.

Unfortunately the reason is simple: the unnatural conceptual split between hardware and software. That's not only wetware skillsets and attitudes, but also corporate design/manufacturing.

Hardware companies/engineers think software is easy, can be bolted on as an afterthought, and can fix up any hardware bugs and impedance matches. Software companies/engineers don't understand hardware, and treat it as an incomprehensible black box.

It is rare to find people and companies that have a decent theoretical and practical understanding of both.

BTW, the first seriously buggy chip I came across was an interrupt controller c1983. In retrospect there was a big orange flag waving over it: it was version G.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline jfiresto

  • Super Contributor
  • ***
  • Posts: 1054
  • Country: de
Re: Completely predictable instruction timing
« Reply #68 on: May 09, 2025, 04:45:12 pm »
BTW, the first seriously buggy chip I came across was an interrupt controller c1983. In retrospect there was a big orange flag waving over it: it was version G.
The developers of the first seriously buggy chip I had to deal with, boasted they had designed it on a bunch of white boards. I did not learn about that until years later when they donated the white boards and an heroic tale to a national history museum – as an important advance in chip making! Fortunately, so many people suffered that part's design that a quietly competent competitor came out with an improved alternative that dropped right in.
« Last Edit: May 09, 2025, 05:37:29 pm by jfiresto »
-John
 
The following users thanked this post: tooki

Online Siwastaja

  • Super Contributor
  • ***
  • Posts: 11457
  • Country: fi
Re: Completely predictable instruction timing
« Reply #69 on: May 09, 2025, 05:47:24 pm »
It always surprises me why ST microcontrollers are so popular.

Popularity itself drives popularity. I have used, and will keep using ST microcontrollers. When I first started using them, I did not do good analysis if something else would be easier or better. I got some because they were popular; I had heard the name; a lot of interesting-looking parts were available at distributors and they did not cost much. And once you are accustomed to the poor documentation and their "style" of design, you can manage it. Then getting more of the same crap is a decent choice, because it's not too crappy to seriously drive people to reconsider. There almost always is a workaround for everything; they are capable parts; the issue really is that you sometimes waste a day or two extra on stupid things which should not exist, but it's still lost in the noise (projects usually have timescales in years).

Good cost, large portfolio of parts and good availability are real factors, too.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 17841
  • Country: fr
Re: Completely predictable instruction timing
« Reply #70 on: May 09, 2025, 06:08:44 pm »
And a very wide offer in ultra-low-power MCUs too.

 

Online uer166

  • Super Contributor
  • ***
  • Posts: 1283
  • Country: us
Re: Completely predictable instruction timing
« Reply #71 on: May 09, 2025, 06:57:59 pm »
It always surprises me why ST microcontrollers are so popular. They are about the worst where it gets to peripherals and documentation. Some customers insist on using the STM32 devices because they think the parts are cheap and they sell millions of units (NOT!) and thus completely lose sight of the higher NRE costs and longer time to market. NXP is so much better in that aspect. Right now I'm working on a project with a big iMX8 SOC from NXP which has a Cortex-M4 microcontroller core next to it. Even though the whole thing is insanely complex at first glance, getting the UART going with the Cortex-M4 core was as easy as on their small ARM microcontrollers. Good documentation and simplicity go a long way.

ST parts tend to be more complicated but also more flexible/capable than a lot of competition. They also have something for almost any use case, from the tiniest sub-$1 parts, to mixed signal DSP MCUs, to full-on MPUs running Linux. NXP have large holes in their portfolio, so if you're designing a large system with a bunch of needs and want to stay within one vendor/dev environment, ST is a safe choice.

Where else can I get like 7 UARTs, a bunch of ADCs/DACs, flexible/variable clocking, and enough RAM/Flash to do graphics all at once?
 

Online uer166

  • Super Contributor
  • ***
  • Posts: 1283
  • Country: us
Re: Completely predictable instruction timing
« Reply #72 on: May 09, 2025, 06:59:02 pm »
And a very wide offer in ultra-low-power MCUs too.

There's lower power options that aren't ST, but I don't think there's anything that approaches the amount of functionality you get with something like a STM32U5 at the given power consumption.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: us
  • DavidH
Re: Completely predictable instruction timing
« Reply #73 on: May 09, 2025, 08:23:25 pm »
Older ARM microcontrollers, generally operating at 50 MHz and slower, can have predictable instruction timing.  Without caches, the clock speed is limited by the cycle time of the integrated Flash ROM and static RAM.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->