Skip to content

Welcome to blog.mbedded.ninja!

Use the links below or the sidebar (wide screens)/menu (mobile) to navigate through the different sections of the site.

Categories

Recent Updates

August 2024 Updates

Load Dumps

Added info on TVS diodes used in automotive applications to protect against alternator “load dumps”.

Inline Imports

Converted the separate “import then Image component” style images in MDX pages to inline imports.

Child Page Images

Added images to the child page links shown on parent pages.

Astro Content Collections

Moves all updates into their own Astro content “collection”, rather than being mixed in with the pages collection.

Recent Updates to Home Page

Added the most recent 12 updates to the home page underneath the main content links:

Trivial File Transfer Protocol (TFTP)

Added information on the Trivial File Transfer Protocol (TFTP).

Cover Image Aspect Ratios

Experimented with different image aspect ratios for page cover images. The main aspect ratios I tested were 4:3 (old TV), 16:9 (HD), and 1.91:1 (recommended by Facebook for sharing). Eventually I settled on using the 16:9 aspect ratio with a resolution of 1280x720px.

On/Off Controller ICs

Added info on on/off controller ICs.

chown

Added info on chown.

July 2024 Updates

Migration from Hugo to Docusaurus then Astro.js

This month I migrated this site from Hugo to Docusaurus and then finally to Hugo. The first attempt was to migrate to Docusaurus. The main reason for this was to take advantage of the more modern React-based framework that Docusaurus provides, as well as the ability to use MDX for content pages. MDX allows you to embed React components within it when you want to add functionality to page above and beyond what standard markdown provides. Over the last 5 years I had found Hugo’s shortcode syntax to be a bit clunky and difficult to work with, and I was looking for a more modern solution. Given I am already familiar with React due to the NinjaTerm and NinjaCalc projects, Docusaurus seemed like a good fit. It also has a built in theme which suited this site well, reducing development time.

The Docusaurus theme should have much better responsive design than my self-written Hugo theme.

A screenshot of this website before migrating to Docusaurus.
A screenshot of this website after migrating to Docusaurus.

Unfortunately, I encountered some serious issues with Docusaurus late in the migration process. The biggest issues were build time and memory usage. The build process was taking over 10 minutes and using approx. 5-7GB of RAM when running on my Windows laptop. The build was failing in the Netlify pipeline due to it exceeding the pipeline limits (8GB is promised, so presumably the total system usage was exceeding this).

So I decided to migrate to astro.js instead, leveraging the Starlight theme (which is designed for documentation). Luckily, astro.js supports MDX much in the same way Docusaurus does, so not as much per-page porting was required. I had to add some imports to each .mdx file (I couldn’t work out how to add global imports to all .mdx files), and I had to replace my inline require() statements in the <Image> component’s src with a separate import statement above it.

Added New Info on MAHD

Added new info on the MAHD (Modified Agile for Hardware Development) project management methodology.

June 2024 Updates

I added the ability to change basic port settings in NinjaTerm from the right-hand drawer. This was a feature request by a user.

You now have the ability in NinjaTerm to send a break signal at the end of every line in a hex macro. This was another feature request by a user.

I added a page to this blog on how to choose serial numbers for embedded devices. It shows the way to calculate the mathematical probability of a collision when using random numbers for serial numbers.

I added a page to this blog on ANSI escape codes.

April 2024 Updates

NinjaTerm got four releases this May! Given all the time I spent on NinjaTerm there were no updates to this blog.

NinjaTerm can now display numerical data types such as hex, uint8, uint16, float32, e.t.c.:

You can now send a 200ms break signal by pressing Ctrl-Shift-B when the terminal is focused and the serial port open.

You can now specify a custom baud rate, and updated the default baud rates to include more common options.

A circular progress modal is shown while the port is being opened.

NinjaTerm has a new macros feature which lets you send pre-defined ASCII or HEX sequences out the serial port:

You now have the ability to select the flow-control method (none or hardware) when opening a serial port:

NinjaTerm has a new profiles feature which lets you save and load different serial port configurations.

April 2024 Updates

Added links in the top navbar to NinjaTerm and NinjaCalc.

New page on the PowerPC e200 CPU architecture.

New page on controlling a LED using PWM.

Added a new page with info on system basis chips (SBCs).

Improved the consistency and look of a number of component package pages by removing the old table design and adding more references.

Add more component package pages for the packages in the DO-204 family.

Added more info on EMA filters.

Added a new page on the SMF (DO-219AB) component package.

Added info on bitter coatings added to coin cells.

Started a new page on Optimizing BLE for Low Power.

March 2024 Updates

Released a new version of NinjaTerm, v4.13.0 which adds smart copy/paste support with Ctrl-Shift-C/V.

Started using Umami Analytics for analytics alongside Google Analytics. Umami is self-hosted on a Amazon Lightsail instance. The subdomain umami.mbedded.ninja points to the IPv6 only instance. If Umami works well (it’s privacy focused and is unlikely to be blocked by ad blockers), Google Analytics will be removed in the following months.

Added a new page on how to setup Umami Analytics on Amazon Lightsail.

Added info on C compile-time asserts().

Added a new page with a small amount of info on Infineon 32-bit AURIX TriCore MCUs.

February 2024 Updates

Added info on MCU ADCs and switched-capacitor array architecture.

Started a new page on low power design.

Added info on the Thevenin equivalent circuit for a resistor divider.

Started a new page on RC Charging Circuits.

Started a new page with info on the opaque pointer design pattern.

Added info on Zephyr threads, mutexes, work queues and GPIO.

January 2024 Updates

  • Added the ability to do a site-wide search with the help of the pagefind library. At compile time, after hugo builds the site, pagefind is then run and creates a search dictionary that is downloaded to the client when they want to perform a search. All the searching happens client-side, no server is needed.

Happy New Year 2024

Statistics for 2023

2023 saw 436k (436,000) page views as reported by Google Analytics! This was up from 384k last year, an increase of 52k or 14%.

Graphs of page views and content up to the end of 2023.

I discovered that many ad blockers also block Google Analytics, so this figure is likely less than the true value, given many people visiting this site will be software/electrical engineers who will use ad blockers. In an attempt to get a more realistic number, I paid for a month of Netlify’s analytics service which can’t be blocked in the same way as it’s working on the server side when requests are made (I use Netlify to host this blog). Netlify reported 729k visitors in just 1 month!?! Is this is to be believed that is approx. 8.7M visitors a year. This seems too high, so maybe it’s also recording a lot of bots? The true value might be someone between the two?

The number of page views are reported by Netlify in the period of 30 days. 729k visitors!?!

At the end of 2023 the site had 639k words, up from 604k words last year (an increase of 35k). These words were spread over 1221 pages, and included 4,518 images (an increase of 199 from 4,319 images last year).

The top 10 most popular pages, ranked by number of page views:

The top 10 most visited pages of 2023.

Programming related pages again took the top spots. I’m not sure what “(not set)” is, this wasn’t here last year!

Acquisition

As usual, most of the traffic was from organic search (e.g. Google search engine).

Top 5 sources of acquisition traffic in 2023.

Donations

I received NZD59worthofdonationsthrough[myKoFipage](https://kofi.com/gbmhunter)fromthisblog,[NinjaCalc](https://ninjacalc.mbedded.ninja/)and[NinjaTerm](https://ninjaterm.mbedded.ninja/)thisyear.SomekindfolkdonatedNZ59 worth of donations through [my Ko-Fi page](https://ko-fi.com/gbmhunter) from this blog, [NinjaCalc](https://ninjacalc.mbedded.ninja/) and [NinjaTerm](https://ninjaterm.mbedded.ninja/) this year. Some kind folk donated NZ3 a month, and there were two one-off donations of 15and15 and 20.

Achievements in 2023

  • Asciidoc pages have been fully phased out.
  • NinjaTerm was fixed up and turned into a PWA.
  • Finally, the end of the year saw the blog get a dark mode!

Plans For The 2024 Year

  • More content, and improving existing content: As always!
  • Add the ability to do a site wide search: I’m thinking I’ll write a frontend along with using pagefind for this. I feel like this is a better approach than using Algolia, which is a paid for (although they do give out open-source licenses if you contact them) third party search service. Mostly because I will not depend on the 3rd party, the search index can be built at compile time and then the searching done by the client browser.

2024

Child Pages

December 2023 Updates

blog.mbedded.ninja now has a dark mode. New CSS styling rules have been created to properly colour things when in dark mode, and a little JS script has been added to respond to the light/dark toggle button click and store the preference in the users local storage.

The page structure got modified. I wanted to improve the main left navigation menu. So I created a top navbar for the site logo, name and light/dark mode toggle. And then the left column is dedicated purely to the navigation menu. The on hover styling has been improved, with a clear indication you can click the chevron to expand/collapse a sub-menu. The chevrons are now all aligned on the right of the menu rather than on the left.

Updated the VMIN and VTIME information on Linux Serial Ports Using C/C++.

Added info on converting a version string into numbers to the C String Manipulation page. This page was also restructured to read better.

Added info on the Zephyr Hardware Info Interface (including reset causes).

Added more info on Benchtop PSUs to the Electronics Tools page.

Started a page on Triangles, and added information about the Law of Sines to it.

November 2023 Updates

  • Just like last month, this month I was (almost) solely focused on NinjaTerm development. We went from v4.7.0 through to v4.12.0 in the month of November. Updates to NinjaTerm are highlighted below.

  • Added glyphs to the Unicode PUA range of the NinjaTerm font to show control characters and hex codes.

  • Added logging functionality.
  • Last serial port details and connection state are remembered across App reloads, and NinjaTerm can automatically reconnect to previously used serial port.

  • Added ability for NinjaTerm to reopen serial port (when available) after unexpected closure.

  • Added ability to filter rows of terminal text.

  • Miscellaneous bug fixes.

  • One change with this blog is that I started playing around with the idea of adding ads. I personally don’t like ads but they might help pay for the upkeep of this site (domain registration, DNS, hosting, and software licenses for designing things like the diagrams). I have enabled Google AdSense. In it’s current form the ads are pretty horrible (e.g. disruptive pop-ups), so I’ll be tuning them and making sure they are not so invasive in the near future. If they don’t end up making much money, I might remove them altogether.