$1 MCU review — looking for AVR part suggestions

Go To Last Post
179 posts / 0 new

Pages

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

Paulvdh wrote:

Some time ago I dipped a part of my littlest pinky toe in the ARM world. (STM32F103C8T6)

It's a 32 bit processor but the I/O structure (timers, etc) is apparently mostly 16 bit.

That's one of my pet peeves with some ARMs. I cannot see the sense in a 32b MCU, with 16b Timers ?

Some 8b MCUs even allow Timer cascade to 32b, such is the demand for the better dynamic range/precision.

 

NXP 'gets this' & have (IIRC) 32b timers and 32b prescalers, and Nuvoton are close, with 24b timers.

 

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

Paulvdh wrote:

Ah, so that is the "steering" part.

Triggers a memory about a story floating on (or sunk deep into) the 'net.

It was about a uC occasionallly losing bits in it's I/O configuration registers. The whole uC (or FPGA?) kept running happily, just some outputs stopped outputting the right signals untill the uC got a hardware reset. Then it worked all perfectly for a while, so no hardware pins blown, but the problem kept recurring.

The likely culprit was probably marginal decoupling / emc design, whatever but investigating and PCB revisions take time.

 

So as a (temporary) solution they put the whole I/O configuration in flash and used a periodic interrupt to rewrite it to the I/O ports.

That's more common than you realize, and is somewhat standard ESD hardening. Always a good idea to 'refresh the config', where practical.

 

Worse was the part where we found Reset was more of a 'Reset Request', and it could disable under ESD stress tests - outcome was a Power Removal watchdog design, that I'm surprised is not seen much.

 

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

In case anyone was wondering if I ever got around to finishing this write-up, the answer is "Yes! Finally!"

 

Check out The Amazing $1 Microcontroller on my blog.

 

It took several months of on- and off-again work, but I got through all 21 parts I selected.

 

I'd like to thank everyone on this thread for their help --- I got steered in the right direction toward the new tinyAVR 1-Series (which pulled in some impressive performance), and I also got some suggestions for other parts that ended up getting included, too.

 

If there are things you think need to be mentioned that I'm forgetting, please drop a line on this thread (or, shamelessly plugging my blog, as a comment on this post smiley)

 

Thanks again for the wonderful discussions!

Last Edited: Mon. Nov 6, 2017 - 07:12 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow ... and that's from only a skim.

Plan is to put a comment onto that web page "soon"

Thanks for the follow-up.

 

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

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

Jay, a stunning roundup of the chips and the oft ignored tools. This must have taken you some time. I'm glad you investigated some of the more obscure parts that, whilst I'd heard of, have never really appeared on my radar.

 

A couple of comments - the PIC16 series aren't RISC - they are accumulator based, not single cycle and not load/store. Microchip grabbed the moniker and repurposed it for their own ends.
One thing I found missing was the voltage range of the various devices - the M051 and XMC1100 for example are 5 volt parts which for ARM ('arm') based parts sorta sets them apart.

 

As for using Arduino shields, I have used the prototype ones ( the ones with lots of holes) to build up some test hardware for the XMC1100 and STM32 parts. I've even used used one with a small solderless breadboard on top for some quick prototyping.

 

Great work.

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

Kartman wrote:

the PIC16 series aren't RISC - they are accumulator based, not single cycle and not load/store. Microchip grabbed the moniker and repurposed it for their own ends.

Thanks for the comment --- RISC is a loaded term (as you can imagine), so I've added additional clarity to explain that while it is RISC in the sense that each instruction is precisely one word long and executes in a single cycle (unlike CISC parts like the 8051), it is *also* an accumulator-based architecture, which is quite different than most RISC parts. I hope you think this change makes the information more useful.

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

Just thought I'd let you know: Your navigation pane does not behave well on smallish screens. The bottom of it is off the screen and it is not scroll'able. Only if I zoom out to about 70% can I see the whole navigation pane. At 100% the last visible entry is "Dev Tools".

 

Chromium Version 59.0.3071.109 , display is 1366 x 768.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

JohanEkdahl wrote:

Just thought I'd let you know: Your navigation pane does not behave well on smallish screens. The bottom of it is off the screen and it is not scroll'able. Only if I zoom out to about 70% can I see the whole navigation pane. At 100% the last visible entry is "Dev Tools".

