MustafaMulla29/rp2040-bldc-motor-controller

Hardware assembly metadata and PCB geometry for a controller board with a snap-off rotary-encoder section, plus four parallel 150 µF/50 V bulk electrolytic capacitors filtering the motor supply.

Version
2.0.40
License
unset
Stars
0

Use with the tscircuit CLI

tsci is the tscircuit CLI. Install it with npm install -g tscircuit.

tsci clone MustafaMulla29/rp2040-bldc-motor-controller  # download the package files into ./rp2040-bldc-motor-controller
tsci add MustafaMulla29/rp2040-bldc-motor-controller    # add it to your project as @tsci/MustafaMulla29.rp2040-bldc-motor-controller

In a cloned or new (tsci init) project: tsci dev starts a local preview, tsci build outputs Circuit JSON, and tsci push publishes to tscircuit.com.

firmware/verify_pd_boot.py

"""After complete power removal, verify NVM-loaded profiles WITHOUT RAM writes."""
from machine import Pin, I2C
from pd_nvm import NVM
from pd_profile import nvm_is_9v, verify_runtime

Pin(2, Pin.OUT, value=0)
Pin(3, Pin.OUT, value=0)
bus = I2C(1, sda=Pin(22), scl=Pin(23), freq=100_000)
verify_runtime(bus)
if not nvm_is_9v(NVM(bus).read()):
    raise OSError("Stored PD profile is not provisioned")
print("PASS: cold-start profiles are 5 V / 0.5 A and 9 V / 3 A; PDO3 inactive and also 9 V.")
print("Next: use a PD analyzer to check attach, reset and reconnect with a 5/9/15/20 V source.")