1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

Microcontroller Family Selection Guide

Discussion in 'Embedded' started by Eric, Nov 5, 2007.

  1. Eric

    Eric Guest

    I wrote up some of my thoughts about various microcontroller families.
    My intent is to mostly to help newbies and students decide what type
    of microcontrollers to start with.

    http://www.ericengler.com/downloads/microcontroller family selection guide.pdf

    Feel free to correct any possible errors, but I have a right to keep
    my opinions unless you can change them by presenting new information.

    There are many families I have never tried so I did not try to comment
    on them.

    I want to follow this up with another document that points out some
    good developer boards, ISP programmers, and JTAG debuggers for the
    various families.

    Eric
     
    Eric, Nov 5, 2007
    #1
    1. Advertisements

  2. Since you asked:
    Err ?!? - Do you have any opcode examples of this feature ?

    It also has atomic boolean opcodes, and the Bit Addressable space is
    split 50:50 to SFR space, and RAM data Space.
    With a language that supports named Boolean variables, this makes for
    very compact, and readable control code.
    Incorrect. There are many C compilers that prove this to be false.
    Perhaps you meant to say the core was designed before C was ever
    comtemplated on uC, so more effort is needed to create a usable compiler
    for the 80C51. There are also other languages, like Basic, Pascal and
    Modula-2 for the C51 core. PL/M was an early language, that showed what
    could be done, and a BASIC52 was also very early.

    Err?!? There is no paging in C51's - you are thinking of PICs (or 8048?) ?
    The 80C51 has variable length opcodes, and these give tight code.
    eg Appx speaking, these can access ACC or Registers in 1 byte, direct
    memory in 2 bytes and XDATA in 3 bytes.

    Not correct. There is Move Dir,Dir, and DJNZ Dir, (& others) and the
    Boolean opcodes mean you CAN write workable interrupt routines that do
    not use any registers.
    The 80C51 has MUCH better Memory-Memory opcode access, than an AVR, or
    PIC. The only device ahead, on Memory-Memory opcodes, would be the Intel
    196, and the Zilog Z8 or Infineon XC166 both have register-frame
    control, that emulates memory-memory, but with the wider opcodes of
    reg-reg access.
    Correct. It is the most sourced core on the planet.
    [Microchip volumes are climbing, but that is spread over MANY cores -
    PIC is a brand, _not_ a Core]
    Nearly, SiLabs have not released Ethernet C51's yet, but others have.
    correct. SiLabs offer 12/16/24 bit ADCs, and if tou want HighEnd ADCs,
    you will likely buy a C51 from Silabs, ADi, BurrBrown (TI), TDK etc

    Other cores:
    Err, no, I'd call the RS08 well designed, and a good example of
    "throw everything overboard, until the compiler stops working"
    It is a minimalist core.
    ( Like the 80C51, it has variabe length opcodes for good code density.)
    Err ?. The RS08 has some unique and pioneering new features, besides the
    core :
    It has a wide-supply range, thanks to a clever sub-uA OnChip regulator
    and a VERY LOW current (< 1uA) timer mode, as well as Analog Comparitor,
    and Low Voltage Detector, and an On Chip OSC.
    If you think there are better Smart 555 class choices, I'd like to know
    what they are!

    On-Chip regulators are an emerging technology. (The newest SiLabs and
    Infineon etc device do this too). It provides a good way to make a truly
    wide-usage device, that has a Shrink-process core for low cost, and low
    EMC footprint.

    The RS08 is stocked by many catalogue companies, and prices are easily
    under 50c in smallish volumes. So that's NOT a 'high volume only' device.

    MSP430:
    Yes, but the MSP430 lacks a Low power Cal On-Chip OSC. You have to use
    the 32KHz Crystal option, which gives HIGH precision, but has cost and
    vibration impacts.
    Other devices with OnChip OSC have fast wakeups, the newest Silabs
    devices wake up in well under 1uS!
    The Newest Silabs devices have uA comparitors, and Low icc precison
    on-Chip trimable oscillators - which opens up lower power RUN than
    MSP430, if you do not need crystal accuracy.
    (If you do, then the SiLabs devices also have 32Khz Xtal osc ability,
    and performance are more comparable.)


    Coldfire:
    Freescale have just released Coldfire V1 core variants, and have (IIRC)
    a Free compiler up to 128K in Size. The Code fire V1 targets easy
    Migration from 8 Bit cores.

    For learning : SiLabs have an expanding range of impressive, Low cost
    Eval Stick level products. These all have USB debug access.

    Other recent cores of interest: On the fringes, Korean Coreriver have
    just released a new 4 bit '80c51 subset' variant GC89C510A0. ASM only.
    Precise on chip Osc, no timers, or INTs, and targeting toys & remote
    controls. FLASH models under US30c

    -jg
     
    Jim Granville, Nov 5, 2007
    #2
    1. Advertisements

  3. Eric

    Eric Guest

    I could swear that the 8051 had a barrel shifter, but maybe it was one
    of the variants that had that feature and I just assumed it was part
    of the original 8051.

    The 8051 memory paging I was referring to should have been named
    differently to avoid confusion. I had in mind the bottleneck of using
    DPTR to reference memory and the fact that most instructions do not
    have the ability to reference "external" memory. That's not really
    paging...it's worse in my mind.

    There are msp430 devices with 2% accuracy in the internal osc.

    The RS08 can not be cost effective for low volume applications because
    it can't be used in a lot of different applications. In most real
    devices you'll need more horsepower. Their are a number of consumer
    applications where it will shine, but only if the volume is high
    enough to justify retooling for that chip. An ATTINY or a small PIC
    has a lot more flexibility and the tooling cost can be amortized out
    over many applications. The software tooling cost of an ATTINY is also
    cheap due to gcc. Only very specialized compilers can generate
    efficient C code for the RS08, and I can't imagine writing assembler
    code for it (I know some of you can do it well and my hat is
    definitely off to you).

    I really like the Coldfire architecture and I hope it catches on in
    the GP market. Freescale has had a lot of marketing problems and I
    hope they get over them. But unfortunately, they sat on their butt and
    watched Arm eat away at their market share. By the time they woke up
    they ended up far behind. This new V1 thing seems like a good idea,
    but is probably a few years late in coming.

    I'll make some changes to the document to fix the errors with 8051
    info. and maybe to clarify some other points. If anyone else sees
    issues, please let me know.

    Eric
     
    Eric, Nov 5, 2007
    #3
  4. Eric

    Walter Banks Guest

    Eric,

    Some factual corrections and comments.

    8051 These are a Harvard family that pre-dated the usage of the word Harvard.

    I thought that the term Harvard Architecture came from Harvard Mark I
    developed during the second world war 1944 or so.

    8051 I don't know any versions of the 8051 that has a barrel shifter for multiple
    bit shifts

    8051 Has a complete instruction set, many C compilers have been successfully
    written for it.


    PIC 8-bit (12F, 16F, 18F) Very successfully used for the applications that it
    was intended. The Stamp serial memory example shows its flexibility
    to execute an interpreted language.

    " extremely limited hardware stack that makes them especially unsuitable
    for use with C compilers."

    Stack size does not prevent C from being implemented on the architecture
    there are several good C compilers for the Microchip PIC families of
    parts including ours.



    "RS08 – the weakest 8-bit line in existence, and a terrifically good example
    of how NOT to implement a Harvard architecture."

    The RS08 is a von Neumann architecture part not Harvard.

    The RS08 is a very well implemented minimalist processor with a
    diverse application possibilities. The RS08 is sub $1.00 part with
    background mode debugging BDM on chip and a surprisingly
    powerful instruction set.

    Benchmarks on our C6808 compiler tools show that code generated for
    the RS08 is between 10 and 15% larger than the same applications on
    68hc08 and S08 parts. Most of the difference is lack of hardware
    multiply and divide.



    General comment about C compilers. All of the architectures reviewed have
    good C compilers available. You may be doing yourself a disservice by
    limiting yourself to no cost tools. The typical commercial C compiler
    supporting this class of processors costs between 2 and 3 man days. If
    it saves that much development costs it should be considered.


    Regards

    --
    Walter Banks
    Byte Craft Limited
    Tel. (519) 888-6911
    Fax (519) 746 6751
    http://www.bytecraft.com
     
    Walter Banks, Nov 5, 2007
    #4
  5. Eric

    Walter Banks Guest

    This has not been my experience with the RS08. This part has a
    surprising amount of processing power.

    I wrote the code generator for a RS08 C compiler. The instruction
    set is orthogonal and complete. There were no specifically difficult
    parts in the RS08 compiler implementation At the assembly level it
    is very similar to many of freescales offerings including others in your
    review.

    RS08 C compiler overview

    http://www.bytecraft.com/downloads/rs08adv.pdf




    Regards

    --
    Walter Banks
    Byte Craft Limited
    Tel. (519) 888-6911
    Fax (519) 746 6751
    http://www.bytecraft.com
     
    Walter Banks, Nov 5, 2007
    #5
  6. Eric

    FreeRTOS.org Guest


    What about the PIC32? You seem to have missed it off :eek:)

    --
    Regards,
    Richard.

    + http://www.FreeRTOS.org
    14 official architecture ports, 1000 downloads per week.

    + http://www.SafeRTOS.com
    Certified by TÜV as meeting the requirements for safety related systems.
     
    FreeRTOS.org, Nov 5, 2007
    #6
  7. Eric

    steve Guest

    Nice job, your always going to get complains when you hit a nerve of
    someone's "love child"

    anyway, newbies typical uses small processors to do floating point, so
    here is a modified list I posted a while back to give newbies a
    ballpark estimate what they can expect


    MPS430, 32 bit floats, imagecraft complier, typical cycles
    add 158
    sub 184
    mul 332
    div 620


    ARM, keil complier 32 bit floats, typical cycles
    add 53
    sub 53
    mul 48
    div 224
    sqrt 439
    log 435


    ARM, GNU complier 3.3.1 32 bit floats, typical cycles
    add 472
    sub 478
    mul 439
    div 652
    sqrt 2387
    log 13,523

    ARM, GNU complier 3.4.3 32 bit floats
    add 73
    sub 74
    mul 49
    div 142

    8051, keil complier, 32 bit floats, typical cycles
    add 199
    sub 201
    mul 219
    div 895
    sqrt 1117
    log 2006

    AVR, IAR complier, 32 bit floats
    add 173
    sub 176
    mul 175
    div 694
    sqrt 2586
    log 3255


    max cycles up to 2x typical
     
    steve, Nov 5, 2007
    #7
  8. Eric

    DJ Delorie Guest

    You've skipped the entire R8C/M16C/M32C family from Renesas,
    which is 16 bit, ranging from 20 pin to 144 pin packages, 4K to 1M
    flash, lots of peripherals, both free and non-free dev tools, and easy
    to program in-circuit.

    http://america.renesas.com/fmwk.jsp?cnt=m16c_family_landing.jsp&fp=/products/mpumcu/m16c_family/

    They're stack-oriented CISC (i386 developers will find them
    "comfortable" as the addressing modes and register sets are similarly
    designed). The larger chips have externally-accessible data/address
    busses for expansion; I have one board on my desk with 4Mb of external
    RAM and a CP2200 ethernet port. Speed range is 16-32 MHz; most chips
    run on 3.3 or 5v (the bigger ones can be split - half the pins run on
    one voltage, the rest on the other).

    The only drawback from a "beginner" point of view is that they're not
    available in common 0.1" DIP packages, although you can get plans for
    adapters for the small ones.
     
    DJ Delorie, Nov 5, 2007
    #8
  9. Why not create a Wiki instead?
     
    Ulf Samuelsson, Nov 5, 2007
    #9
  10. That's an opcode reach threshold issue, and every device have those.
    In the 80C51 you have 128+128 bytes of DATA memory, which can be
    accessed & also INC/DEC/DJNZ/AND/OR etc _without_ consuming a register
    pointer.
    In this memory, the 80C51 is _more_ code efficent than a core like the
    AVR, where ALL Data memory goes via some pointer, or offset pointer.

    A better idea on a uC register ('RISC') core, is a register frame
    pointer a la C166, and z8. The AVR started life as a RISC IP block, so
    that was not on their radar.

    XDATA is Microcontroller optional, and so has less access opcodes. Many
    newer C51's have multiple DPTR sets, which eases the bottleneck.
    It is not the precision, it is the absence of Low Power on Chip OSC.
    We have an app right now, where we cannot afford a 32Khz Xtal,
    and do not need high precision.
    That's actually not easy to resolve. eg AVR P versions OnChip LF OSC,
    consumes a large 100-220uA.

    Best are newest Silabs devices at 5.5uA and some WDOG Osc, at 1-2uA,
    but most WDOG osc are very poor in Precison AND trim.
    There is a definite Icc/Precision trade off.
    Ideal would be a RS08 with more pins, but that's not around yet...

    That does not quite make sense - did you mean tiny (hobby) volumes,
    where the chip price is immaterial. There you certainly should
    overshoot the core, as it saves time.
    Low volume can be up to 10,000 in many chip vendors terms.

    In most real
    Freescale have a free compiler, for this ?
    -jg
     
    Jim Granville, Nov 5, 2007
    #10
  11. There are some with an additional ALU SFR mapped, first seen in the
    Siemens 80C517. That allowed 32 bit operand, and IIRC included a barrel
    shift. There is no native opcode for barrel shift.

    -jg
     
    Jim Granville, Nov 5, 2007
    #11
  12. Eric

    steve Guest

    if you are not worried about precision, STM32's have .65 uA typical
    on the low power chip OSC, 1.2uA max
     
    steve, Nov 5, 2007
    #12
  13. :)

    That's how it goes in this industry, as soon as you hit 'print',
    it's out of date!

    -jg
     
    Jim Granville, Nov 5, 2007
    #13
  14. Eric

    Ray Haddad Guest

    With all the controversy already embedded (pun intended) in this
    thread, a Wiki page might be a good start towards a meaningful
    gathering of thoughts and real information..
     
    Ray Haddad, Nov 5, 2007
    #14
  15. [STM32 is way too big for this app, but..]
    Interesting. No mention of trim, but quite good numbers for 2:1 range.
    Even their HSI is pretty good at 80uA for 'precision' 8MHz.

    The Zilog eZ8-XP series have a similar uA region Wdog osc, and a full 32
    bit Wdog divider, so trim is possible.

    Being lazy, we'd like a uA osc with precision too :)

    But being realistic we can tolerate a uA osc that can be infrequently
    recalibrated against a burst run of a higher precision CalOsc.

    Most chips have 32KHz watch Xtal osc, but on chip micropower ones
    are 'emerging technology'.

    As ST, and Freescale show, it IS possible to make uA region LF RC oscs,
    all we need, is that peripheral on the right uC !

    [Notice again, how the core is not part of this selection process...]

    -jg
     
    Jim Granville, Nov 5, 2007
    #15
  16. Eric

    CBFalconer Guest

    I am not familiar with the RS08, but comparing it with older chips
    such as the 8080 and z80, and assuming that you are not talking
    about floating point operations, 16 bit multiply and divide
    subroutines should take in the order of 200 bytes of code. Somehow
    I doubt that this explains your 10 to 15% size expansion.
     
    CBFalconer, Nov 5, 2007
    #16
  17. Eric

    Ray Haddad Guest

    You took the words right out of my post!
     
    Ray Haddad, Nov 6, 2007
    #17
  18. Eric

    Walter Banks Guest

    The 10 to 15% the range is from a benchmark of ~20
    applications run through both the 6808 and RS08 compilers.
    The largest single difference was the availability of mul and divide
    hardware, there are other differences each accounting for
    a few bytes one way or another.

    Our RS08 16 bit mul and divide total 81 bytes
    16x16 mult is 38 bytes and 16 by 16 divide is 43 bytes

    The 8x8 mult is 18 bytes the accum824 is about 100 bytes. All of the
    libraries were written in C.


    Regards

    --
    Walter Banks
    Byte Craft Limited
    Tel. (519) 888-6911
    Fax (519) 746 6751
    http://www.bytecraft.com
     
    Walter Banks, Nov 6, 2007
    #18
  19. Eric

    Eric Guest

    Thanks to all for the helpful comments. I agree with several posters
    that a Wiki would be a good way to let various people contribute. I
    don't have any experience setting them up and I'd appreciate it if
    someone could help set one up.

    When I get some time I'll update my document the best I can. It won't
    please everyone but I want to at least be accurate in the things I
    say.

    I didn't know about extended 8051's with multiple DPTRs. That sounds
    interesting indeed. I don't think Silabs has that, though. I really
    haven't looked much at 8051's and I mostly included info on them
    because they are perhaps the best known MCU family. I'll try to paint
    them in a more accurate light. One odd thing is that many 8051
    variants still don't support internal debugging (breakpoints, single-
    step, etc). Silabs has their C2 debugger and I guess something like
    that is integrated on their USB stick. I guess the Intel 80251 died in
    the marketplace. What ever happened to the Philips XA - is that still
    around and still being updated?

    I'm also very excited about the STM32 and I will add more info about
    them. They now have a number of DEV kits, including that extremely
    cool little game with the color LCD and MEMS. At the price they're
    charging for it, it's almost free and it has an internal JTAG USB
    solution.

    Regarding the R8/M16, I have to say that I'm not the right one to
    comment about them. I have noticied them, and their recent attempts to
    actively market them. I'm sure they are fine devices and they have a
    lot of variants available. Again, this is why a Wiki would be good.
    I'd love to contribute what I can, but there's a lot of good stuff out
    there that I don't know about.

    I still see a need for 2 separate topics: one on the general features
    of the families, and another that talks about hardware and software
    tools. Or maybe the tools should be broken out so we cover hardware
    and software separately?

    Walter - I always appreciate your posts because you are a brilliant
    man and you're one of the best propeller heads I know (in the most
    positive sense). In all honesty, you can make anything sound simple,
    but those of us less fortunate in the gray matter department can't
    keep up with you. With my limited skillset, I can say that it would be
    almost impossible for me to write a code generator for the RS08.
    That's why you're worth every penny you make. I stand by my claims
    that the RS08 is not really suitable for low volume work, though. If a
    company already has the tools then it might indeed make sense to use
    it in low volume applications. But the cost of tooling for something
    that limited in reach is hard to mitigate.

    I'm not against commercial software tools. My paper is aimed at
    students and newbies and they need low-cost tools. Eval versions of
    compilers make sense in some cases, especially if they don't expire
    and their limits are reasonable. Two kinds of limited toolsets have
    recently surfaced that make a lot of sense: one is tethered to a
    specific dev board, usually through some kind of serial number on the
    board. The reasoning here is that I can't use that compiler anywhere
    except with that one board, so it can be cheap. The other kind of
    limitation is something like a student license. It can display a
    notice every time it starts up saying that it's only for use in a non-
    commerical setting. You might think there'd be a lot of cheating with
    that, but I disagree. Companies are very sensitive to being sued and
    they often have consultants and outsiders visit them. I think very few
    companies would cheat by using tools designated as non-commercial.

    For the record, I use IAR with the msp430, and Keil with the Arm. But
    I use gcc with the AVR and 9s12, and sometimes with the Arm and
    msp430.

    Eric
     
    Eric, Nov 6, 2007
    #19
  20. All 80C561's also allow PDATA or MOVX @ Ri access, so for an extra
    256 bytes of DATA in XDATA space can be added 'almost for free', without
    using DPTR.

    That's true, it is the most widely sourced core on the planet.
    On new ones, that's pretty universal :

    Atmel's AT89C51RE2 has OCD, as do the new AT89LPxx series

    Winbonds' W89E series also have OCD

    Infineion XC8xx also has OCD, and a USB Key evaluation with
    THREE family members on it.
    Neither are candidates for new designs. Both rolled out in OTP, (and
    small OTP, at that ) right when the market started moving to FLASH, and
    neither hit critical mass. These also give a lesson in the importance of
    Binary Compatible, and how a vendors assurance of "just recompile" goes
    down like a lead-balloon in the real world.

    That one is a good example, of the importance of
    Low Cost Eval/Debug access.

    The PIC32 may yet be similar, as Microchip are talking about screen
    PICtails plug in cards.
    Cost of tooling ?! - is ~$40 hard to mitigate :)

    http://www.freescale.com/files/microcontrollers/doc/fact_sheet/USBSPYDER08FS.pdf

    For this you get a Free C Compiler, USB debug, and RS08 and HC08 support
    (If you get serious, you can Buy Walters Compiler..:) )


    There are thousands of RS08 on the shelf in catalogue companies, in DIP8.

    To me that all adds up to VERY student accessible, and a simple core is
    not a bad place to start learning how these things actually work.

    Would you really want to throw over 10 Megabytes of manuals, at a novice
    student ?


    At the Student end of the scale, the focus has moved partly from Chips,
    to Modules & Debug Access - see the TI and Silabs latest low-cost
    solutions of a 'dock-able' USB debug, and Freescale's, Infineon's and
    ST's USB sticks (etc).

    Also all the small devices on Student's radar, usually have FREE Tools.

    Freescale IIRC are up to 128K free on the ColdFire C1, and all the 908
    and RS08 tools are free.

    The new PIC32 goes to 64K, and most cores have some form of open source
    compiler, that may not be the tightest code, but does work.

    Zilog have free, and unlmited tools (they bought a compiler company)
    Zilog also have a opto isolated USB debug, good for power development
    work. Zilog also have good simulators.

    Then there is the Propellor chip -
    http://www.parallax.com/propeller/media.asp

    -jg
     
    Jim Granville, Nov 6, 2007
    #20
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.