Good call — I will fix this as soon as traffic calms down (I can't even get a login page).

 

EDIT: No quick fix, other than removing content, unfortunately. I'll look at some core CSS changes I can make long-term to shrink that down, but there's a lot of dependencies I'll have to work through. Sorry about the inconvenience!

 

By the way, for people who tried visiting earlier and got 503'd, I've made some changes to my network configuration, and I think the site should be back up for most users.

 

I'll save you the scrolling: https://jaycarlson.net/microcont...

Last Edited: Mon. Nov 6, 2017 - 11:15 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is a superb reviewyes. Thanks for keeping us posted.

 

It's amazing what you get for < $1 these days.

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

I will say one error in the notes is that the AVR have a flat ISR, the new tiny's (tiny1616 was the one you picked), have a two level.

 

Now since it a relativ new chip I'm not sure if the Compiler support it.

 

And then it's not clear when you run 10MHz and when 20MHz on the AVR, (And find it a bit funny that you have to trick your 5V device to run 3.3V :D )

 

I don'e see that you have a 3v3 volt rule.

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

https://jaycarlson.net/microcont...

Comments

 

AVR
1. "And interrupts are one of the weak points of the AVR core: there’s only one interrupt priority, ..."
   tinyAVR 1-series has two interrupt priority levels (datasheet, CPUINT)
2. like megaAVR, tinyAVR 1-series is Harvard architecture but with unified memory (datasheet, Memories, Memory Map)
3. tinyAVR 1-series UPDI is more capable than megaAVR debugWIRE

 

Parametric Reach
megaAVR
XMEGA AVR are a follow-on to some megaAVR.
--
ATmega2561   - 16MHz, 64 pins, 256KB,  8KB
ATxmega384C3 - 32MHz, 64 pins, 384KB, 32KB
--
ATmega1280    - 16MHz, 100 pins, 128KB, 8KB + 56KB on EBI
ATxmega128A1U - 32MHz, 100 pins, 128KB, 8KB + 16MB on EBI

 

Atmel Studio
"The excellent IntelliSense engine that Microsoft spent years perfecting has been replaced by some sort of Atmel-proprietary “Visual Assist” technology that ..."
1. IntelliSense and AVR is available from third party(ies)
2. Visual Assist from Whole Tomato Software

 

Microchip Customizations
"As these compilers [XC] are quite expensive and ..."
About 1USD/day though the dongle is 1495USD

 

Discussion
megaAVR
"While the megaAVR has a perplexing debugging experience that requires two completely different interfaces and protocols to work with the part, ..."
fyi, once debugWIRE is enabled then stay with it until done.
"... low-cost, open-source programmers (which don’t support the UPDI interface)."
pyupdi is Python UPDI programming via an inexpensive USB UART; debug via UPDI is currently only Atmel-ICE or Power Debugger

PIC32
"... expensive compilers ..."
Can chipKIT PIC32 GCC be invoked from MPLAB X?

 

Thank you!

 

------------------------------------
Notes
1. IntelliSense with most AVR is available from VisualGDB
2. IntelliSense is in Visual Studio Code and AVR might be available via the Native Debug extension
3. The next release of PlatformIO may restore AVR debugging; Visual Studio(s) are some of the IDE that integrate PlatformIO
4. LLVM AVR may be a current or future alternate to AVR GCC
5. ATmega328PB is approaching 1USD each for 100 though it has a supply and demand problem that's easing 17Q4 (should be resolved 18Q1)
6. 32KB tinyAVR 1-series is likely for '18 and probably under the price limit

Ref.
VisualGDB, https://visualgdb.com/tutorials/...
Visual Studio Code, https://code.visualstudio.com/
Native Debug, https://marketplace.visualstudio...
PlatformIO, AVR, http://platformio.org/platforms/...
PlatformIO for Visual Studio Code, https://marketplace.visualstudio...
Whole Tomato Software, https://www.wholetomato.com/defa...
XC8 PRO subscription, http://www.microchip.com/Develop...
Featured MPLAB XC Compiler Licenses, http://new.microchipdirect.com/p...
LLVM, Changes to the AVR Target, http://releases.llvm.org/5.0.0/d...
Python UPDI driver for programming "new" tinyAVR devices, https://github.com/mraardvark/py...
chipKIT, http://chipkit.net/

 

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

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

Wow! That's a very impressive write-up.

 

There seems to be an inconsistency between the chart and your writing.

 

You wrote:

 

Unfortunately, the STC8 simply does not care about power consumption — so it barrels along at 1.62 mA (still not the worst part in this round-up — not by a long shot).

 

However, the chart shows that the STC8 consumed 5470 microamps in your test. It was the STM8 that consumed 1620 microamps (1.62 mA).

 

There's also a few typos, such as "sense" in the sentence "but has sense expanded" (should be "since") and "faired" (should be "fared").

 

Besides those, I didn't see any other issues.

 

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

"And interrupts are one of the weak points of the AVR core: there’s only one interrupt priority, ..."

 All things considered, I much prefer the AVR "one priority but lots of vectors (separate vectors for uart rx and tx, even!)" over something like the PIC "two priorities = two vectors" scheme.  Or even the 68k "7 priorities with one vector per priority."

 

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

I see that Jack Ganssle has linked to the survey in his latest newsletter...

 

Quote:

Many readers sent this link, which explores 21 different microcontrollers, pondering the strengths and weaknesses of each. Some vendors will not be pleased...

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

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

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

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

McuOnEclipse has also linked to it.

https://mcuoneclipse.com/

 

Four legs good, two legs bad, three legs stable.

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

Just saw an announcement, yesterday (Nov 21, 2017) for a 0.25 USD MSP430. Did not note details except  that one of the proposed uses is an RS-232 to RS-232 "bridge". 

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

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

ka7ehk wrote:
an RS-232 to RS-232 "bridge". 

commonly known as a "piece of wire" ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just saw an announcement, yesterday (Nov 21, 2017) for a 0.25 USD MSP430. Did not note details

 

It's a chip with 0.5kB of FRAM program memory, and ... more peripherals and RAM (also 512b) than you'd expect to see on a chip with that little memory.  (Essentially, I guess you get to get to do a "little bit of stuff" with "your choice" of one or two peripherals.)  An interesting strategy?  (Also, TI seems to be following through with their "FRAM is the way" opinions.  Also interesting.)  256 instructions is ... not much.

 

 

proposed uses is an RS-232 to RS-232 "bridge". 

Really?  I only one serial thing ("eUSCI")...

 

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

Electronic Design

Electronic Design

25 Functions in a 25-Cent Micro

Texas Instruments’ value-line MSP430 16-bit micro costs only 25 cents and comes with 25 preconfigured apps.

by William Wong

Nov 20, 2017

http://www.electronicdesign.com/embedded-revolution/25-functions-25-cent-micro

...

1. The MSP430FR2100 is the top end of the family. It adds the 8-channel, 10-bit SAR ADC with 1.5-V reference and temperature sensor.

...

https://www.mouser.com/Search/Refine.aspx?Keyword=MSP430FR2100

 

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

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

MSP430FR2100 

 The new chips are the FR20xx, even smaller and cheaper than the 21xx series.  Alas, like many of the chips advertised as meeting a particular price point, the "small quantity" price isn't that great.  Lots of chips are similarly priced, including a bunch of the new AVRtinys.

 

 

>> RS-232 to RS-232 "bridge". 

Really?  I only one serial thing ("eUSCI")...

Ahh.  one hardware UART, one SW uart using timer interrupts.  "half dupex."

The "25 functions" is apparently a set of build-able, app-notes with downloadable code, designed to be "easily customizable."  They have a fancy "flipbook" in annoying format (heh.  Rather like the old Microchip "tips&Tricks"?)

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

jaycarlson wrote:
... EFM8UB1 ...
EFM8UB3 is a new arrival at Mouser at 0.98USD each for 100.

Mouser Electronics

Silicon Labs EFM8 8-Bit MCUs

EFM8UB tab

https://www.mouser.com/new/Silicon-Laboratories/silabs-efm8-mcus/#tabs-4

...

Now Available: Silicon Labs EFM8UB3 Universal Bee 8-bit Microcontroller offers an innovative energy-smart USB peripheral interface, ideal for USB Type-C applications.

...

 

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

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

Jay selected an MCU in the context of education of embedded system designers.

How I Teach Embedded Systems - Jay Carlson

July 26, 2019

(mid-page)

REVISING THE LAB KITS

[next section]

 

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

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

I selected the PIC16F18446 + MPLAB Snap debugger.

Wow.  Paraphrasing: "Arduino makes things too easy and obscures what I'm trying to teach, but most modern chips are too complicated (especially the initialization that has to be done before you start.)"  He does an OK job justifying his choice, but it's such a "legacy" architecture...

 

Other MCUs often don’t have dev environments for macOS or Linux. [and the school doesn't require students to have PCs.]

That's sort-of fair.   I wonder if another year will improve AVR's standing (also supported by MPLAB-X these days.  Almost.)  And PlatformIO/VSCode is all free...

 

I tend to believe that a microcontroller class should introduce a second, different CPU architecture.   Because "compare and contrast" teaches you a lot.

 

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

westfw wrote:

I tend to believe that a microcontroller class should introduce a second, different CPU architecture.   Because "compare and contrast" teaches you a lot.

 

I strongly agree, and an "opposite extreme" architecture, to the extent possible.

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

westfw wrote:
... but it's such a "legacy" architecture...
Some problems are I/O bound, memory bound, or power bound instead of compute bound.

Microchip's PIC team continued on to add DMA and such; Microchip's compiler team added the second stack for some PIC and bumped up (Clang and C99 in MPLAB XC8 v2 for PIC)

PIC32 in one other curricula though not an equivalent to Jay's course plans (long live MIPS, another legacy that has improved in 34 years)

westfw wrote:
...  Almost.)
IIRC, MPLAB X v5.25 is imminent though may take awhile for the ones at Microchip to verify each AVR.

westfw wrote:
And PlatformIO/VSCode is all free...
PlatformIO's (primary) AVR debugger issue is pending though don't know when it'll be solved.

Microsoft Visual Studio Code has GDB and EDBG by extensions.

westfw wrote:
I tend to believe that a microcontroller class should introduce a second, different CPU architecture.
My experience is yes for mid-80s, no for mid-90s.

How much weight in one's rucksack?  (maybe 140 semester-hours on an undergraduate's ECE degree plan)

