0

I have a board going out into the wild which we know over time will be revised for various reasons including cost, EOL components, reliability etc.

We will also be providing firmware update on an infrequent basis.

What is a good method to allow the MCU / CPU to indentify which hardware revision the consumers baord is at.

  • 1
    Got any spare pins on the MCU? –  Apr 21 '20 at 19:01
  • 1
    You can buy a cheap EEPROM and store board-related information in there but it would require some initial register-writing. You could also add an interface to a parallel-to-shift register in the same vein of what Brian is suggesting if you want it to be hard-wired and are starved for I/O pins. Edit: hard-wired not hard-coded – dsizzle83 Apr 21 '20 at 19:10
  • 1
    You can use a one-wire EEPROM if you only have a single pin to spare. – Ron Beyer Apr 21 '20 at 19:26
  • Welcome Leo! :) And here too: https://electronics.stackexchange.com/questions/41757/what-is-a-good-way-for-the-mcu-to-determine-which-hardware-version-it-is-running – awjlogan Apr 21 '20 at 19:49

4 Answers4

2

If you have spare pins on a MCU/CPU, you could add pull-up and pull-down resistors on all these spare pins. Let's assume you have 4 of these revision pins.

Everytime you update the PCB, update the BOM so the first revision would only have pull-downs yielding revision 0.

For the 2nd revision of the PCB, update the BOM so the second revision has one revision pin with a pull-up and all the other revision pins have pull-downs.

Etc., that way you could accommodate up to 16 PCB revisions with 4 pins, this should be enough. Only thing to remember is to update the BOM everytime you change the PCB.

Ben
  • 645
  • 4
  • 13
  • 2
    This is nice and simple. When we had only one pin to spare in a design, we used a voltage divider (one fix resistor, one changing with each revision) going to an ADC input. That way, we could easily differentiate 20 versions without caring much about ADC precision. – Rev Apr 21 '20 at 20:10
1

Many options.

  1. On-chip OTP programmed during production/testing.
  2. Eeprom memory and serial number chip programmed during production/testing. Eg: 11AA02UID.

These can be done poorly with risk of operator error by having the operator read and enter it. Or you can have your operator scan a sticker or lasered QR code that will be written during programming.

Theoretically you'd want to also store the serial number next to the version.

Not sensitive to operator error:

  1. Unique Serial Chip number database. (also genuine protection)
  2. Hardwired GPIO matrix.
  3. Hardwired analog value for the ADC.

Pick one that fits into your intended lifecycle program.


So apparently the numbered list is broken...

Jeroen3
  • 21,976
  • 36
  • 73
0

The easiest way is to record the version in the MCU's EEPROM at the last address. If your EEPROM is 8bit, you can record 256 revisions. Or you use 2 address to record 65535. Each revision's changes can be documented in your device's documentation.

Example: revision 24: In the documentation, for this revision the capacitor values on the PCB were increases, the revision number was replaced in the EEPROM.

CFCBazar
  • 501
  • 4
  • 9
0

The only way to absolutely, positively do this is to provide some sort of non-re-writebable value that can be read by the host.

EEPROMs can be wiped and reflashed, so that doesn't really work unless you write-protect a section of it. If you can do that you can not only encode the board rev, but a serial number as well.

If you have some OTP available, even better.

Board straps are a historically common, but not cost-friendly method. Not only does it need extra hardware, it also has the burden of managing a BOM to go with it to configure the straps, so more business units have to get involved on each release. It's painful and error-prone.

Some companies keep track by keeping a database of serial numbers and assigning the rev information in a database. This works for a push-update model like a set-top box for example, but not for a standalone device.

hacktastical
  • 49,832
  • 2
  • 47
  • 138