Youtube category

Know your Tool – Optimize C Code for microcontrollers

One of the talks in the “Embedded Linux Conference 2016” was about best practices to optimize C for microcontrollers. This talk deserves to be mentioned to Electronics-lab readers.

The presenter Khem Raj worked on Comcast’s (broadcasting and cable television company) reference design kit for STB, Gateway and IoT platforms.

We will cover some important points that have been suggested by the presenter:

Optimization Levels

Optimization in compilers in general (GCC is the one in Khem’s case) has different levels (5 Levels: Os, O1, O2, O3 and Og). Os is for size optimization while O1, O2 and O3 are for performance.

Optimization Levels - From Khem’s slides
Optimization Levels – From Khem’s slides

Linker

Linker which is an important tool in microcontrollers’ software toolchain, is mentioned in Khem’s talk.

Linker script is written in the linker command language and controls the memory layout of the output file (what goes where). Moreover, Linker can output a map file which is very useful when you want to track down references to symbols in the MCU memory.

Linker Script File - From Khem’s slides
Linker Script File – From Khem’s slides

Objdump

GNU GCC has a collection of binary tools; they are called (binutils); and objdump is one of them. It interleaves your assembly code with source code so you can do disassembling using it.

Variables

Talking about best practices with variables. If the concept of local, global, volatile, const and static are blurred for you, then watching this presentation will clarify them besides other important terms.

Khem also mentioned special integer types in C99; they are “fast” and “least” types. So you can allocate your variable like that:

  • Fixed width unsigned 8 bit integer uint8_t
  • Minimum width unsigned 8 bit integer uint_least8_t
  • Fastest minimum width unsigned 8 bit integer uint_fast8_t

To ensure portability of your code, Khem advised to use portable datatypes using uint{8,16,32,64}_t type declaration. This avoids effects of changing size of int type across different processors (compilers).

Using global and local variables is another concern. Khem advised to use local variable as much as possible. Global variable needs to be loaded from memory and stored back every time it is used. So if you use a global variable in a loop you will have multiple loading and storing operations.

Khem’s presentation has other tips about: array subscript Vs. pointer access, loop increments Vs. loop decrements and other stuff. Make sure to watch the presentation, all of it!
Slides

Siglent SSA3032X Spectrum Analyzer Review & Experiments

Afroman reviews Siglent’s SSA3000X series spectrum analyzer and all the options. There is some RF information for beginners and usage experiments are also performed.

Siglent SSA3032X Spectrum Analyzer Review & Experiments [Link]

How Do NASA’s Apollo Computers Stack Up to an iPhone?


By David Grossman @ popularmechanics.com:

How Do NASA’s Apollo Computers Stack Up to an iPhone? – [Link]

Teardown and review of the new MHS5200A

Craig writes:

I’ve gotten a lot of questions on the blog about the new version of the MHS5200A function generators available on eBay. Viewer Tolga was kind enough to send one in to me to review and tear down. Although some improvements have been made over the older models, there are some concerning issues with these new models too!

Teardown and review of the new MHS5200A – [Link]

YouTube Subscriber Counter With ESP8266

by @ instructables.com:

I was inspired by the Play Button awards YouTube sends out for subscriber milestones and whipped up a simple circuit using an ESP8266 wifi board and seven segment display to show off my realtime subscriber count. This is a great IoT beginner project, with just a little soldering and a code personalization required to make it work for your own account.

YouTube Subscriber Counter With ESP8266 – [Link]

The New Arduino 101 (Genuino 101) – Unboxing, Set Up, and Comparing it to the Arduino Uno

Arduino’s newest board, the Arduino 101 is finally here… It has an Intel Curie processor, and an on-board gyroscope, accelerometer, and Bluetooth. Let’s see how it stacks up to the Uno, and find out what each of the components on the board do. At the end of the video, I go through setting it up in the Arduino IDE and run a simple sketch.

The New Arduino 101 (Genuino 101) – Unboxing, Set Up, and Comparing it to the Arduino Uno [Link]

Teardown and analysis of microwave (26.5GHz) electro-mechanical step attenuators

Teardown and analysis of microwave (26.5GHz) electro-mechanical step attenuators from The Signal Path:

In this short episode Shahriar takes a close look at a pair of Hewlett Packard microwave electro-mechanical step attenuators operating up to 26.5GHz. Mechanical attenuators offer excellent repeatability, low insertion loss and nearly limitless linearity. The teardown reveals that the construction of both modules is very similar on the microwave path. In fact, the lower-frequency model still uses the same attenuator components. The newer model employs electronic control circuity while the older generation attenuator uses purely mechanically controlled DC path. Both models use a solenoid style actuators for step attenuation control.

Teardown and analysis of microwave (26.5GHz) electro-mechanical step attenuators – [Link]

Explanation of the Components on a Raspberry Pi

In this video, Circuit Basics unbox a new Raspberry Pi B+ and show you the main components on the board. It’s a good primer to watch before you connect it to a monitor, keyboard, or router for the first time.

Explanation of the Components on a Raspberry Pi [Link]