How to select micro controller architecture

Go To Last Post
57 posts / 0 new

Pages

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:

Somewhere in the RISC-V blurb they explain their decision regarding the flags.

From the Wikipedia page:

RISC-V has no condition code register or carry bit. The designers believed that condition codes make fast CPUs more complex by forcing interactions between instructions in different stages of execution. This choice makes multiple-precision arithmetic more complex. Also, a few numerical tasks need more energy. As a result, predication (the conditional execution of instructions) is not supported. The designers claim that very fast, out-of-order CPU designs do predication anyway, by doing the comparison branch and conditional code in parallel, then discarding the unused path's effects. They also claim that even in simpler CPUs, predication is less valuable than branch prediction, which can prevent most stalls associated with conditional branches. Code without predication is larger, with more branches, but they also claim that a compressed instruction set (such as RISC-V's set C) solves that problem in most cases.[1]

Instead, RISC-V has short branches that perform comparisons: equal, not-equal, less-than, unsigned less-than, greater-than or equal and unsigned greater-than or equal. Ten comparison-branch operations are implemented with only six instructions, by reversing the order of operands in the assembler. For example, branch if greater than can be done by less-than with a reversed order of operands.[1]

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank God it's only the C++ compiler authors who actually need to worry about any of this ! :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah. But I looked at some RISC-V assembly snippets, it's not that bad. Another uncommon feature is an hardcoded zero register, that, well, always reads zero.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A number of the early RISC chips had pipeline traps where it was expected the compiler would manage this. A pipeline trap is where certain sequence of instructions can cause unwanted results. ie an instruction that might rely on the result of a previous instruction and due the the pipeline where you might have a read register, alu operation, write register sequence, the following instruction would read the register before the previous operation had written it. The compilers would recognise these dangerous sequences and either re-order, avoid or shove in a nop to avoid it.

 

Even in modern chips, either the compiler, c run time or the libraries may have 'fixes' for hardware issues.

 

Time will tell if the carry flag will be missed in RISC-V.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Select your micro controller architecture according to the lowest over-all cost of the MCU to the project or product.  The cost is a balance between the non-recurring engineering and programming costs and the per-unit hardware costs.

 

If you are making 1-10 of an individual design, which is rare outside of hobbyist circles, I suggest going fully Arduino UNO/Nano.  Buy pre-manufactured bootloader-preinstalled clone MCU module boards that have been manufactured cheaply and reliably.  The software development system is free, well-maintained, well-documented, and well supported. Libraries for most hardware devices are freely downloadable.   Between 10 and 100 units, determine the best device in an MCU family, and buy the individual ICs from a distributor.  Acquire, learn, and use the manufacturer's development system for the device family.  Design a custom PCB for the product.

 

For each order-of-magnitude of product volume, i.e.  100 units, 1000 units, 10,000+ units of the same design, go more to a specialized non-Arduino micro.    Your non-recurring engineering expenses are going to be greater with each order-of-mag, but these costs are going to be a lower percentage of the final cost.  In other words, if you are making 100,000 units of an individual design, buy the full manufacturer's device development kit, along with a training seminar for your development team.  Then buy a pic' n' place reels of the uncommon, but focused on your design parameters, microcontroller for 5-20 cents each.

 

If you're doing individual learning at home for future career use, start with the Arduino Nano.   School-based learning seems to be usually AVR-based on the Mega devices outside of the Arduino framework.  Best to do what your teacher assigns you to do with the equipment and devices available in the electronics lab, but take the time to learn Arduino as well.  If you're already employed and wish to enhance the skills that your employer will use, learn the "blue pill" ARM Cortex M3 device. This is a complicated chip, so don't be shy to ask around for a engineering tutor familiar with low-cost ARM development.  Expect to pay $100+ dollars for several hours of focused tutorials and development equipment.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Simonetta wrote:
If you are making 1-10 of an individual design, which is rare outside of hobbyist circles, I suggest going fully Arduino UNO/Nano.
Arduino enables one dba the S in SMB/SME in proof-of-concept to design win to first prototype (customer buy-in)

Simonetta wrote:
Buy pre-manufactured bootloader-preinstalled clone MCU module boards that have been manufactured cheaply and reliably.
in-lieu of clone, on original can release restrictive licensing.

Simonetta wrote:
Then buy a pic' n' place reels ...
Ask the PCBA manufacturer what's preferred as tubes still exist; low-rate production may be in bags that the PnP operator will empty onto a tray (OCR, and IIRC, Microchip parts are labelled only on the package's top) (hardware BOM - some distributors have a kitting service, software BOM - PCBA manufacturer may want a self test)

There are local or regional PCB manufacturers which enable local and regional PCBA manufacturers; otherwise, there may be a night-time phone call asking for approval of a part substitution.

Simonetta wrote:
... of the uncommon, but focused on your design parameters, microcontroller for 5-20 cents each.
tiny202 are almost into that price range.

Simonetta wrote:
If you're doing individual learning at home for future career use, start with the Arduino Nano.
One provider of embedded computer language training may have selected micro:bit; some inexpensive operator interface devices don't have USB HCI though do have Bluetooth (Android)

Simonetta wrote:
School-based learning seems to be usually AVR-based on the Mega devices outside of the Arduino framework.
Some engineering colleges have moved away from AVR though may have a course for other students (Arduino enables the creation of custom instruments for those who aren't into electrical engineering)

Simonetta wrote:
If you're already employed and wish to enhance the skills that your employer will use, learn the "blue pill" ARM Cortex M3 device.
or the employer has interests in Motorola 68000, Intel 386, IBM PowerPC, DSP, FPGA, etc (all kinds of employers)

Computer language skills are more portable; computer languages can be via a web browser.

Simonetta wrote:
Expect to pay $100+ dollars for several hours of focused tutorials and development equipment.
Some employers are willing to splash some cash-equivalent for such.

 


Make Your Own Job with Open Source Hardware: What Students Don’t Know

 

via Open Source | Licensing -- Quantum Leaps

 

Designing and Building the Macro Watch - MacroFab (HQ in Houston Texas) 

MacroFab Factory Network - MacroFab

PCBShopper – A Price Comparison Site for Printed Circuit Boards

 

https://www.microchipdirect.com/product/search/all/ATtiny202?mos=true

 

Ada on the micro:bit - The AdaCore Blog

 

ECE 4760, Cornell University (edit : HTTPS)

 

cling@GOREPL

Labs — learn.adacore.com

 

Embedded Software Training Calendar | Embedded Software Engineering Courses | Barr Group via Barr Group Store | Barr Group

Public Ada Training - AdaCore

 

"Dare to be naïve." - Buckminster Fuller

Last Edited: Thu. Feb 6, 2020 - 05:35 PM

Pages