Author Topic: Which microcontroller should I learn?  (Read 34238 times)

0 Members and 1 Guest are viewing this topic.

Offline JacquesBBB

  • Frequent Contributor
  • **
  • Posts: 784
  • Country: fr
Re: Which microcontroller should I learn?
« Reply #125 on: February 21, 2016, 05:51:39 pm »
I've had an Arduino for a few years now but never really used it.  So I've decided that I would like to learn how to program microcontrollers for hobby reasons. 
I want to bypass the Arduino environment because programming the bare metal gets me excited.  Plus it'll help me understand how CPUs work.  My issue is I can\t focus on one thing at a time.

I bought a great C programming book a few months ago but I haven't passed chapter 8 yet.  T

Anyone have any tips?  Please and thank you.

It is never easy to work by yourself with books. This needs a capacity of concentration and to be highly motivated.
Studies at school or at the University are more easy.

Now,  you have the possibility to have something in-between, with the MOOC system,  the  free online courses.
But beware, it you zap from one course to another, you will not learn anything.
The only way to go is to  register to one course, and to  follow it  completely and do the assignments.

For what you are looking for, there is a great MOOC that fits exactly your needs.

https://www.edx.org/course/embedded-systems-shape-world-utaustinx-ut-6-03x#!

See my post mentioning it

https://www.eevblog.com/forum/beginners/stepping-out-from-arduino-start-on-january-20-with-keil-ide-and-ti-launchpad/msg845895/#msg845895

It is still time for registering,  and  you will learn a lot on the inside of MCU,  with nice real boards experiments
using a professional  IDE with debugging (Keil).
This will open you the gate to any possible MCU or IDE.
« Last Edit: February 21, 2016, 05:59:31 pm by JacquesBBB »
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3104
  • Country: us
Re: Which microcontroller should I learn?
« Reply #126 on: February 22, 2016, 02:25:00 am »
 

Offline asgard20032

  • Regular Contributor
  • *
  • Posts: 184
Re: Which microcontroller should I learn?
« Reply #127 on: February 22, 2016, 03:38:25 am »
My advice : Stay away from arduino and API like arduino.

1) They are overpriced. Today, you can get development board for many mcu brand, including some atmega, for around 10$. Getting an arduino at such price is an impossible task, at least, if you want a legit mcu. I don't recommend buying non legit chip, it may just waste your time debugging some "extra non intended feature", not present in the official chip, also know as bug. Those chip are maybe not false mcu, but maybe just either stolen, or one that failed some test and got saved from garbage from some aliexpress seller. Save yourself the effort of debugging non legit chip. Of course, you may get some legit arduino at nice price in some event, like last year arduino day from sparkfun.

2) Lack of debugging : In the official arduino, the only mean of debugging you got is printing over serial. But what happen if the bug has to do with serial? Or the debugging over serial break the realtime of the project? print take lot of processor time. Also, if you intend to really learn embedded system and work your way trough register, how may you debug setting up the frequency and uart with print debugging without being able to print?

3) Using API such as arduino + wanting to get your way at register level = large risk to break some arduino API related stuff. You never know, by setting up pwm or timer or changing frequency which part of the API you may break. For example, by re configuring timer, you may break  the delay function(incorrect delay value). And unfortunately, which feature you may break by changing which peripheral is not the most documented thing. So by wanting to do thing progressively by mixing arduino stuff + your own register level (aka the real way stuff) may be more error prone than going the full register way.

4) Programming on arduino teach some bad programming habbit. Multitasking with delay, no interrupt (except by going to register level and by forcing some handler, see point 3, MAYBE breaking up some API), is not a good thing. What you really need is going sleep + interrupt + state machine. When mcu doing nothing, no delay, but sleep. Some interrupt watch out for some event and guide out the state machine. Another way is to go RTOS, or to mix up RTOS + state machine in each process/thread.

My recommendation, go with a developpment board priced around 10-20$, from a legit source, with either onboard debugger or a porribility to plug your own debugger. (Altought you may plug a jtag to arduino, it require some modification to the board, and debugging the debugger -> mcu interface... no thanks). But yeah, arduino is a good idea. When you design, try to make thing as modular as possible, to make reusable code. Take example on the arduino API, and adapt it to your programming.

