33This project uses a Raspberry Pi Pico to identify and store various information
44about a system/fixture, settable and retrievable over UART or USB. Additionally,
55writing can be disabled by jumping GPIO pins 14 and 15 together (pins 19 and 20
6- on the board).
6+ on the board), and GPIO 13 (pin 17 on the board) can be switched to GND and used
7+ as a pulse counter, such as for a fixture lid switch. This pin is active low and
8+ counts any low pulse longer than a minimum time period (configurable by with a
9+ CMake variable).
710
8- ** Pre-built UF2 files ready to flash onto the Pico for both USB and UART are
9- available [ here] ( https://github.com/BloomyControls/pico-ident/releases ) .**
11+ This project makes use of a Pi Pico and a MIKROE EEPROM 3 Click. The I2C lines
12+ for the EEPROM should be connected to GPIOs 16 (SDA) and 17 (SCL) (pins 21 and
13+ 22 on the board, respectively).
14+
15+ ** Pre-build UF2 binaries are available for USB or UART configurations
16+ [ here] [ releases ] .**
17+
18+ > [ !IMPORTANT]
19+ > This is the new version with pulse counting using the AT24CM02 I2C EEPROM
20+ > chip. For the old version without pulse counting which uses only the Pico's
21+ > on-board flash, use [ version 1.3.0] [ 1.3.0 ] .
22+
23+ [ releases ] : https://github.com/BloomyControls/pico-ident/releases
24+ [ 1.3.0 ] : https://github.com/BloomyControls/pico-ident/releases/tag/v1.3.0
1025
1126## Information Fields
1227
@@ -15,12 +30,12 @@ read the Pico's unique 64-bit identifier as a hex string, but of course this is
1530read-only. The idea is that the Pico's serial number can always be used to
1631uniquely identify any device, as no two Picos have the same serial.
1732
18- It's worth noting that each sector (4096 bytes) of flash has a guaranteed
19- minimum of 100,000 program-erase cycles according to the manufacturer. Each
20- write to one of these fields will incur one erase and one program . This
21- effectively limits us to 100,000 writes to any of these fields. Of course, the
22- intended use of this device is to be set once and then write-locked for the rest
23- of its lifespan, so that's likely not a huge concern here .
33+ The EEPROM specifies up to 1,000,000 writes per flash cell (per 4-byte word).
34+ Using a simple wear-leveling scheme using 16 words, the theoretical minimum
35+ number of pulses that can be counted without resetting is about 16 million . This
36+ is expected to be incredibly high for most applications, but by changing
37+ a constant, this number can be trivially increased for more demanding
38+ applications .
2439
2540| Field | Access | Description |
2641| ---| ---| ---|
@@ -35,6 +50,7 @@ of its lifespan, so that's likely not a huge concern here.
3550| ` USER3 ` | Read-write | General-purpose field 3 |
3651| ` USER4 ` | Read-write | General-purpose field 4 |
3752| ` SERIAL ` | Read-only | Pico's unique 64-bit serial number |
53+ | ` PULSECOUNT? ` | Read-only | Low pulse count on GP13 (board pin 17) |
3854
3955Note that each of the above fields has a maximum length of 63. Each field is 64
4056bytes, but is null-terminated. Values longer than 63 bytes will be truncated.
@@ -61,12 +77,13 @@ to query the manufacturer:
6177MFG?\r
6278```
6379
64- There are two additional commands:
80+ There are some additional commands:
6581
6682| Command | Description |
6783| ---| ---|
6884| ` CLEAR ` | Clear all writable fields |
69- | ` CHECK? ` | Check that the data stored in flash matches the stored checksum, then return either ` OK ` or ` ERR ` |
85+ | ` CHECK? ` | Check that the data stored in EEPROM matches the stored checksum, then return either ` OK ` or ` ERR ` |
86+ | ` RESETCOUNT ` | Reset the pulse count to 0 |
7087
7188## Build Requirements
7289
@@ -92,6 +109,10 @@ This step may take quite some time, as it will download the Pi Pico SDK. If you
92109wish to use USB for serial communications instead of UART, add ` -DUSB_SERIAL=ON `
93110to the above command.
94111
112+ The default minimum pulse width is 100ms. To override this time limit, pass
113+ ` -DMIN_PULSE_WIDTH_US=500000 ` to get 500ms (you can use any whole number of
114+ microseconds greater than or equal to 50,000).
115+
95116After the configuration step is done, you can build the project like so:
96117
97118```
0 commit comments