# Flux.ai handover: Dockit till display PCB

**Attached:** `device_parts_list.xlsx` (sheet "Parts List": intended components, LCSC part numbers;
everything except the display is available at JLCPCB/LCSC). Where this brief and the spreadsheet differ,
**this brief wins** (see "Changes from the parts list").

## 1. What the board is
A small, square, USB-powered device that sits on a shop counter next to the till. It plugs into the till PC
by USB-C and appears as a USB serial (CDC) port. It shows a QR code on a 1.54" 240x240 LCD and offers the
same web link on an NFC tag that customers tap with their phone.

It replaces a **working prototype** built from a Raspberry Pi Pico, a 1.54" ST7789 display module and an
ST25DV64KC NFC tag board, using the same chips. **The existing firmware must run on this board unchanged.**
So copy the Raspberry Pi Pico's RP2040 core circuit (same flash, same crystal) and keep every pin
assignment in section 4.

## 2. Size and mechanics (hard constraints)
- **Square board.** The finished case must be **60 × 60 mm or less** and **under 15 mm thick**, so target a
  PCB of about **54 × 54 mm** (leaves about 3 mm for case walls). Smaller is fine if everything fits.
- **Display: EastRising ER-TFTM1.54-1 module** (the display panel on its own small PCB), outline about
  **32 × 43 mm**, with **8 pins: GND, VCC, SCL, SDA, RES, DC, CS, BLK** on a 2.54 mm pitch row.
  It is **soldered directly onto this PCB** through those 8 pins (8 plated through-holes, 2.54 mm pitch).
  Centre the display on the top side. Use the module's mechanical drawing from buydisplay.com for the exact
  hole positions and outline. (Attached separately if available; otherwise leave the 8-hole row and outline
  as a clearly labelled footprint to confirm.)
- Mount the module as low as possible: pins through the board with a minimal gap (about 2.5 mm standard
  header spacer or less). Make sure nothing on our top side sits under the module.
- **Stack-up budget for under 15 mm:** display module about 4 mm + gap about 2.5 mm + PCB 1.6 mm + tallest
  bottom-side part about 3.5 mm (USB-C) + case walls. Keep all other parts low-profile (0402/0603, SOT-23,
  SOIC/QFN).
- **All SMD parts on the bottom side** (single-sided assembly at JLCPCB). Only the display sits on top.
- **USB-C on one edge**, pointing out of the side of the case, mid-height if possible.
- 4 × M2 mounting holes in the corners. Corner radius about 3 mm to match a rounded square case.

## 3. Components (JLCPCB/LCSC; see spreadsheet for LCSC numbers)
| Ref | Part | Notes |
|---|---|---|
| U1 | **RP2040** (LCSC C2040), QFN-56 | Same as Raspberry Pi Pico |
| U2 | **W25Q16JVSSIQ** 2 MB QSPI flash (LCSC C82317), SOIC-8 | Same as Pico. Also provides the unique ID used as the USB serial number (the device ID) |
| Y1 | **ABM8-272-T3** 12 MHz crystal + load caps (C0G) + 1 kΩ series as on the Pico | Same as Pico |
| U3 | **ST25DV64KC-IE6S3** NFC dynamic tag, SO-8, I2C, open-drain GPO | Same chip as the prototype. Address 0x53 (also answers at 0x57) |
| U4 | **AP2112K-3.3TRG1** 3.3 V 600 mA LDO (LCSC C51118), SOT-23-5 | EN tied to VIN |
| U5 | **USBLC6-2SC6** USB ESD protection | Next to J1 |
| J1 | **TYPE-C-31-M-12** USB-C 16-pin receptacle (LCSC C165948) | USB 2.0 device only |
| Q1 | **AO3400A** N-MOSFET | Display backlight switch |
| F1 | 500 mA PTC resettable fuse (0805/1206) on VBUS | Added |
| SW1, SW2 | SMD tact switches: BOOTSEL, RESET | Internal (case closed); low-profile |
| LED1 | Green 0603 LED + resistor | Status LED |
| ANT1 | PCB trace coil antenna | No part to buy; see section 6 |
| DISP1 | EastRising **ER-TFTM1.54-1** module | Ordered from buydisplay.com and hand-soldered; **not** placed by JLCPCB |
| R/C | 5.1 kΩ ×2 (CC1, CC2), 27 Ω ×2 (USB D±), 4.7 kΩ ×2 (I2C), 1 kΩ/10 kΩ (BOOTSEL, RUN, misc), 100 nF decoupling, 1 µF/10 µF bulk, C0G tuning caps | 0402 where possible |

