MustafaMulla29/rp2040-bldc-motor-controller-new
A USB‑C PD–powered RP2040 BLDC motor controller PCB with 3.3 V logic, MCT8329A sensorless commutation, three MOSFET half-bridges, protected power switching, USB data, controls, and motor connectors.
- Version
- 0.3.82
- License
- unset
- Stars
- 0
firmware/bringup.py
"""Read-only A1 diagnostics. Never enables motor operation."""
from machine import Pin, ADC, I2C
import time
for pin in (2, 3):
Pin(pin, Pin.OUT, value=0)
bus = I2C(1, sda=Pin(22), scl=Pin(23), freq=100_000)
print("A1 power I2C:", [hex(x) for x in bus.scan()])
while True:
print("VBUS %.2f V / switched VMOTOR %.2f V / motor-feed current %.3f A" % (
ADC(26).read_u16()*3.3/65535*235/15,
ADC(27).read_u16()*3.3/65535*235/15,
ADC(28).read_u16()*3.3/65535/0.4))
time.sleep(1)