Go here to sign up for The Embedded Muse.
The Embedded Muse Logo The Embedded Muse
Issue Number 406, September 21, 2020
Copyright 2020 The Ganssle Group

Editor: Jack Ganssle, jack@ganssle.com

   Jack Ganssle, Editor of The Embedded Muse

You may redistribute this newsletter for non-commercial purposes. For commercial use contact jack@ganssle.com. To subscribe or unsubscribe go here or drop Jack an email.

Contents
Editor's Notes

SEGGER Embedded Studio cross platform IDE

Quotes and Thoughts

The real miracle of the Wright Brothers' flight was than they accomplished it without the use of any electronics at all - Allen Puckett

Tools and Tips

Please submit clever ideas or thoughts about tools, techniques and resources you love or hate. Here are the tool reviews submitted in the past.

Carl Dreher wrote:

I'm working on a RF remote with a display.  Been looking at the PIC12LF1840T39A single-chip transmitter/mcu.  Very inexpensive, low power, etc.  I have a "joystick" switch in mind, which is five on/off switches in a single package.  The problem is, the PIC device doesn't have enough I/O for five individual switches, plus the I2C I need for the display.  That is when I stumbled across this idea:

Switches connected to ADC

The voltage at the ADC changes depending on the switch pressed.  The values shown present from 0% to 80% of VCC.  The PIC has a 10-bit ADC, so detecting the right value is easy.  Heck, you could extend this out to a dozen switches!  And if you really want to go crazy, you can detect multiple keys being pressed if you swap the 0K resistor to something like 1K.

The downside of this is that you have to poll the ADC, which consumes power.   BUT...the PIC also has a comparator input.  So if you really want to save power, just run the voltage divider into the comparator and wake up the processor when it crosses below 90%.

The PIC also has a sneaky mode you can put it in where the ADC continues to work while the chip is asleep, so you could put it in that mode, wake up when the ADC finished and go back to sleep.  Not as efficient as using the comparator, but saves a pin.

I need to tell you where I idea came from.  MicroChip has a development kit for the PIC12LF1840T39A, and the document associated with it is "Wireless Security Remote Control Development Kit User's Guide".   On page 35 is a schematic for the keyfob that comes with it, and I puzzled over it for quite awhile.  Two of the four pushbuttons on the keyfob go directly to I/O ports as expected, but two other go to one pin with a resistor divider.  That is when this occurred to me.  Wish I could claim it is my idea.  Well, maybe I can claim to have popularized it

Freebies and Discounts

September's giveaway is courtesy of Binho, and is one of their Nova Multi-Protocol USB Host Adapters with accessories.

Enter via this link.

Assembly - Dead as a Dodo?