## 4. Pin assignments (fixed: the firmware expects these)
| RP2040 | Net | Goes to |
|---|---|---|
| GP18 (SPI0 SCK) | LCD_SCK | Display **SCL** |
| GP19 (SPI0 TX) | LCD_MOSI | Display **SDA** |
| GP17 | LCD_CS | Display **CS** |
| GP20 | LCD_DC | Display **DC** |
| GP21 | LCD_RST | Display **RES** |
| GP4 (I2C0 SDA) | NFC_SDA | ST25DV64KC SDA (4.7 kΩ pull-up to 3V3) |
| GP5 (I2C0 SCL) | NFC_SCL | ST25DV64KC SCL (4.7 kΩ pull-up to 3V3) |
| GP25 | LED | Status LED |
| USB_DP/USB_DM | USB D+/D- | J1 through 27 Ω series resistors |
| GP22 | LCD_BL_EN | Q1 gate (backlight switch). **100 kΩ pull-up to 3V3 so the backlight is ON by default** (the firmware doesn't drive GP22 yet) |
| GP6 | NFC_GPO | ST25DV64KC GPO, 10 kΩ pull-up to 3V3 (optional "phone tapped" input) |
| GP7 | NFC_LPD | ST25DV64KC LPD, 10 kΩ pull-down (tag always on by default) |
Display **VCC** to 3V3, **GND** to GND, **BLK** through Q1 (low-side switch on the backlight return, or
whatever the module's BLK input needs per its datasheet; the prototype simply tied BLK to 3V3).

## 5. Circuit requirements
**RP2040 core:** follow Raspberry Pi's "Hardware design with RP2040" minimal design / Pico schematic:
internal core regulator (VREG_VIN at 3V3, VREG_VOUT to DVDD with 1 µF), 100 nF on every IOVDD/DVDD/
USB_VDD/ADC_AVDD pin close to the pin, 10 µF bulk on 3V3, TESTEN to GND, RUN pulled up with the RESET
button to GND, BOOTSEL button pulling flash CS (QSPI_SS) low through 1 kΩ. Add **SWD test pads** (SWCLK,
SWDIO, 3V3, GND) on the bottom for factory programming.

**USB-C:** separate 5.1 kΩ pull-downs on CC1 and CC2. Join D+/D- from both receptacle rows. Route D± as a
90 Ω differential pair, short, with ESD (U5) at the connector. VBUS goes through F1 to the LDO. Shield to GND.

**Power:** 5 V VBUS to AP2112K-3.3 (1 µF in, 1 µF + 10 µF out). Total load under 150 mA (RP2040 about
25-50 mA, display and backlight about 30-60 mA, NFC tag about 1 mA).

## 6. NFC antenna (most important RF part)
The board is too small to put the antenna beside the display, so use a **loop antenna around the display**
(like payment terminals):
- Coil traces run in the ring between the display outline and the board edge, on both layers if needed,
  connected to ST25DV64KC **AC0/AC1**. Target resonance **13.56 MHz** with the chip's internal tuning
  capacitance (about 28.5 pF, so about 4.8 µH; design with ST's eDesignSuite antenna tool or AN2972).
- **Keep-out:** no copper pour, ground or other traces in the coil ring on any layer. Keep the coil at
  least 2-3 mm from the display module's metal frame and from the ground plane inside it. Put the
  ST25DV64KC right next to the coil ends.
- Add **2 parallel tuning-capacitor footprints (0402, C0G, DNP by default)** across AC0/AC1, so we can
  re-tune after measuring with the display fitted (the metal inside the loop shifts the resonance).
- Ground plane and all other circuitry go inside the loop area on the bottom side (under the display),
  not in the coil ring.
- Silkscreen an NFC "tap here" mark on the front-facing ring area.

## 7. Layout and manufacturing
- 2-layer, 1.6 mm (1.0-1.2 mm acceptable if it helps thickness), JLCPCB standard rules, JLCPCB SMT
  assembly on the bottom side using LCSC basic/extended parts from the spreadsheet.
- Solid ground plane on the bottom-side component area. Short, direct RP2040-flash and crystal routing
  (copy the Pico's placement style).
- Silkscreen: "Dockit", board revision, BOOT/RESET labels, test-pad labels, pin-1 marks, display
  orientation outline.
- **Deliverables:** schematic, PCB layout, BOM with LCSC part numbers, JLCPCB Gerbers + CPL
  (pick-and-place) files, and a 3D view showing the display mounted and the board fitting a
  60 × 60 × 15 mm case.

## 8. Changes from the parts list (this brief wins)
- **NFC chip:** use **ST25DV64KC-IE6S3** (same as the prototype), not ST25DV04KC-IE6S3. Same SO-8 footprint,
  so the 04KC can be swapped in later as a cost-down once firmware compatibility is confirmed.
- **Display:** use the **ER-TFTM1.54-1 module soldered through its 8 pins**, not the bare ER-TFT1.54-2
  panel with a 15-pin FPC/ZIF connector. Drop J2 (FPC connector). The FPC panel may come back in a later
  revision for a thinner device.
- **Board size:** square, up to about 54 × 54 mm (case up to 60 × 60 × 15 mm), not about 45 × 45 mm.
- **Added:** F1 PTC fuse, LED1, GP6/GP7 NFC GPO/LPD connections, tuning-cap footprints.

## 9. Notes
- USB IDs: the prototype firmware uses Raspberry Pi's USB VID 0x2E8A. That's a firmware matter (not this
  board), noted for a later commercial release.