westfw wrote:
Because "compare and contrast" teaches you a lot.
That's my experience in a computer architecture course though was one architecture (MIPS) for labs and such.

Arm recently re-adjusted some of their licenses (models, price, IIRC the royalty is effective on exceeding a volume limit)

Near a stew (Arm, MIPS Open, RISC-V)

 


PIC16F18446 - 8-bit Microcontrollers

5 tubes of PDIP, of 22 each, has a total price of 151USD from MicrochipDIRECT.

 

PIC18F24K42 - 8-bit Microcontrollers

7 tubes of PDIP (15 each) is 154USD.

 

PIC18F45K42 - 8-bit Microcontrollers (in 40 pin PDIP)

10 tubes of PDIP-40 (10 each) is 178USD.

 

ECE 4760 (Cornell University, Electrical and Computer Engineering)

New PIC32CX and PIC32CZ? | AVR Freaks

Packages | Atmel AVR · Platforms · PlatformIO

PIO Unified Debugger for AVR · Issue #95 · platformio/platform-atmelavr · GitHub

Debug probe support for atmel-ice / dragon and atmega328p processor · Issue #53 · platformio/platform-atmelavr · GitHub (AVaRICE)

Packages | Microchip PIC32 · Platforms · PlatformIO

https://www.avrfreaks.net/forum/avr-studio-mac-linux#comment-1848031 (Microsoft Visual Studio Code, GDB, further for EDBG)