A very long time ago, when dinosaurs still roamed the Earth, I designed a computer (using the fire-blackened end of a spear on a cave's wall.)  Still in high school, I was geekily-somewhat competent with digital circuits but knew nothing about computer architecture. But I had learned Fortran and naively assumed some parallel between that language and how computers worked. The result: a machine that would have been a complete failure, and which used a greatly subsetted and compressed form of Fortran as its native instruction set.

College gave me grade-destroying access to a Univac 1108 and I learned its assembly language. Suddenly computer architecture became crystal clear. The one-to-one mapping of machine instructions to simple logic circuits was beautiful; the stored program that substituted instructions in memory for massive amounts of hardware breathtaking.

Since then I've read many books about computer design but feel none would reveal a fundamental insight into CPU architecture without relying heavily on the essentials of assembly language. The ALU, program counter and stack pointers are dead lifeless things,  capable of nothing till animated like Frankenstein's monster with instructions stored in memory.

Assembly is both the basis of all computers and the name of a class of languages. Often used to specify a particular variant (e.g,. "8051 assembly"), it oddly doesn't even get a capitalized first letter as all other languages do. Or, did, until grammar died a horrible death at the hands of clowns sporting marketing degrees. Proper nouns like Fortran, Ada, C, and Pascal gave way to iPhone, dBASE, and eEverything. The nuns at St. Camillus would have beaten us senseless for peppering our writing with uPPeraNdLowercAse, yet today that affectation is not only common, one is relieved when at the very least the spelling is correct.

In the early days of microprocessors all programs were written in assembly. No C compilers existed for the minimal CPUs of the day and memory was so expensive and processors so slow that no one dreamed of sacrificing any form of efficiency for reduced development costs. All firmware folk were experts at at least one assembly language. Usually several.

C and IDEs were desperately-needed additions to our toolbox. Though I still think assembly is more fun than using a high-level language, C reduces development costs so much I'd never dream of cranking much assembly code anymore.

But one effect of this great gift is a new distance between engineers and the underlying hardware. That has both positive and negative consequences. On the down side I worry that a lot of us no longer have that deep insight into computer architecture. A brief review of the nature of assembly in Programming 201 hardly forces one through PC-relative versus absolute jumps, or how the Cortex M uses a link register to preserve a return address. In real-time systems interrupts reign, but their very real costs are disguised by simple C structures that hide the stacking and unstacking of the system's context.

Many people ask me how to go about becoming an embedded developer. Part of my advice is to learn - really learn - an assembly language.

Do you use much assembly anymore? Are you fond of programming at the bare metal level?

The Pint-Sized LA104 Logic Analyzer

LA104 Logic Analyzer

About a year ago I reviewed the MiniDSO, which is an iPhone-sized oscilloscope. It's pretty cool and could be a great gift for an engineer who has everything. Recently Guangzhou E-design Intelligent Technology Co., Ltd. sent me one of their LA104 logic analyzers for a review. My understanding of Chinese companies is a bit vague as they have complex interconnections, but I suspect Guangzhou manufactures both the MiniDSO and the LA104. Both are a similar size and have pretty much the same user interface.

And the LA104 logic analyzer, like it's scope brother, is a pretty cool bit of tech.

First, the specs: it's rated at 100 MHz with 100 MSa/s sample rate. It sports four input channels with 8 MB of memory, though just how that memory is apportioned isn't clear to me. I2C, SPI and UART protocol decoders are included, as are four programmable outputs. I couldn't figure out how to set up the outputs.

The UI is unusual, and is much like that on the MiniDSO. Two wheels control a menu; one advances selections left and right, the other selects from vertical submenus. OK, MENU, ESCAPE and SAMPLE buttons complete the interface. It's a little awkward at first but quickly becomes natural.

A ribbon cable plugs into the left side of the unit and forms the probes. There are nine connections: 4 inputs and ground, 4 outputs and +3V. The back of the unit has very nice labels indicating which connection is which.

Triggering seems to be pretty decent for such a tiny unit. Here's the options from the user manual:

LA104 Logic Analyzer

Here's a closeup of the screen:

LA104 Logic Analyzer

Note there are six channels displayed, yet there are only four probes. I don't know what channels 5 and 6 refer to. The solid bar across the bottom shows the entire buffer; in this case acquiring a 25 MHz square wave on channel 1. Up from that are statistics for channels 1 and 2.

Though the unit has the ability to save screens as .CSVs or .BMPs, I didn't see a way to recall them or to upload them to a PC.

The unit did not come with a manual, but you can download one from here. It's rather incomplete.

The LA104 is available from many sources, such as Seeed Studio for $89.

You can't beat the price. Me, I prefer a logic analyzer that sends data to a big PC screen. But if you're price or space-constrained, this is a pretty remarkable bit of test equipment.

This will be February's giveaway.

Taking Charge

In one of the made-for-TV pseudo-histories of the Apollo program, an astronaut figured landing on the moon would be something like flying helicopters. So he learned to fly choppers. He didn't ask permission. His boss wasn't involved. No one told him to acquire this new skill. In the every-man-for-himself astronaut office astronauts took action to fill holes in their experience.

How often do you listen to a developer whine about his dead-end job? How many of us wind up in dead-end jobs because we refuse to gather new skills and experiences?

Back in the old days, paternal corporations benevolently managed their employees' careers. You could leave college and work for IBM till you retired. They'd take care of you. Need a new skill? Your boss would identify the weakness and schedule some sort of training.

No more. In these troubled times companies are worried about their own survival. Cost-cutting and squeezing out a profit is all that matters. Get the product out the door today no matter what the personal cost may be. Joe is still struggling with C++? Replace the SOB! There's an army of applicants knocking at the door. The company has neither the time nor the incentive to engage in training and career management.

I believe it's our personal responsibility to upgrade our skills… constantly. Relentlessly. Technology changes so fast, and even the first derivative of that change is accelerating. Too many developers stop learning when they leave college. Do that, and your career will end in your twenties. Companies will use your skills as long as they are still relevant and then spit you out, a burned-out husk obsolete at 30.

It's up to you, and to no one else, to learn new things, to become more productive, and to embrace the new technologies that will influence your career. There's a wealth of resources available, from books to magazines, and websites. Some colleges have put their classes on-line, free of charge.

No doubt the astronauts have an incredible amount of personal freedom in their jobs, as well as a budget we can only dream of. They are all dynamic personalities who look at a problem, figure what resources might be needed, and immediately take action. That sounds like a great description of the engineering method.

Take action. Learn. Grow. Become expert at something new. Stasis in this industry is death. Especially now, when jobs are scarce and layoffs all too common.

Failure of the Week

From Glenn Hamblin:

Embedded failure of the week

This Week's Cool Product

RADAR has traditionally been an expensive sort of sensor, but that is changing. An interesting article (written by TI) enumerates a number of cool scenarios where low-cost RADAR can be useful. The focus is TI's IWR6843, a 60 GHz RADAR on a chip (just add a power supply and antenna). It includes three transmitters and four receivers so can support beam forming. In singles it's about $30, falling to $22 in 500 lots.

RADAR on a chip

Note: This section is about something I personally find cool, interesting or important and want to pass along to readers. It is not influenced by vendors.

Jobs!

Let me know if you’re hiring embedded engineers. No recruiters please, and I reserve the right to edit ads to fit the format and intent of this newsletter. Please keep it to 100 words. There is no charge for a job ad.

Joke For The Week

These jokes are archived here.

All programmers are playwrights and all computers are lousy actors.

About The Embedded Muse

The Embedded Muse is Jack Ganssle's newsletter. Send complaints, comments, and contributions to me at jack@ganssle.com.

The Embedded Muse is supported by The Ganssle Group, whose mission is to help embedded folks get better products to market faster.