The problem with uC driving digital SMPS is that they need an ultrafast mechanism (faster than interrupts) to respond to spikes, shortcircuits etc.
You do need a hardware statemachine for that OR handle the error situations in additional hardware (extra cost).
You can try learn 7 architectures at the same time. For example 8051 + AVR8 + PIC8 + PIC16 + PIC32 + ARM Cortex-M + ARM7TDMI. Very quickly you are going to find patterns, getting very good at writing architecture-independent portable C code, appreciate stdint.h and start accumulate your own middleware.With the architectures you have listed that is impossible. The 8051 and PIC8 don't work efficient with pointers so you need to adopt an entirely different (poorly maintainable) coding style to get some performance.
Hi guys!
This year in two courses of my University Degree we started using microcontrollers and the professor chose the PIC24FV16KM202: http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=DM240013-2.
I think that they are quite easy to program with MPLAB X and it has loads of peripherals that are very user friendly. Of couse it also has its flaws. I've not mess with I2C or SPI yet.
Do you think that it is worth to switch to an ARM Cortex-M (STM, NXP, TI)? For what I've seen thet seem more confusing to program, but maybe that comes with my habit to the PIC24F.
I mostly do motor control and sensor interface with them.
There's no doubt that ARM and Cortex M/A is the present, and the near future ... but I think it's worth keeping an eye on RISC-V as it's getting quite a bit of support from big names as it moves out of academia into industry.
- free and open license-free instruction set, similar in spirit to an improved MIPS. Inherently supports 32, 64, or 128 bit implementations. All standard instructions are 32 bits long, with optional standard Thumb2-like extension with 16 bit instructions duplicating the most common 32 bit instructions (gives ~30% code size reduction). Instruction set is designed for customization with plenty of room for vendors to add 16 bit, 32 bit, or longer instructions.
- supported by gcc, binutils, glibc, newlib, linux kernel, qemu
- Berkeley university has released three free and open core designs, roughly at Cortex M0+ (Z-scale), Cortex A5/A53 (Rocket), and Cortex A15/A72 (BOOM) complexity/performance levels. In fact they are all implemented as core generators, rather than fixed cores, with many aspects configurable (and they all share much of the same definition code).
- anyone can use Berkeley's cores or core generators, customized or not, or design their own from-scratch cores. This is in contrast to ARM, where Apple, Samsung, Qualcomm and a handfull of others have paid big big bucks to ARM to be allowed to design their own cores, but everyone else has to use off-the-shelf cores that ARM designed.
- roughly 40 companies are known to be working on CPUs and SoCs using RISC-V.
- SiFive, a startup founded by Berkeley people who designed RISC-V, have a 32-bit no MMU no FP microcontroller SoC that runs anywhere between 16 and 320 MHz in production. At the moment you can only buy it on their "HiFive1" Arduino-compatable development board. Later this year they expect to have a linux-capable quad core 1.6 GHz SoC and dev board. Their main business plan is to design and fab custom SoCs. They say they can add your peripherals, special function units, custom instructions, and get you the first wafer of sample chips for typically under US$100k.
There's no doubt that ARM does a very good job, their standard cores are good and the license fees are not huge. Thee are, as you say, thousands of MCUs available using them. It's a different matter if you want to customize the CPU core or build your own. And their 64 bit offering is incompatible with 32 bit and has much bigger code size (no Thumb equivalent).
But worth keeping an eye on RISC-V.
Do you think that it is worth to switch to an ARM Cortex-M (STM, NXP, TI)?
The 8051 and PIC8 don't work efficient with pointers
The 8051 and PIC8 are fine if all you're doing is replacing something that you *could* do with a bunch of gates, latches, shift registers etc -- hardware.
They are not at all good if you want to write *software*, especially using modern practices. Or even C.
Quote from: technixThe 8051 and PIC8 don't work efficient with pointersPointers are an abomination that should not exist in a high level language.
I thought I'd refresh my memory about the OP:But recently I got interested in an ARM STM32 for design I am working on, and decided it was worth picking up a cheap dev board and dipping a toe in. The spur was really some advanced features they have for PWM control (which I learnt of here) and the fact that someone I know and respect uses them a lot on his products.
It's not clear if the project can even be accomplished on an 8-bit microcontroller since the OP's looking at the STM32 line.
It probably *could* but getting a bit towards the stress point. I made a proto buck regulator with a combination of stripboard and and old PIC dev USB board which has an 8 bit PIC on it. Worked fine, there is a PWM output with deadband control that I could use to create a synchronous rectifier. I didn't get as far as monitoring op voltage/current and doing the feedback side, but i think it should have been OK. The issue thoigh was resolution - the PWM o/p was a bit lacking in bits.
...
There are also "special purpose" MCUs like some of the C2000 or DSPIC series that are specifically intended for motor control, digital switching power control, and safety certified applications that presumably have some architectural and firmware / library / toolchain features intended to ease concern about such uses that could cause system hardware failure / other problem due to a firmware bug or lack of control.
Basically similar story as the FPGA's.