main module#
JS3 Part 1 reference solution: an RP2040 drives an SPI data flash and an I2C accelerometer, with every bus pin left to pin assignment.
Parts and sources:
Raspberry Pi RP2040 (
jitxexamples.components.mcus.raspberry_pi_RP2040). Its I2C and SPI pin options are the F1 (SPI) and F3 (I2C) columns of Table 279, “General Purpose Input/Output (GPIO) User Bank Functions”, section 2.19.2: Raspberry Pi Ltd, “RP2040 Datasheet”, build-date 2025-02-20, build-version 3184e62-clean, https://datasheets.raspberrypi.com/rp2040/rp2040-datasheet.pdf.Winbond W25Q128JV serial flash (
W25Q128JVSIQ), on standard SPI: Winbond, “W25Q128JV 3V 128M-bit serial flash memory with dual/quad SPI”, Revision J, April 25, 2024 (read from the copy LCSC serves for part C97521, https://datasheet.lcsc.com/datasheet/pdf/d009d960f1daec6149edaa35b7dae856.pdf?productCode=C97521). Section 3.3 pins; section 4.2: standard SPI writes on DI and reads on DO; sections 4.3 and 4.4: /WP and /HOLD are active low, so both are held at VCC. Its 100 nF decoupling capacitor follows Raspberry Pi Ltd, “Hardware design with RP2040”, build-date 20/08/2026, build-version 0444806419d7, Figure 7 (C5, 100 nF on the W25Q128JVS VCC pin), https://datasheets.raspberrypi.com/rp2040/hardware-design-with-rp2040.pdf.STMicroelectronics LIS3DH accelerometer (
LIS3DHTR), on I2C: STMicroelectronics, “LIS3DH”, datasheet DocID17530 Rev 2, December 2016 (read from the copy LCSC serves for part C15134, https://datasheet.lcsc.com/datasheet/pdf/fe5ca48c88184deb9f920ce8b9b86aeb.pdf?productCode=C15134). Section 4: “When using the I2C, CS must be tied high”; Figure 5: 10 kOhm pull-ups from SCL and SDA to Vdd_IO when I2C is used. SA0 (pin 7) is tied to Vdd_IO, which selects the I2C address 0011001b (section 6.1.1).
Legal pin choices: Table 279 gives 113 for one I2C bus (I2C0 8 x 8, I2C1 7 x 7), 400 for one SPI bus with chip select (SPI0 4 x 4 x 4 x 4, SPI1 4 x 4 x 3 x 3), and 34,000 for both at once with no GPIO shared.
Out of scope: power entry. 3V3 is a named net with no regulator.
- FLASH_DECOUPLING = <Quantity(1e-07, 'farad')>#
C5, 100 nF on the flash VCC pin.
- Type:
Hardware design with RP2040, Figure 7
- I2C_PULLUP = <Quantity(10000.0, 'ohm')>#
Rpu = 10 kOhm on SCL and SDA to Vdd_IO.
- Type:
LIS3DH datasheet Figure 5
- class DataFlash[source]#
Bases:
CircuitA W25Q128JV on standard SPI, /WP and /HOLD held inactive.
- spi = SPI(cs=True)#
- power = Power()#