But now compare the NRE (development costs), extra supply voltages, external rom for the configuration and programming solution. It is not the price of the chip which counts but the cost of the solution (development costs + hardware). Many seem to completely overlook that.All true. But we have no way to evaluate these components, as they depends on so many factors which we don't know. For example, if this is a hobby project NRE is zero.
I agree but that is not a reason to just dismiss NRE costs and only look at the costs of a single part.
When I search for STM32 programing it all seems very confusing due to all the aproaches you have (Standard Peripheral Library, CubeMX, etc).
When I search for STM32 programing it all seems very confusing due to all the aproaches you have (Standard Peripheral Library, CubeMX, etc).
It's confusing, but luckily, there's an answer: you can just do all of it normally, like you did with AVR or PIC processor: by reading the reference manual and configuring the registers as you wish. The peripherals are a bit more complex (due to being more capable), but it doesn't make it too hard to learn. STM32 libraries make everything difficult since they don't abstract the implementation details out as they should, but only add an extra layer of burden and uncertainty.
Doing it without the library structs and functions produces much more readable code, quicker development, higher level of understanding and more robust implementations, compared to library code copypasting from Stackoverflow; this has nothing to do with the concept of using libraries in general, but everything to do with the STM32 libraries, which, unfortunately, are totally unusable and completely doomed. This is a trap for young players, who will find a lot of confusing examples on the web, while it's difficult to find simple examples that don't use the libraries.
If you require a good peripheral abstraction layer and usable libraries that allow you to work on the higher level, and you don't want to write this layer from scratch, then STM32 is definitely out of question. AFAIK, most others have it at least somewhat better, although it's seldom brilliant. For me, having good libraries and abstaction layers was not too important, since they tend to suck anyway, and I like to work on low level, so I work with STM32 chips quite a lot, and have a love-hate relationship with them. They do have documentation issues and undocumented silicon bugs (even though the errata sheets are quite long), and they ignore reports of non-documented silicon bugs, instead of being responsible and updating the errata sheet. But I guess most other complex 32-bit MCUs have similar issues as well.
Generally, the modern 32-bit MCUs have peripherals that are a lot more capable than something on an 8-bit AVR, so that even when you have more processing power available, you end up using less of it; more of your code ends up initializing the peripherals that can do surprising amount of the work so that you don't need to do timing-critical things in software as much.
STM32 libraries make everything difficult since they don't abstract the implementation details out as they should, but only add an extra layer of burden and uncertainty.
Doing it without the library structs and functions produces much more readable code, quicker development, higher level of understanding and more robust implementations, compared to library code copypasting from Stackoverflow; this has nothing to do with the concept of using libraries in general, but everything to do with the STM32 libraries, which, unfortunately, are totally unusable and completely doomed. This is a trap for young players, who will find a lot of confusing examples on the web, while it's difficult to find simple examples that don't use the libraries.
One little thing off the side: which one of these 32-bit MCUs offer protection from stealing firmware? I bet commercial product designers take this so serious, aren't they?
If you are going to design a commercial product, will you use code protection features?
I am saying this because I could get the AVR code of a washing machine board then burn it on another new chip then solder it instead of a faulty one... this makes repairing a whole board price without even doing a thing xD. Not everyone knows how to do it, despite being simple. I am going to try the same with Freescale and Renesas products. Renesas ones use protection but somehow people are confident that a USB-to-serial flash programming will get the code out of it... it is just a trial to see if the chip is protected or not.
What about Renesas?
Surely they don't support beginner-friendly boards and their prices is to the roof... but their quality is nice. I do hope I get to use them one day when I have the chance.
Renesas: difficult to get and expensive for low quantities.
Goto Farnell type Renesas goto microcontrollers, 44 found only 13 available rest no longer available, look at price for 32 bit only 50MHz.
But now compare the NRE (development costs), extra supply voltages, external rom for the configuration and programming solution. It is not the price of the chip which counts but the cost of the solution (development costs + hardware). Many seem to completely overlook that.
All true. But we have no way to evaluate these components, as they depends on so many factors which we don't know. For example, if this is a hobby project NRE is zero.
But now compare the NRE (development costs), extra supply voltages, external rom for the configuration and programming solution. It is not the price of the chip which counts but the cost of the solution (development costs + hardware). Many seem to completely overlook that.
All true. But we have no way to evaluate these components, as they depends on so many factors which we don't know. For example, if this is a hobby project NRE is zero.I completely disagree. For hobby projects or any other one-off, the NRE is the dominant cost. The cost of the parts is a pitance compared to the time to develop. You don't ammortize the NRE over thousands or millions of units, it is all for one unit. The cost of a single PSoC5 is equal to less than half an hour of time. So even if it is way overkill and 80% of its resources go unused, if it makes the solution easy and quick then it's a good choice. If I was building a million of them, then I'd spend a lot of time to choose something that fits the application well without added cost for unused features. My hobby time is neither free nor plentiful.
Just a few of the good things in a PSOC.
Just a few of the good things in a PSOC.
To me, the biggest drawback of the PSoC is that no currently available part has hardware floating point. The PSoC 5 is based on Cortex-M3 (which doesn't have an FPU) rather than a Cortex-M4 (which does).
Renesas: difficult to get and expensive for low quantities.
Goto Farnell type Renesas goto microcontrollers, 44 found only 13 available rest no longer available, look at price for 32 bit only 50MHz.Well, I can't speak for the situation outside the US, but:Maybe it is expensive and hard to get in some parts of the world, but not here.
- Digikey: 841 parts active and available
- Mouser: 172 parts in stock
- Arrow: 470 parts in stock
- 50MHz RX200: $6.38 to $3.31 depending on quantity
- 40MHz RX200: $3.72 to $1.70 depending on quantity
Maybe this has to do with lack of good low cost (free) tools. Back in the old days the distributors would hand out 'demo' versions of the compilers to keep sales going.
Well Farnell usually is a good indicator of popularity and future availability. Until about 15 years ago Hitachi (now Renesas) microcontrollers where quite popular but nowadays they seem to have vanished.
They are supposed to be used in ultra cheap devices as MPU. If you factor in R&D cost (due to poor documentation and barely hacked up Linux kernel) and logistics cost (to send someone to China just to purchase and do local QA) as well as patent cost (to be legally imported to western world), they are not that cheaper compared with NXP/FS MPUs.
For example in the other thread over there was a lot of discussion about WCH and Allwinner chips. I know these move in high volume (Allwinner especially), but again they are not available at any distributors I buy from. Does that mean they are unpopular? Or does it just mean that you'd have to be in China to be exposed to that ecosystem?
They are supposed to be used in ultra cheap devices as MPU. If you factor in R&D cost (due to poor documentation and barely hacked up Linux kernel) and logistics cost (to send someone to China just to purchase and do local QA) as well as patent cost (to be legally imported to western world), they are not that cheaper compared with NXP/FS MPUs.
One Chinese chip made the exception, ESP32, but so far that's the only one I know, with good BSP (though not Linux), English document and no legal issues (no known patent infringements, no known copyright issues, and they officially offers FCC certified modules).
At least for Allwinner MPU the only folks that is actually interested in the documentation is the folks in linux-sunxi community trying to write and mainline the drivers.
That's the problem. An IC company doesn't provide true GPLed kernel at all is quite questionable. A third party repo is appreciated, but don't you think it's supposed to be the job of the official who monetizes on their chips?
That is the problem but so does nVidia or Imagination (PowerVR) do this too. Allwinner do drop code but blobs are common.
And if I run a chip company, I don't want a global software leader to say F me.
I'm fine with binary blobs for FW, but for code running on the same CPU in the same memory space of kernel, I prefer not to have blobs.
For an individual the smart move is to go with the mainstream companies that offer documentation, support and where forum members can help with experience.