Arm reveals new licensing strategy as RISC-V makes waves

https://www.microchipdirect.com/product/ATMEGA4809?keywords=atmega4809-PF (184USD for 10 tubes of PDIP-40 at 10 each)

 

edit :

Release 1.15.0 · platformio/platform-atmelavr · GitHub

New boards: ...

ATmega1284P — PlatformIO 4.0.1b3 documentation

mega1284 in PDIP-40 is popular.

 

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

Last Edited: Sat. Jul 27, 2019 - 05:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

>> I tend to believe that a microcontroller class should introduce a second, different CPU architecture.

My experience is yes for mid-80s, no for mid-90s.

 

Ah.  I misspoke, slightly.  In the mid-80s I would have compared "cpus."   Now, I'd compare microcontrollers more at the chip level: "we've studied the PIC16 for a while, now let's see what a PIC32 looks like.  Look at the huge address space!  Look how they've used that to allow LOTS of registers for the peripherals!  Look how everything is treated as memory."  Any 8bit CPU vs any 32bit CPU should be "interesting."  (well, perhaps not x86 or those Renesas super-Z80s.)

 

 

[only] 140 semester-hours [in a class]

I dunno.  My (late 70s) Assembly Language class was mostly IBM360, but spent a short time on the PDP11 (2 weeks of a semester-long class?  One assignment, using a simulator, looking at the results in memory).  I think it was still useful...

 

The UTexas Online Microcontroller class bypassed the initialization complexity (of TI Tiva ARM CM3) by using instructor-provided initialization code and "starter projects."  That worked OK, I think.  We never did learn how to set up a project from scratch.  (and they used Keil - Windows Only...)

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

westfw wrote:
... or those Renesas super-Z80s.)
fyi, there's a Renesas instance of IAR EWARM though it's not a match for Jay's course criteria (IAR EW is Windows only)

Am aware of Zilog (Littelfuse) for super-Z80 though am unaware of Renesas super-Z80.

westfw wrote:
 My (late 70s) Assembly Language class was mostly IBM360, ...
Likewise early 80s

westfw wrote:
... but spent a short time on the PDP11
Didn't work some on a DEC PDP-11/34 until early 80s though more so mid-80s.

Project's systems engineer said could replace the rack mount "old" PDP-11 with that new IBM PC/AT; nowadays it's Intel NUC form PC on a DIN-rail within the small cabinet that one rolls around.

westfw wrote:
The UTexas Online Microcontroller class bypassed the initialization complexity (of TI Tiva ARM CM3) ...
a guess at the URL

Embedded Systems - Shape The World (University of Texas at Austin, ECE, Jonathan W. Valvano)

 


IAR Embedded Workbench® for Renesas Synergy™ via The Embedded Muse 365 | This Week's Cool Product

 

edit :

YSTBS5D5E10 Development Kit - Renesas | Mouser

 

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

Last Edited: Sat. Jul 27, 2019 - 09:31 PM

Pages