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

0 Members and 1 Guest are viewing this topic.

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Which microcontroller should I learn?
« Reply #50 on: February 16, 2016, 11:18:49 pm »
My recommendation? The TIVA C for $12 + shipping

I agree with your points about Arduino w.r.t. an embedded programming career.

A very quick search for "Tiva C" (because I'm only looking for future reference) shows several (many?) boards and many development environments some of which are unnecessarily expensive.

Which free-as-in-beer development environment would you recommend for a medium size (i.e. >>Arduino sketch) project? (Linux preferred)
« Last Edit: February 17, 2016, 12:40:31 am by tggzzz »
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 dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: Which microcontroller should I learn?
« Reply #51 on: February 16, 2016, 11:53:53 pm »
"tiva C"

I would can anyone who says that he has experience coding in "Tiva C". Experience coding in C is otherwise welcome.
================================
https://dannyelectronics.wordpress.com/
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Which microcontroller should I learn?
« Reply #52 on: February 17, 2016, 12:00:46 am »
I have wasted too many hours on trying to get around the limitations of the 8051!

yes, I agree
even if I find relaxing its enemy-hc11
I mean, 68hc11 is limited, but funny

it's 90s technology, guys, don't look at it  :-DD
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26755
  • Country: nl
    • NCT Developments
Re: Which microcontroller should I learn?
« Reply #53 on: February 17, 2016, 12:54:47 am »
My recommendation? The TIVA C for $12 + shipping
I agree with your points about Arduino w.r.t. an embedded programming career.
I don't. Projects get larger and larger so you have to depend on libraries. Using a higher level programming language which avoids pointers, buffer, memory allocation, etc pitfalls makes a lot of sense to make code more robust. I think we'll see more and more higher level languages being used on microcontrollers in the future.
BTW going for the cheapest development board most certainly isn't a good idea especially when it serves as a dongle for the development tools.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Which microcontroller should I learn?
« Reply #54 on: February 17, 2016, 01:11:08 am »
My recommendation? The TIVA C for $12 + shipping
I agree with your points about Arduino w.r.t. an embedded programming career.
I don't. Projects get larger and larger so you have to depend on libraries. Using a higher level programming language which avoids pointers, buffer, memory allocation, etc pitfalls makes a lot of sense to make code more robust. I think we'll see more and more higher level languages being used on microcontrollers in the future.
BTW going for the cheapest development board most certainly isn't a good idea especially when it serves as a dongle for the development tools.

That's why I asked the question about the dev environment.

As for higher level languages, I have a career's expertise in them. I have been looking for a higher level language than C for embedded programming since the 1980s, without success. My attitude to C++ is that if C++ is the answer, the question must be rethought. And I've been using Java since 1996 (gulp), for high-availability soft real-time programming.

My next project will use VHDL for the time sensitive stuff, and I haven't decided whether to use C or ADA for the software.
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: 26755
  • Country: nl
    • NCT Developments
Re: Which microcontroller should I learn?
« Reply #55 on: February 17, 2016, 01:59:48 am »
Looking at ADA and Lua for use on an ARM controller are still on my todo list. I have looked into C++ for ARM a decade ago but back then support was lacking. C++ would have advantages in the form of being able to get rid of pointers but using the STL library (for example) doesn't seem like a good idea.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: Which microcontroller should I learn?
« Reply #56 on: February 17, 2016, 02:05:27 am »
My attitude to C++ is that if C++ is the answer, the question must be rethought.

Back in the day, that was a reasonable attitude to take. But C++ has come a long way in the last twenty years.

If you're comfortable with Java, then think about taking a second look at modern C++ for embedded projects because it's just as performant as C and vastly safer. Perhaps not quite as safe as Java (since you have to manage your own memory), but still pretty darn safe. E.g., modern C++ lets you get real work done without resorting to macros, whereas C is too clumsy without macros for embedded use.
 

Offline autobot

  • Regular Contributor
  • *
  • Posts: 66
Re: Which microcontroller should I learn?
« Reply #57 on: February 17, 2016, 02:11:27 am »
C++ 14 is supposed to be as safe as java , through the usage of smart pointers and other new language features , i think.
 

Offline reagle

  • Supporter
  • ****
  • Posts: 554
  • Country: us
    • KuzyaTech
Re: Which microcontroller should I learn?
« Reply #58 on: February 17, 2016, 02:13:48 am »
Pretty much any modern embedded micro with free tools and cheap demo boards with integrated ICD will do.
Look at STM32, STM8 (sure an 8-bitter, but modern peripherals), NXP LPC 8xx (some even come in DIP), NXP LPC11xx,TI MSP430/Luminary Micro parts, Silicon Labs Energy Micro, Freescale Kinetis etc.

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Which microcontroller should I learn?
« Reply #59 on: February 17, 2016, 08:53:01 am »
Looking at ADA and Lua for use on an ARM controller are still on my todo list. I have looked into C++ for ARM a decade ago but back then support was lacking. C++ would have advantages in the form of being able to get rid of pointers but using the STL library (for example) doesn't seem like a good idea.

I'm about to try LUA on an ESP8266 for an ultra-low power sensor, which is about as embedded as you can get :)

As for C++, if you think you understand it you are probably wrong. After all, the designers don't.

The designers of the template system were horrified when someone forced them to realise the unintended complexity of their creation. How. He showed that with the appropriate small set of templates he could cause the compiler to emit the sequence of prime numbers during compilation. Yes, their template system was Turing complete, and the designers didn't even realise it. See https://en.wikibooks.org/wiki/C%2B%2B_Programming/Templates/Template_Meta-Programming#History_of_TMP

If the designers don't understand their creation, what chance do mere users have?

And then - from the school of hard knocks - there's the C++ FQA http://yosefk.com/c++fqa/const.html I'm particularly fond of the "const correctness" section, in which the reason for "const" is pulled in two completely oppposite and contradictory directions.
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 tggzzz

  • Super Contributor
  • ***
  • Posts: 19281
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Which microcontroller should I learn?
« Reply #60 on: February 17, 2016, 09:08:12 am »
My attitude to C++ is that if C++ is the answer, the question must be rethought.
Back in the day, that was a reasonable attitude to take. But C++ has come a long way in the last twenty years.

Yes, it has tried to go in two directions: to be a portable assembler and to be a general purpose HLL. Either would have been acceptable, but by trying to be both it failed at both.

IIRC it took 6 years (in the naughties) for the first fully standard compliant compiler to become available. But it may have been C rather than C++. That's ridiculous either way.

As for C++14, since it will break existing programs, it is likely to be as successful as Perl6 or Python3 - i.e. partially at best.

Quote
If you're comfortable with Java, then think about taking a second look at modern C++ for embedded projects because it's just as performant as C and vastly safer. Perhaps not quite as safe as Java (since you have to manage your own memory), but still pretty darn safe. E.g., modern C++ lets you get real work done without resorting to macros, whereas C is too clumsy without macros for embedded use.

Read the C++ FQA and weep. http://yosefk.com/c++fqa/

Read Mike Stump's contibutions on comp.arch, and weep. Apparently he is heavily involved in gcc, and they seem to be taking the attitude that nasal daemons using gcc are the users problem and that gcc shouldn't have to care about it.

Realise that the C++ designers didn't realise the baroque complexity of their creation. I remember watching the "templates are Turing complete" mess unfold in the 90s, i.e.
Historically [tmeplate programming] is something of an accident; it was discovered during the process of standardizing the C++ language that its template system happens to be Turing-complete, i.e., capable in principle of computing anything that is computable. The first concrete demonstration of this was a program written by Erwin Unruh, which computed prime numbers although it did not actually finish compiling: the list of prime numbers was part of an error message generated by the compiler on attempting to compile the code
https://en.wikibooks.org/wiki/C%2B%2B_Programming/Templates/Template_Meta-Programming#History_of_TMP

If the designers don't understand their creation, what chance do mere users have?
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 obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: Which microcontroller should I learn?
« Reply #61 on: February 17, 2016, 09:13:59 am »
Nobody really explained (to me) why it has to be C and why C++ is sooo bad. I am used to OO thinking and I find the 'flatness' of C primitive. C++ compilers these days produce comparable (assembly) code as to what you'd get with C. So I think it is just people being stuck in their 'old backup' and unwilling to change (after a certain age, change gets harder and harder). Still I am willing to have an open mind to this because I CAN imagine that for certain embedded problem-domains the sequential/structured language structure actually fixes some kind of problem (but what problem is that?).

As to what you should learn: pick a modern device with a modern/good IDE and a decent compiler (toolchain). When you get to know a few of them, learning a new one becomes easier every time. Next year there will be newer devices you may have to learn, so you are never done. But it will get easier to pick up.

[2c]
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Which microcontroller should I learn?
« Reply #62 on: February 17, 2016, 12:04:18 pm »
ADA

GNAT ? for PPC? for ARM? for MIPS? for AVR8? for AVR32?
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Which microcontroller should I learn?
« Reply #63 on: February 17, 2016, 12:05:28 pm »
Nobody really explained (to me) why it has to be C and why C++ is sooo bad

C++ without exceptions, at least
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: Which microcontroller should I learn?
« Reply #64 on: February 17, 2016, 01:03:01 pm »
If the designers don't understand their creation, what chance do mere users have?
IMO, the issue for a programmer isn't to enumerate all the weirdest consequences of a language, but to use it well and get work done.

I first started writing K&R style C more than 30 years ago and probably understand 95% of the language. The missing 5% is stuff that I usually look up as needed. E.g., the more arcane varieties of static structure initialization syntax, arithmetic type promotion, etc. As for C++, I understand considerably less, say 60%. One reason for the difference, as you and others point out, is that C++ a very complicated language. Another is that it's a moving target, with the more recent standards adding new features that require lots of book learnin' to figure out.

But which language would I rather code in today? C++... hands down, no contest. Why? Because I'm vastly more productive with C++'s strong typing, particularly when it comes to refactoring a big chunk of code. I rarely need to cast pointers any more. I don't spend much time writing or debugging #define macros  because most of that can be done within the language itself with enums and constexpr functions. My code is more readable because namespaces and class scoping means I don't need to prepend module hierarchy into every identifier. References are really handy when it comes to implementing systems without dynamic memory (most of what I do these days). Pure virtual functions and public/protected visibility provide structured ways to write reusable code from the start. And frankly, RAII is a godsend. Etc, etc, the list goes on.

Sure, C++ is a lot more complicated than C. But for me, at least, it's a better tool.


 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Which microcontroller should I learn?
« Reply #65 on: February 17, 2016, 01:08:02 pm »
I don't spend much time writing or debugging #define macros  because most of that can be done within the language itself with enums and constexpr functions

can give me an example, please?

And frankly, RAII is a godsend. Etc, etc, the list goes on.

yes, I agree with no doubt
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: Which microcontroller should I learn?
« Reply #66 on: February 17, 2016, 01:34:25 pm »
can give me an example, please?
Sure. Here's a bunch of constants defined as a C++ typed enum:
Code: [Select]
      // Commands are offets into the internal RAM of the bq27621
      // These are 16-bit little-endian values in successive locations, N and N+1
      enum command_t : uint16_t {
        CONTROL                         = 0,
        TEMPERATURE                     = 2,  // in 0.1 degrees K
        VOLTAGE                         = 4,  // in mV
        FLAGS                           = 6,
        NOMINAL_AVAILABLE_CAPACITY      = 8,  // in mAh
        FULL_AVAILABLE_CAPCITY          = 10, // in mAh
        REMAINING_CAPCITY               = 12, // in mAh
        FULL_CHARGE_CAPACITY            = 14, // in mAh
        EFFECTIVE_CURRENT               = 16, // in mA
        AVERAGE_POWER                   = 24, // in mW
        STATE_OF_CHARGE                 = 28, // in %
        INTERNAL_TEMPERATURE            = 30, // in 0.1 degrees K
        REMAINING_CAPACITY_UNFILTERED   = 40, // in mAh
        REMAINING_CAPACITY_FILTERED     = 42, // in mAh
        FULL_CHARGE_CAPACITY_UNFILTERED = 44, // in mAh
        FULL_CHARGE_CAPACITY_FILTERED   = 46, // in mAh
        STATE_OF_CHARGE_UNFILTERED      = 48, // in %
        OPERATION_CONFIGURATION         = 58,
        DESIGN_CAPACITY                 = 60, // in mAh
      };

Most embedded C could would use #define macros for those, although C99 (and perhaps older C standards) have enums too. The nice thing about C++ is that you can easily specify the type that these constants evaluate to--in this case uint16_t.

On the constexpr side, here's a C++ function that creates a 16-bit result based on two arguments. It's used inside a low-level Bluetooth implementation:

Code: [Select]
        /**
         * @brief creates a compile-time HCI opcode constant
         * @param[in] ogf HCI OpCode Group Field value (6 bits)
         * @param[in] ocf HCI OpCode Command Field value (10 bits)
         * @return 16-bit HCI command opcode
         */
        static constexpr uint16_t opcode(uint16_t ogf, uint16_t ocf) {
          return ((ogf & 0x003f) << 10) | ((ocf & 0x03ff) << 0);
        }

This would typically be done in C with a "function like macro". Some benefits of the C++ implementation are that it's strongly typed, and in a debug build, I can step into the function as if it were a normal function call. In an optimized build, it's compiled away. The constexpr restriction means that if constant arguments are supplied in a call, then the result will be evaluated at *compile time*, and that I'm only allowed to use things in the body of the function that are available to the compiler (e.g., no global variables).
« Last Edit: February 17, 2016, 01:37:58 pm by andyturk »
 

Offline Roicker

  • Contributor
  • Posts: 12
  • Country: mx
Re: Which microcontroller should I learn?
« Reply #67 on: February 17, 2016, 02:58:05 pm »
"tiva C"

I would can anyone who says that he has experience coding in "Tiva C". Experience coding in C is otherwise welcome.

Tiva C is the name of the board from TI.... you can program it with assembler and C/C++
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Which microcontroller should I learn?
« Reply #68 on: February 17, 2016, 03:27:49 pm »
Most embedded C could would use #define macros for those, although C99 (and perhaps older C standards) have enums too. The nice thing about C++ is that you can easily specify the type that these constants evaluate to--in this case uint16_t.

understood, good tips :-+
 

Offline Roicker

  • Contributor
  • Posts: 12
  • Country: mx
Re: Which microcontroller should I learn?
« Reply #69 on: February 17, 2016, 04:25:19 pm »
My recommendation? The TIVA C for $12 + shipping
I agree with your points about Arduino w.r.t. an embedded programming career.
I don't. Projects get larger and larger so you have to depend on libraries. Using a higher level programming language which avoids pointers, buffer, memory allocation, etc pitfalls makes a lot of sense to make code more robust. I think we'll see more and more higher level languages being used on microcontrollers in the future.
BTW going for the cheapest development board most certainly isn't a good idea especially when it serves as a dongle for the development tools.

Of course developers don't do everything from scratch, we use many libraries in our development as well.

But what happens when there is an error on a  "tested" function because you are using it on a new generation of the product? are you just going to submit a ticket and pray someone fixes it eventually? I don't think the costumer would be to happy to know you have no clue were the problem is.

My point is... yes, normally you don't need to go deep down (unless you develop Drivers) but that doesn't mean you shouldn't know, because the fact is, you will need it eventually. Maybe you en up working for a company were you have to setup a project with a new chip an a custom BSP with external memory and other stuff like that, or maybe you end up doing a high level graphics Driver that requires for you to know about registers and how to access that peripheral. In the end, a good Embedded SW Dev needs to know the basics to debug the really complex problems when it is needed.

One of the best Embedded SW Devs that I've worked with knew very little about embedded and that was no problem... until he needed to develop a driver for a new peripheral :P

You could "survive" without knowing about low level, but in my opinion it doesn't hurt, because you will understand the system way better if you understand how it works!

And about going with the cheapest board. I really see no problem if you don't plan on doing you own HW, which based on the OP's question I believe is not what it is intended.

If you know cheap board with an ICD that has a free toolchain I would like to know (seriously) because I looked a while ago and I couldn't find one so I went for the Tiva C.
 

Offline Roicker

  • Contributor
  • Posts: 12
  • Country: mx
Re: Which microcontroller should I learn?
« Reply #70 on: February 17, 2016, 04:41:34 pm »


Quote from: tggzzz on Yesterday at 10:18:49 AM


>Quote from: Roicker on Yesterday at 08:31:41 AM
My recommendation? The TIVA C for $12 + shipping



I agree with your points about Arduino w.r.t. an embedded programming career.

A very quick search for "Tiva C" (because I'm only looking for future reference) shows several (many?) boards and many development environments some of which are unnecessarily expensive.

Which free-as-in-beer development environment would you recommend for a medium size (i.e. >>Arduino sketch) project? (Linux preferred)



This is the board I use, the EK-TM4C123GXL:
http://www.ti.com/ww/en/launchpad/launchpads-connected-ek-tm4c123gxl.html#tabs

It's $12 plus shipping and you can get it from TI or other big distributors

On the link you can see all the resources, for example, the Code Composer Studio to develop for the Tiva C. Like I mentioned before, If you use it with their kits the compiler is free and unrestricted. I develop in Windows but there is a Linux version as well.

I see that there is a suite called Energia to develop using sketchs (similar to an Arduino toolchain I think I've heard about) and a cloud based IDE but I haven't used any of these two.

On the bottom of the page you can find the links to the wiki and the workshop. The Workshop is very useful for beginners to learn and it is very well documented (you get slides and a more comprehensive document for each lesson).
 

Offline cdonateTopic starter

  • Contributor
  • Posts: 18
  • Country: br
Re: Which microcontroller should I learn?
« Reply #71 on: February 17, 2016, 04:54:29 pm »
First things first... TL; DR; If you want to learn embedded seriously, buy something that is not an Arduino. My recommendation? The TIVA C for $12 + shipping

I think I may be qualified to answer the OP's original question. I have a B.S. in Mechatronics, M. Sc. in Control and I work as the SW Group Leader of a big Tier 1 (we sell to most of the automotive OEMs of the world) that makes ADAS Sensors. I'm not bragging, I just bring this up to try to explain why I think I'm qualified to give a relevant opinion.

I've hired a lot of people over the last years for the position of Embedded SW developer for Instrumentation Displays (Clusters) and ADAS Sensors and one thing that I really don't like to see in a candidate is when they say they know embedded because they have programmed in Arduino. Let me explain this: I don't think arduino is bad, it's actually a great tool (I have one in my 3D printer) for when you want something cheap and that can be reproduced by many, but if you only have used it with the libraries that come with it, or you bought a shield and downloaded code from somewhere... well I don't think I would be very interested in hiring you in that case. The problem in an interview is to separate the people that actually learned with an arduino from the people that only downloaded code and connected some cables.                   

If you have used Arduino for doing something complex (like program Ardupilot or Repetier for a 3D printer :P) well then it's easy for me (and any interviewer) to see that you have potential because you took a simple tool and built something great with it.

For the reasons mentioned above I think using something like a PIC, an ST or TI ARM or even an AVR Mega (I know that is the MCU of the Arduino, but I mean directly without the code base) is better for actually learning Embedded Systems. The current toolchains have the basic startup for the MCUs but after that, you need to analyze examples and read datasheets to understand how to setup and use the peripherals and debug SW by checking how the system is behaving after each step. These things are what we are looking for in embedded SW devs, engineers that can analyze requirements and write code to realize them and if something goes wrong DEBUG IT! With an Arduino most of this has been done, all you have to do is call a function. Also, the toolchain doesn't allow you to do in circuit debugging as far as I know you can only "code and pray" that it works.

The main problem with Arduino for me is: It makes it too easy! that is great if you don't want a career in Embedded SW, but if you do, I recommend something else.

My personal recommendation (because I've bought a couple of kits and worked with several MCUs) is the Tiva C from Texas instruments. Why?

1. The thing is cheap ($12) dlls plus shipping, but if you bundle that with other components you may need it's ok
2. Has good support from a community (it's obviously not as good as arduino but it works)
3. You have an In-Circuit Debugger included for free, which means you can execute your code step by step, set breakpoints, see the memory, etc. and all of this is great for learning and debugging
3. It has code examples and tutorials to teach you the basics because it's aimed at the DIY community
4. As long as you are using that board the compiler and toolchain are free with unlimited code size
5. It has a fast ARM Cortex M4F (with floating point) and it has a lot of peripherals

hope this helps!

Roicker, thank you very much for your answer. That was pretty much the info I was looking for.

I decide learning "real" embedded systems for the exact reason you explained.

I know how to program an Arduino, and I can make more complex things with it, but I don't feel like I'm really programming an embedded system, the Arduino language masks almost everything, limits the control I have over the uC and I'm limited to a small family of uC.

I'll follow your tips, the Tiva seems like a nice choice to start.

Can you tell me what do you look for in a interview? How does a candidate with no experience shows you that he know how to program embedded systems?

I'm current reading Making Embedded Systems by Elecia White, which seems like a good place to start.
« Last Edit: February 17, 2016, 04:57:12 pm by cdonate »
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 26755
  • Country: nl
    • NCT Developments
Re: Which microcontroller should I learn?
« Reply #72 on: February 17, 2016, 04:57:45 pm »
If you know cheap board with an ICD that has a free toolchain I would like to know (seriously) because I looked a while ago and I couldn't find one so I went for the Tiva C.
There are lots of boards out there with on-board debugging interfaces... For example this one (I have two of these):
http://www.ebay.com/itm/New-NXP-ARM-Cortex-M3-LPC1768-Development-Board-3-2-TFT-LCD-Module-64KB-SRAM-/270962249071

Free toolchain is Eclipse + ARM GCC + GDB

Besides the TI ARM devices are (AFAIK) the old Luminary micro devices with their long errata sheets. Just a random pick: Tiva™ C Series TM4C129x errata sheet is more than 100 pages! NXP's LPC407x (also Cortex M4F) errata sheet is only 9 pages long (including title pages and disclaimers). Based on the dates the NXP LPC407x seems to be older than the Tiva C.

All in all the Tiva C seems like a poor choice because it is obviously slapped together without much thought or testing. That is not a microcontroller you want to invest time in unless it has a very specific advantage not found in other microcontrollers.
« Last Edit: February 17, 2016, 05:07:36 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Roicker

  • Contributor
  • Posts: 12
  • Country: mx
Re: Which microcontroller should I learn?
« Reply #73 on: February 17, 2016, 05:14:45 pm »
First things first... TL; DR; If you want to learn embedded seriously, buy something that is not an Arduino. My recommendation? The TIVA C for $12 + shipping

I think I may be qualified to answer the OP's original question. I have a B.S. in Mechatronics, M. Sc. in Control and I work as the SW Group Leader of a big Tier 1 (we sell to most of the automotive OEMs of the world) that makes ADAS Sensors. I'm not bragging, I just bring this up to try to explain why I think I'm qualified to give a relevant opinion.

I've hired a lot of people over the last years for the position of Embedded SW developer for Instrumentation Displays (Clusters) and ADAS Sensors and one thing that I really don't like to see in a candidate is when they say they know embedded because they have programmed in Arduino. Let me explain this: I don't think arduino is bad, it's actually a great tool (I have one in my 3D printer) for when you want something cheap and that can be reproduced by many, but if you only have used it with the libraries that come with it, or you bought a shield and downloaded code from somewhere... well I don't think I would be very interested in hiring you in that case. The problem in an interview is to separate the people that actually learned with an arduino from the people that only downloaded code and connected some cables.                   

If you have used Arduino for doing something complex (like program Ardupilot or Repetier for a 3D printer :P) well then it's easy for me (and any interviewer) to see that you have potential because you took a simple tool and built something great with it.

For the reasons mentioned above I think using something like a PIC, an ST or TI ARM or even an AVR Mega (I know that is the MCU of the Arduino, but I mean directly without the code base) is better for actually learning Embedded Systems. The current toolchains have the basic startup for the MCUs but after that, you need to analyze examples and read datasheets to understand how to setup and use the peripherals and debug SW by checking how the system is behaving after each step. These things are what we are looking for in embedded SW devs, engineers that can analyze requirements and write code to realize them and if something goes wrong DEBUG IT! With an Arduino most of this has been done, all you have to do is call a function. Also, the toolchain doesn't allow you to do in circuit debugging as far as I know you can only "code and pray" that it works.

The main problem with Arduino for me is: It makes it too easy! that is great if you don't want a career in Embedded SW, but if you do, I recommend something else.

My personal recommendation (because I've bought a couple of kits and worked with several MCUs) is the Tiva C from Texas instruments. Why?

1. The thing is cheap ($12) dlls plus shipping, but if you bundle that with other components you may need it's ok
2. Has good support from a community (it's obviously not as good as arduino but it works)
3. You have an In-Circuit Debugger included for free, which means you can execute your code step by step, set breakpoints, see the memory, etc. and all of this is great for learning and debugging
3. It has code examples and tutorials to teach you the basics because it's aimed at the DIY community
4. As long as you are using that board the compiler and toolchain are free with unlimited code size
5. It has a fast ARM Cortex M4F (with floating point) and it has a lot of peripherals

hope this helps!

Roicker, thank you very much for your answer. That was pretty much the info I was looking for.

I decide learning "real" embedded systems for the exact reason you explained.

I know how to program an Arduino, and I can make more complex things with it, but I don't feel like I'm really programming an embedded system, the Arduino language masks almost everything, limits the control I have over the uC and I'm limited to a small family of uC.

I'll follow your tips, the Tiva seems like a nice choice to start.

Can you tell me what do you look for in a interview? How does a candidate with no experience shows you that he know how to program embedded systems?

I'm current reading Making Embedded Systems by Elecia White, which seems like a good place to start.

I'm glad I was able to help cdonate!

When you struggle with programming your own routines for a peripheral or any other thing you are working on, you really learn stuff and that shows... with just a couple of questions I can see if someone downloaded a library to do everything or if he actually knows because he suffered several nights to get it to work. This is also true with team projects, it's easy to detect the guy that got everything to work and the guy who just put his name on the report at the end :P.

But to answer more directly to your question, I normally ask what kinds of projects you have worked on and go from there, trying to get details on how you did stuff and on what parts you had the most difficulties. Many Candidates "give me the rope to hang themselves", which means they talk about a project they were involved on, but they didn't really do the actual coding so they don't know it well (or at all).

It's funny but it's something you can't hide when you know and you can't fake when you don't! (at least in my experience :D)

I haven't read heard about the book you mentioned, but I learned embedded like 10 years ago hehehe

My advice would be, do the tutorials and then look for an interesting project and implement it, when you are done, do another one! that way you are learning, but it's fun and you have a bigger motivation than just wanting to learn embedded. In my opinion this is the best way to learn embedded, because each night you will stay up late struggling to get the project to work it will be because you are enjoying it.
 

Offline Roicker

  • Contributor
  • Posts: 12
  • Country: mx
Re: Which microcontroller should I learn?
« Reply #74 on: February 17, 2016, 05:32:04 pm »


Quote from: nctnico on Today at 03:57:45 AM


>Quote from: Roicker on Today at 03:25:19 AM
If you know cheap board with an ICD that has a free toolchain I would like to know (seriously) because I looked a while ago and I couldn't find one so I went for the Tiva C.


There are lots of boards out there with on-board debugging interfaces... For example this one (I have two of these):
http://www.ebay.com/itm/New-NXP-ARM-Cortex-M3-LPC1768-Development-Board-3-2-TFT-LCD-Module-64KB-SRAM-/270962249071

Free toolchain is Eclipse + ARM GCC + GDB

Besides the TI ARM devices are (AFAIK) the old Luminary micro devices with their long errata sheets. Just a random pick: Tiva™ C Series TM4C129x errata sheet is more than 100 pages! NXP's LPC407x (also Cortex M4F) errata sheet is only 9 pages long (including title pages and disclaimers). Based on the dates the NXP LPC407x seems to be older than the Tiva C.

All in all the Tiva C seems like a poor choice because it is obviously slapped together without much thought or testing. That is not a microcontroller you want to invest time in unless it has a very specific advantage not found in other microcontrollers.


I think you are missing the point nctnico, the OP wants something that is less intimidating than a Chinese board with no tutorials and with which you have to setup everything by yourself. I'm sure for a veteran like you that's no problem ;) but for a beginner it may be too much. Plus it's almost $70 and you are buying Chinese quality (which is not always bad, but it's more of a risk). Maybe switching to a better MCU would be a next step, once he has dominated a more basic setup with tutorials, an already configured toolchain and more help from a community that uses exactly the same setup and board.

I understand that the Tiva C has its limitations, but if you wanted to create your own toolchain and do something more professional then you are not the target audience for this board. This board is for beginners, even if you don't end up using it professionally you would be able to extrapolate that knowledge because the compiler is standard and the only difference will be how you set up peripherals.

All that being said, I've been using the Tiva C to develop the control of a balancing Robot and it's more than adequate for the job. I get ICD, a small footprint to be able to fit in the robot, a simple but powerful IDE and IT'S $12!!!!!!!!! I even considered a Teensy (~$20 depending on the version) but the Tiva C has ICD which after developing embedded SW professionally is something you can't live without :D.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf