Go here to sign up for The Embedded Muse.
The Embedded Muse Logo The Embedded Muse
Issue Number 411, December 7, 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

Tip for sending me email: My email filters are super aggressive. If you include the phrase "embedded muse" in the subject line your email will wend its weighty way to me.

Are you comfortable designing with FPGAs? I think this is a skill that is going to be highly marketable. This article shows these parts are becoming much more common. One note: C programmers may find Verilog or VHDL a little odd. Unlike C code, where each statement executes in succession, in general in an HDL everything is running at the same time. In fact, it often doesn't matter which order the HDL statements are coded.

Quotes and Thoughts

We're absolutely going to deliver on time on this project. We were too overconfident on the last one.

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.

Mark Rubin has what looks like a handy utility:

https://github.com/thanks4opensource/regbits
regbits: C++ templates for type-safe bit manipulation. regbits is a C++ template library for type-safe manipulation of bits in microcontroller peripheral registers. Compiled executable object code equals or outperforms traditional techniques in terms of size and speed, and complexity of header files describing peripheral/register layout is comparable.

"Regbits" is an attempt to leverage C++'s more rigorous type-checking (as compared to C) without including religious C++ object-oriented "design pattern" methodologies and their associated runtime penalties (although such approaches are often appropriate, particularly in larger systems). At times I've seen what I'm doing called "using C++ as a better C".

As a particularly egregious illustration of what "regbits" addresses (using one of its implementations, https://github.com/thanks4opensource/regbits_stm), consider selecting the high speed internal oscillator as a STM32F103's clock output using the CMSIS header file provided by ST Microelectronics. The code required is:

RCC->CFGR = (RCC_CFGR & ~RCC_CFGR_MCO_Msk) | (RCC_CFGR_MCO_0 | RCC_CFGR_MCO_2);

compared to "regbits":

rcc->cfgr.ins(Rcc::Cfgr::MCO_HSI);

Note that not only is the explicit bit-masking eliminated (which could be accomplished via C macros), but that a meaningful name replaces the raw bit definitions.

More importantly, a compile-time error will result if, for instance, a different register's constant such as Rcc::Cr::HSION is mistakenly used.

Bob Paddock sent this link to the definitive computer industry glossary of terms.

Phil Koopman, noted Carnegie Mellon professor, has made his embedded software course material available online. The course covers software quality, safety, and security. For those who don't do YouTube, videos and handouts are here as well.

David Thomas posed an interesting question: Does anyone have tips on keeping a workbench reasonably tidy? I find that it's not long before scope probes and other leads are snaking all over the bench, tools scattered around, and components piled up. Much as I admired the man, I try to avoid a Jim Williams' like bench:

Jim Williams workbench - what a mess!

Freebies and Discounts

Murdo McLeod won the BattLab-One tool in last month's contest.

This month's giveaway is a Pico 2207B 70 MHz USB scope, which I review later in this Muse.

Pico 2207B - giveaway!

Enter via this link.

A Buck50 Logic Analyzer

Need a logic analyzer but Covid has depleted your cash reserves? Can you shell out $1.50?

Mark Rubin has created the "buck50" logic analyzer which has a UI that runs under Linux/Unix and maybe (this is untested) a Mac.

This isn't a product that he sells. It's completely open source. Source code and documents are here. And it is extremely well documented.

The hardware is just a "Blue Pill" STM32F103 eval board, widely available for a dollar-fifty. You buy the board, download the firmware, and install the application. You'll want to solder a header to the board for test probes.

$1.50 logic analyzer

Features include:

  • 8 channel, 6+ MHz logic analyzer
    • Approx. 5K sample buffer depth
    • Samples stored only at signal edges for efficient memory usage
    • Units may be ganged for increased number of channels
    • Complex triggering via user-defined state machine supporting combinations of sequential ("A then B then C") and logical-OR ("A or B or C") conditionals
    • Output to VCD and other file formats for export to waveform viewing software
  • Live monitoring and logging of digital, analog, USART (sync/async), SPI (MOSI/MISO), and I2C (master/slave/TX/RX) data
  • Simple dual-channel approx. 1 MHz digital storage oscilloscope, approx. 5K sample buffer depth (10K if single channel)
  • 3 channel digital pulse train generator with user-defined frequency and per-channel duty cycle and polarity
  • Bidirectional bridge/converter from USART/UART (async/synchro), SPI (master/slave), or I2C ... to USB ... to host terminal, UNIX socket, or UNIX pty device file
  • 8-bit parallel output counter (binary or gray code)
  • Host terminal ASCII or binary input data to 8-bit parallel output
  • Firmware written in a combination of C++ and ARM Thumb-2 assembly code, with several non-standard hacks^H^H^H^H^Htechniques of possible general interest to advanced software developers
  • Python host driver program with comprehensive inline help system and usability features

As Mark says: "At $1.50 for the hardware plus $0.00 for the firmware and software, if there's a competition for the world's cheapest logic analyzer I want to enter it. Please note this is very much a beta release and bug reports are welcome."

Way cool!

Pico 2207B USB Scope Review

Pico Technology is one of the pioneers in USB oscilloscopes. They sell a huge range of test instruments and related gear; their website, though frustratingly slow, is worth perusing. The company sent me their 2207B MSO, a 2 channel 70 MHz scope with a 64 MS buffer, and 1 GHz sample rate. It collects 80,000 waveforms per second.

Though I tested this using their Windows application, they have beta versions for Linux and Macs.

The unit comes nicely boxed with an excellent full color poster showing the UI, with annotations describing how each element works. It's too big to reproduce here but I commend Pico for this "lagniappe" (a Louisiana term meaning a bonus gift). Also included is a soft carrying case, two scope probes, and digital logic probes. A quick start guide is included, but you'll want to download the 239 page user manual from their web site.

If you didn't know anything about the company, you'd quickly infer that they've been in the scope business for some time. The manual, in PDF form and a help file, is extensive and very complete. And the scope simply works. There's no fiddling with USB setups. No connection hiccups.

Pico 2207B UI

Pico UI. Click on image for a bigger version.

The UI is complete and totally intuitive. Channel control, horizontal and vertical, is on the top ribbon. Triggering and measurements on the bottom. Channel A is in blue; on the left side of the screen the voltage levels are shown. Channel B's voltages, in red, are on the right.

I've added an arrow to show the trigger position, denoted by a yellow dot. You can change this by simply dragging that dot to any position on the waveform.
Trigger is extensive and the display is super-intuitive. Here are the options:

Pico 2207B triggering

In the previous picture I added peak-to-peak and frequency measurements, which are shown on the bottom of the screen. I counted 19 of these which include two kinds of RMS and pulse counts. But those tiny numbers sure are hard to see, aren't they? The UI, though, allows one to select any font size for these. For instance:

Pico 2207B measurements

As is common on digital scopes, there's a zoom feature to narrow which part of the buffer is shown. Unusually, a "picture in a picture" shows a really nice image of where in the buffer the zoomed display is presented. It's easy to grab the cursor in that small image to drag the zoomed display around.

Pico 2207B zoom

I was disappointed that you can only select vertical and horizontal ranges using the usual 1-2-5 sequence until discovering that the channel selection button lets you type any range. And in that menu for the vertical signals there's a bandwidth limit option, which is also freely selectable - you're not limited to a few canned bandwidths.

The spectrum analyzer mode gives a remarkably accurate and clear display. The following shows a quite pure 10 MHz sine wave. Note the frequency labels below the waveform. Though at the far bottom left the scale is shown in kHz, I would prefer that the axis be labeled. Instead of the bland "1000" shown, it would be better to show "1000 kHz".

Pico 2207B FFT

23 serial protocol decoders are included, and each can be set up using either the analog or digital channels. Also supported: mask testing, where one defines a "legal" waveform and an alarm or trigger occurs when the sampled wave falls out of the legal range.

Like most scopes, the Pico will do math. For instance, one can display a waveform that represents A+B. Unlike most, you can create your own equations. This is one example:

Pico 2207B math

Not long ago I asked Siglent to add this feature to their scopes, which they did. I had been working on a system with rotating components. My report had screen shots showing RPM indirectly, as a frequency measurement. How much better to show actual RPM!

The model tested has 16 digital channels. These are arranged in two groups, and the threshold voltages can be set to any value for each group.

Finally, the unit includes an arbitrary waveform generator that will produce the usual signals up to 1 MHz with 12 bits of resolution. Nothing ground-breaking there. Want a custom wave? A single click brings up a waveform editor which lets you create anything. This is the easiest-to-use waveform creator I've come across... and it's downright fun to use. The following took about three seconds to build:

Pico 2207B awg

The 2000 series of PicoScopes, of which this unit is a member, ranges from 10 MHz, 2 analog channels, 100 MS/S sample rate and no digital channels for $139, to 100 MHz, 4 analog, 128 MS memory for $1125. The unit I tested sells for $769. More info here.

Bottom line: This is the best USB scope I've tested.

Failure of the Week

From Martin Grill:

This Week's Cool Product

Want to play with AI? Google is offering their "AIY" (Artificial Intelligence Yourself) kits. Currently available are kits for playing with AI for voice and for vision. Looks like fun!

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.

TOOLS EXPLAINED

DRILL PRESS : A tall upright machine useful for suddenly snatching flat metal bar stock out of your hands so that it smacks you in the chest and flings your beer across the room, denting the freshly-painted project which you had carefully set in the corner where nothing could get to it.

WIRE WHEEL : Cleans paint off bolts and then throws them somewhere under the workbench with the speed of light. Also removes fingerprints and hard-earned calluses from fingers in about the time it takes you to say, 'Oh sh*t'

CHOP SAW : A portable cutting tool used to make studs too short.

PLIERS : Used to round off bolt heads. Sometimes used in the creation of blood-blisters.

BELT SANDER : An electric sanding tool commonly used to convert minor touch-up jobs into major refinishing jobs.

HACKSAW : One of a family of cutting tools built on the Ouija board principle... It transforms human energy into a crooked, unpredictable motion, and the more you attempt to influence its course, the more dismal your future becomes.

VISE-GRIPS : Generally used after pliers to completely round off bolt heads. If nothing else is available, they can also be used to transfer intense welding heat to the palm of your hand.

OXYACETYLENE TORCH : Used almost entirely for lighting on fire various flammable objects in your shop. Also handy for igniting the grease inside the wheel hub out of which you want to remove a bearing race.

TABLE SAW : A large stationary power tool commonly used to launch wood projectiles for testing wall integrity.

HYDRAULIC FLOOR JACK : Used for lowering an automobile to the ground after you have installed your new brake shoes, trapping the jack handle firmly under the bumper.

BAND SAW : A large stationary power saw primarily used by most shops to cut good aluminum sheet into smaller pieces that more easily fit into the trash can after you cut on the inside of the line instead of the outside edge.

TWO-TON ENGINE HOIST : A tool for testing the maximum tensile strength of everything you forgot to disconnect.

PHILLIPS SCREWDRIVER : Normally used to stab the vacuum seals under lids or for opening old-style paper-and-tin oil cans and splashing oil on your shirt; but can also be used, as the name implies, to strip out Phillips screw heads.

STRAIGHT SCREWDRIVER : A tool for opening paint cans. Sometimes used to convert common slotted screws into non-removable screws and butchering your palms.

PRY BAR : A tool used to crumple the metal surrounding that clip or bracket you needed to remove in order to replace a 50 cent part.

HOSE CUTTER : A tool used to make hoses too short.

HAMMER : Originally employed as a weapon of war, the hammer nowadays is used as a kind of divining rod to locate the most expensive parts adjacent the object we are trying to hit.

UTILITY KNIFE : Used to open and slice through the contents of cardboard cartons delivered to your front door; works particularly well on contents such as seats, vinyl records, liquids in plastic bottles, collector magazines, refund checks, and rubber or plastic parts. Especially useful for slicing work clothes, but only while in use.

ADJUSTABLE WRENCH: aka "Another hammer", aka "Crescent Wrench". Commonly used as a one size fits all wrench, usually results in rounding off nut heads before the use of pliers. Will randomly adjust size between bolts, resulting in busted buckles, curse words, and multiple threats to any inanimate objects within the immediate vicinity.

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.