Some possible board: Any ST discovery/nucleo board, any launchpad from TI (in TIVA or msp430/msp432, don't touch hercule or c2000, too much advanced/specialized stuff), Freedom board from Freescale, some atmel xplained board (i think its the name), those nice psoc board... Almost every mcu has some affordable board. Just think about which path in the long way you want to follow.

Doing low power stuff? msp430/msp432, stm32l0/stm32l1/stm32l4, some kinetis, ANY silicon labs mcu

Want to get in the big train and get mainstream as much as possible? : arm cortex m0/m3/m4, as your power need rise.

Want to get lot of connectivity? Maybe you like IoT project? arm cortex or pic32 got many connectivity

Your personal project is geared toward DSP or radio frequency? Why not some cortex m3/m4 or pic23/dspic

You are more an hardware guy and thinking with the practical side of the project and don't want to focus too much on the programming aspect? Why not cut off your development time and go with some 8 bit mcu? AVR is the easiest one, very clear datasheet. Except if you need CAN or some other functionality, don't go with pic18. Pic18 is overpriced performance wise. AVR also, but at least you get a nice architecture. But if your programming need is simple enough and just want some more advanced peripheral, why not go with pic16? Not as overpriced as pic18, and include the most recent peripheral from microchip, including hardware PID controller... YEP, a full PID where you just set up 2-4 register, and no software overhead.

Just try to figure out the main area of focus of you future personal project, and we may help you selecting the perfect mcu for your need.
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Which microcontroller should I learn?
« Reply #128 on: February 22, 2016, 11:56:11 am »
"msp432"

I would like to see anyone taking a stock download of ccs, a stock example downloaded from ti and a stock msp432 and show that they work out of the box.

That project was basically pushed out before it is ready. Shame on ti.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Which microcontroller should I learn?
« Reply #129 on: February 22, 2016, 12:02:00 pm »
"register level ="

Like a vortex m chip of your choice, set up the clock, set up uart transmission via the interrupt. All with registers.

And then do the same with the library and you will understand why libraries are used.

This no-library non sense is the same as the no-C nonsense of yesteryear: they never understood that the world have changed and chips are getting so complex that to maintain productivity, you have to rely on libraries, OEM, your own, or a 3rd party.
================================
https://dannyelectronics.wordpress.com/
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 10481
  • Country: gb
    • Having fun doing more, with less
Re: Which microcontroller should I learn?
« Reply #130 on: February 22, 2016, 03:29:10 pm »
This no-library non sense is the same as the no-C nonsense of yesteryear: they never understood that the world have changed and chips are getting so complex that to maintain productivity, you have to rely on libraries, OEM, your own, or a 3rd party.

The buy-vs-build debate is, with good reason, never ending. Decisions must be continually re-evaluated without dogma.

Many many people have been burnt by trying to use a library that had subtle incompatibilites with the way their system was designed. Classic problems areas include re-entrancy, low power, multiple threads/processes, incompatible C compiler flags, and changes/incompatibilities between various vintages of C/C++ compiler standards and implementations.
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: 18289
  • Country: nl
    • NCT Developments
Re: Which microcontroller should I learn?
« Reply #131 on: February 22, 2016, 05:28:55 pm »
Libraries usually don;t behave as expected/documented so when using a library it must solve a difficult problem. OTOH investing time into learning how to use a library can be beneficial because you'll have an off-the-shelve solution for a particular problem. IOW don't throw a library out at the first sign of trouble but do careful research with the help fora and other online resources about the particular library to find it's strengths and weaknesses.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Sal Ammoniac

  • Frequent Contributor
  • **
  • Posts: 940
  • Country: us
    • Embedded Tales Blog
Re: Which microcontroller should I learn?
« Reply #132 on: February 22, 2016, 06:37:44 pm »
MIPS add more complexity by sever orders of magnitude  :D

MIPS is orders of magnitude more complex than what? ARM Cortex?

Nonsense. MIPS is a very simple architecture, even compared to ARM Cortex.
 

Offline legacy

  • Super Contributor
  • ***
  • Banned!
  • Posts: 4415
  • Country: ch
Re: Which microcontroller should I learn?
« Reply #133 on: February 22, 2016, 06:51:30 pm »
MIPS add more complexity by sever orders of magnitude  :D

MIPS is orders of magnitude more complex than what? ARM Cortex?

Nonsense. MIPS is a very simple architecture, even compared to ARM Cortex.

we are talking about two different things: the HDL complexity, the programming assembly complexity
in my experience yes, if you want to implement a MIPS machine in VHDL (I did), it's the simplest in the RISC family
while if you want to program MIPS in assembly (I have written a lot of assembly code, including a monitor), it adds more complexity in your code
as you have to deal with a lot of troubles which are handled by hardware in ARM
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 18289
  • Country: nl
    • NCT Developments
Re: Which microcontroller should I learn?
« Reply #134 on: February 22, 2016, 08:15:06 pm »
MIPS add more complexity by sever orders of magnitude  :D
MIPS is orders of magnitude more complex than what? ARM Cortex?

Nonsense. MIPS is a very simple architecture, even compared to ARM Cortex.
Having written assembly for both they are both equally complicated with MIPS having the one-delay-slot disadvantage because the instruction after each jump gets executed as well. The biggest disadvantage of using MIPS is that when you have cross-platform sourcecode you'll often find an x86 and ARM assembly optimised version but no MIPS assembly optimised version. It gets worse if software depends on pieces of assembly code to work on a certain platform and there is -again- no MIPS support (the older firefox versions for example).

So from a micro perspective there is not much difference but looking at the big picture the difference is huge and MIPS is definitely the lesser choice.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Sal Ammoniac

  • Frequent Contributor
  • **
  • Posts: 940
  • Country: us
    • Embedded Tales Blog
Re: Which microcontroller should I learn?
« Reply #135 on: February 22, 2016, 09:01:14 pm »
while if you want to program MIPS in assembly (I have written a lot of assembly code, including a monitor), it adds more complexity in your code
as you have to deal with a lot of troubles which are handled by hardware in ARM

That I agree with. You pretty much have to do everything explicitly in MIPS assembly code versus an ARM. A good example is an interrupt: a MIPS CPU just saves the PC and vectors to the handler, nothing more. An ARM will save some of the registers as well, minimising what you need to do in the handler. This extends to other operations as well.
 

Offline legacy

  • Super Contributor
  • ***
  • Banned!
  • Posts: 4415
  • Country: ch
Re: Which microcontroller should I learn?
« Reply #136 on: February 22, 2016, 11:22:50 pm »
Having written assembly for both they are both equally complicated

mmm, on the linux platform I find more complexity due to the cache and due to all the mips variants, and there are too many variants in the MIPS family (including IDP, Toshiba, NEC, …. and SONY). Attempting to port linux 4.* to SGI Octane (for SMP purpose, Toshiba R14K/MIPS4, now it works) was not so easy due to the cache, which must done in assembly.

When I programmed the playstation2 I had a lot of troubles with the TLB, which was just different from what I was expecting.
 

Offline legacy

  • Super Contributor
  • ***
  • Banned!
  • Posts: 4415
  • Country: ch
Re: Which microcontroller should I learn?
« Reply #137 on: February 22, 2016, 11:28:42 pm »
I am afraid the PowerPC is the worst: the EIEIO nightmare

EIEIO stands for Enforce In-order Execution of I/O, it's a machine code instruction used on the PowerPC computer processor which prevents one memory or I/O operation from starting until the previous memory or I/O operation completed. This instruction is needed as I/O controllers on the system bus require that accesses follow a particular order, while the CPU reorders accesses to optimize memory bandwidth usage.

It usually causes a lot of headaches in avionics (BSP, BPUM, PUM, AUTOMA, … low level behind the hood)
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8229
  • Country: 00
Re: Which microcontroller should I learn?
« Reply #138 on: February 22, 2016, 11:46:19 pm »
To the OP,

This key is not get paralyzed by the fear of picking up the wrong mcu to learn. If you are going to be a great embedded programmer, you are going to find that out on an avr just as well as you will find that out on a cortex m or pic24, etc.

People have long been great embedded programmers in the 1bit mcu days. So just start the journey learning.
================================
https://dannyelectronics.wordpress.com/
 

Offline ez24

  • Super Contributor
  • ***
  • Posts: 3092
  • Country: us
  • L.D.A.
Re: Witch microcontroller should I learn?
« Reply #139 on: February 23, 2016, 12:28:27 am »
If you're interested in ARM, there is an online course from University of Texas that started this January 20:

https://www.eevblog.com/forum/beginners/free-course-ut-6-03x-embedded-systems-on-edx-starting-now/msg846982/#msg846982

Although it already started, I guess you can still enroll. The course is based around the TI implementation of ARM (TM4C123), and you can get the evaluation board directly from TI: https://store.ti.com/Tiva-C-LaunchPad.aspx. I got mine delivered in 4 days, to Sao Paulo.


FYI  As of Feb 22 2016 this course is still open.  I just enrolled and ordered the kit with the wi-fi from Digit Key.  Price about the same as Element 14 (Newark)  With Newark I could see the complete price and with Digit Key I could not see the exact shipping costs.  Digit Key might have cheaper shipping if I knew the shipping weight.

Now to try and get caught up.  Thanks 1xrtt
YouTube and Website Electronic Resources ------>  https://www.eevblog.com/forum/other-blog-specific/a/msg1341166/#msg1341166
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf