Hardware Revision Control: Configuring HWID

Introduction

Hardware configuration for different PCB revisions or hardware variants needs to be hard-coded when firmware development is still at the early stage. There are two classic ways to achieve this, and an advanced method is also available. This article explores three common techniques for configuring Hardware Identification (HWID). 

Method 1: Stuffing Options with Pull-Up and Pull-Down Resistors

Conceptual Basics

How It Works

Mathematical Insight

The number of configurations N is given by: N=3^n

For two GPIOs, you have 9 configurations.

Best Use Case

Method 2: Using Direct Ground Connections

Conceptual Basics

How It Works

Mathematical Insight

The number of configurations N is: N=2^n

For two GPIOs, you have 4 configurations.

Best Use Case

Advanced Method: One-Time Programmable Memory

Conceptual Basics

How It Works

Best Use Case

Note on EEPROM Type

User Options in OTP ID: It's crucial to note that this method can only be employed when the EEPROM used has an OTP ID section designated for user options. Without this specific feature, the approach is not viable. 

Summary

By understanding the principles behind each approach, you can make an informed decision that aligns with your project's requirements and limitations.