From 9373ba7d5b67cfa8a529b6326ec12782b5f11132 Mon Sep 17 00:00:00 2001
From: Jake Read <jake.read@cba.mit.edu>
Date: Tue, 10 Aug 2021 19:56:49 -0400
Subject: [PATCH] start earnest ucbus-drop stepper fw

---
 .gitmodules                                   |   3 +
 2021-06_fab-step-ucbus/eagle.epf              |  50 +++----
 2021-06_fab-step-ucbus/fab-step-ucbus.brd     |  50 ++++---
 2021-06_fab-step-ucbus/fab-step-ucbus.sch     |   4 +-
 fab-step-controller/src/main.cpp              |  14 --
 .../fab-step}/.gitignore                      |   0
 .../fab-step}/.vscode/extensions.json         |   0
 .../fab-step}/include/README                  |   0
 .../fab-step}/lib/README                      |   0
 .../fab-step}/platformio.ini                  |   0
 firmware/fab-step/src/config.h                |   3 +
 firmware/fab-step/src/drivers/step_a4950.cpp  | 133 ++++++++++++++++++
 firmware/fab-step/src/drivers/step_a4950.h    |  68 +++++++++
 firmware/fab-step/src/indicators.h            |  29 ++++
 firmware/fab-step/src/main.cpp                |  75 ++++++++++
 firmware/fab-step/src/osape-d21               |   1 +
 firmware/fab-step/src/syserror.cpp            |  92 ++++++++++++
 firmware/fab-step/src/syserror.h              |  10 ++
 .../fab-step}/test/README                     |   0
 19 files changed, 465 insertions(+), 67 deletions(-)
 create mode 100644 .gitmodules
 delete mode 100644 fab-step-controller/src/main.cpp
 rename {fab-step-controller => firmware/fab-step}/.gitignore (100%)
 rename {fab-step-controller => firmware/fab-step}/.vscode/extensions.json (100%)
 rename {fab-step-controller => firmware/fab-step}/include/README (100%)
 rename {fab-step-controller => firmware/fab-step}/lib/README (100%)
 rename {fab-step-controller => firmware/fab-step}/platformio.ini (100%)
 create mode 100644 firmware/fab-step/src/config.h
 create mode 100644 firmware/fab-step/src/drivers/step_a4950.cpp
 create mode 100644 firmware/fab-step/src/drivers/step_a4950.h
 create mode 100644 firmware/fab-step/src/indicators.h
 create mode 100644 firmware/fab-step/src/main.cpp
 create mode 160000 firmware/fab-step/src/osape-d21
 create mode 100644 firmware/fab-step/src/syserror.cpp
 create mode 100644 firmware/fab-step/src/syserror.h
 rename {fab-step-controller => firmware/fab-step}/test/README (100%)

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..4ffbd1f
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "firmware/fab-step/src/osape-d21"]
+	path = firmware/fab-step/src/osape-d21
+	url = ssh://git@gitlab.cba.mit.edu:846/jakeread/osape-d21.git
diff --git a/2021-06_fab-step-ucbus/eagle.epf b/2021-06_fab-step-ucbus/eagle.epf
index 5d3373e..88b27dc 100644
--- a/2021-06_fab-step-ucbus/eagle.epf
+++ b/2021-06_fab-step-ucbus/eagle.epf
@@ -69,17 +69,17 @@ Layer=21
 Package="8-MSOP-FAB"
 
 [Win_2]
-Type="Schematic Editor"
-Number=1
-File="fab-step-ucbus.sch"
-View="-27.0496 -25.5925 436.749 223.216"
-WireWidths=" 0.0762 0.1016 0.127 0.15 0.2 0.2032 0.254 0.3048 0.4064 0.508 0.6096 0.8128 1.016 1.27 2.54 0.1524"
+Type="Board Editor"
+Number=2
+File="fab-step-ucbus.brd"
+View="19.5424 23.1675 28.8057 33.3494"
+WireWidths=" 0.1016 0.127 0.2 1.016 1.27 2.54 0.15 0.0762 0.4064 0.254 0.508 0.6096 0.8128 0.1524 0.2032 0.3048"
 PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
 PadDrills=" 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.65 0.7 0.75 0.8 0.85 0.9 1 0.6"
 ViaDiameters=" 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05 1.1 1.15 1.2 1.3 0"
-ViaDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
+ViaDrills=" 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35 0.8382"
 HoleDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
-TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
+TextSizes=" 0.254 0.3048 0.4064 0.6096 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778 0.8128"
 PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
 PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
 MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
@@ -88,14 +88,14 @@ DimensionExtWidths=" 0.127 0.254 0.1 0.13 0.26 0"
 DimensionExtLengths=" 1.27 2.54 1 2 3 0"
 DimensionExtOffsets=" 1.27 2.54 1 2 3 0"
 SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
-WireBend=0
-WireBendSet=31
+WireBend=1
+WireBendSet=0
 WireCap=1
 MiterStyle=1
 PadShape=0
 ViaShape=1
 PolygonPour=0
-PolygonRank=0
+PolygonRank=2
 PolygonThermals=1
 PolygonOrphans=0
 TextRatio=8
@@ -110,22 +110,20 @@ SwapLevel=0
 ArcDirection=0
 AddLevel=2
 PadsSameType=0
-Layer=91
-Views=" 1: -27.0496 -25.5925 436.749 223.216"
-Sheet="1"
+Layer=1
 
 [Win_3]
-Type="Board Editor"
-Number=2
-File="fab-step-ucbus.brd"
-View="5.55855 -11.9503 62.9144 51.0937"
-WireWidths=" 0.1016 0.127 0.2 1.016 1.27 2.54 0.15 0.0762 0.4064 0.254 0.508 0.6096 0.8128 0.1524 0.2032 0.3048"
+Type="Schematic Editor"
+Number=1
+File="fab-step-ucbus.sch"
+View="157.826 -12.2135 381.494 107.775"
+WireWidths=" 0.0762 0.1016 0.127 0.15 0.2 0.2032 0.254 0.3048 0.4064 0.508 0.6096 0.8128 1.016 1.27 2.54 0.1524"
 PadDiameters=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
 PadDrills=" 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.65 0.7 0.75 0.8 0.85 0.9 1 0.6"
 ViaDiameters=" 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 1.05 1.1 1.15 1.2 1.3 0"
-ViaDrills=" 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35 0.8382"
+ViaDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
 HoleDrills=" 0.2 0.25 0.3 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35"
-TextSizes=" 0.254 0.3048 0.4064 0.6096 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778 0.8128"
+TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778"
 PolygonSpacings=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.27"
 PolygonIsolates=" 0.254 0.3048 0.4064 0.6096 0.8128 1.016 1.27 1.4224 1.6764 1.778 1.9304 2.1844 2.54 3.81 6.4516 0"
 MiterRadiuss=" 0.254 0.3175 0.635 1.27 2.54 1 2 2.5 5 7.5 10 0"
@@ -134,14 +132,14 @@ DimensionExtWidths=" 0.127 0.254 0.1 0.13 0.26 0"
 DimensionExtLengths=" 1.27 2.54 1 2 3 0"
 DimensionExtOffsets=" 1.27 2.54 1 2 3 0"
 SmdSizes=" 0.3048 0.1524 0.4064 0.2032 0.6096 0.3048 0.8128 0.4064 1.016 0.508 1.27 0.6604 1.4224 0.7112 1.6764 0.8128 1.778 0.9144 1.9304 0.9652 2.1844 1.0668 2.54 1.27 3.81 1.9304 5.08 2.54 6.4516 3.2512 1.27 0.635"
-WireBend=1
-WireBendSet=0
+WireBend=0
+WireBendSet=31
 WireCap=1
 MiterStyle=1
 PadShape=0
 ViaShape=1
 PolygonPour=0
-PolygonRank=2
+PolygonRank=0
 PolygonThermals=1
 PolygonOrphans=0
 TextRatio=8
@@ -156,14 +154,16 @@ SwapLevel=0
 ArcDirection=0
 AddLevel=2
 PadsSameType=0
-Layer=1
+Layer=91
+Views=" 1: 157.826 -12.2135 381.494 107.775"
+Sheet="1"
 
 [Win_4]
 Type="Control Panel"
 Number=0
 
 [Desktop]
-Screen="1920 1080"
+Screen="3171 2520"
 Window="Win_1"
 Window="Win_2"
 Window="Win_3"
diff --git a/2021-06_fab-step-ucbus/fab-step-ucbus.brd b/2021-06_fab-step-ucbus/fab-step-ucbus.brd
index 0082b38..079bf02 100644
--- a/2021-06_fab-step-ucbus/fab-step-ucbus.brd
+++ b/2021-06_fab-step-ucbus/fab-step-ucbus.brd
@@ -6,7 +6,7 @@
 <setting alwaysvectorfont="no"/>
 <setting verticaltext="up"/>
 </settings>
-<grid distance="1" unitdist="mm" unit="mm" style="lines" multiple="1" display="yes" altdistance="5" altunitdist="mil" altunit="mil"/>
+<grid distance="0.1" unitdist="mm" unit="mm" style="lines" multiple="1" display="yes" altdistance="5" altunitdist="mil" altunit="mil"/>
 <layers>
 <layer number="1" name="Top" color="4" fill="1" visible="yes" active="yes"/>
 <layer number="2" name="Route2" color="16" fill="1" visible="no" active="no"/>
@@ -34,7 +34,7 @@
 <layer number="24" name="bOrigins" color="15" fill="1" visible="no" active="yes"/>
 <layer number="25" name="tNames" color="7" fill="1" visible="no" active="yes"/>
 <layer number="26" name="bNames" color="7" fill="1" visible="no" active="yes"/>
-<layer number="27" name="tValues" color="7" fill="1" visible="no" active="yes"/>
+<layer number="27" name="tValues" color="7" fill="1" visible="yes" active="yes"/>
 <layer number="28" name="bValues" color="7" fill="1" visible="no" active="yes"/>
 <layer number="29" name="tStop" color="7" fill="3" visible="yes" active="yes"/>
 <layer number="30" name="bStop" color="7" fill="6" visible="no" active="yes"/>
@@ -58,7 +58,7 @@
 <layer number="48" name="Document" color="7" fill="1" visible="no" active="yes"/>
 <layer number="49" name="Reference" color="7" fill="1" visible="no" active="yes"/>
 <layer number="50" name="dxf" color="7" fill="1" visible="no" active="no"/>
-<layer number="51" name="tDocu" color="7" fill="1" visible="yes" active="yes"/>
+<layer number="51" name="tDocu" color="7" fill="1" visible="no" active="yes"/>
 <layer number="52" name="bDocu" color="7" fill="1" visible="no" active="yes"/>
 <layer number="53" name="tGND_GNDA" color="7" fill="9" visible="no" active="no"/>
 <layer number="54" name="bGND_GNDA" color="1" fill="9" visible="no" active="no"/>
@@ -766,21 +766,21 @@ design rules under a new name.</description>
 <attribute name="NAME" x="32.3255" y="6.862" size="1.016" layer="25" rot="R270"/>
 <attribute name="PACKAGE" value="1206" x="3.56" y="-26.92" size="1.778" layer="27" rot="R270" display="off"/>
 <attribute name="TYPE" value="" x="3.56" y="-26.92" size="1.778" layer="27" rot="R270" display="off"/>
-<attribute name="VALUE" x="33.468" y="5.216" size="0.8128" layer="27" font="vector" rot="R270" align="center"/>
+<attribute name="VALUE" x="31.5" y="6.1" size="0.8128" layer="27" font="vector" rot="R180" align="center"/>
 <attribute name="VOLTAGE" value="" x="3.56" y="-26.92" size="1.778" layer="27" rot="R270" display="off"/>
 </element>
 <element name="C4" library="passives" package="1206" value="1uF" x="38.5" y="28.5" smashed="yes" rot="R180">
 <attribute name="NAME" x="39.262" y="27.6745" size="1.016" layer="25" rot="R180"/>
 <attribute name="PACKAGE" value="1206" x="23.26" y="64.06" size="1.778" layer="27" rot="R180" display="off"/>
 <attribute name="TYPE" value="" x="23.26" y="64.06" size="1.778" layer="27" rot="R180" display="off"/>
-<attribute name="VALUE" x="35.016" y="28.432" size="0.8128" layer="27" font="vector" rot="R180" align="center"/>
+<attribute name="VALUE" x="38.5" y="28.5" size="0.8128" layer="27" font="vector" rot="R270" align="center"/>
 <attribute name="VOLTAGE" value="" x="23.26" y="64.06" size="1.778" layer="27" rot="R180" display="off"/>
 </element>
 <element name="C7" library="passives" package="1206" value="1uF" x="38.5" y="31" smashed="yes">
 <attribute name="NAME" x="37.738" y="31.8255" size="1.016" layer="25"/>
 <attribute name="PACKAGE" value="1206" x="57.55" y="-4.56" size="1.778" layer="27" display="off"/>
 <attribute name="TYPE" value="" x="57.55" y="-4.56" size="1.778" layer="27" display="off"/>
-<attribute name="VALUE" x="35.084" y="30.468" size="0.8128" layer="27" font="vector" align="center"/>
+<attribute name="VALUE" x="38.5" y="31" size="0.8128" layer="27" font="vector" rot="R90" align="center"/>
 <attribute name="VOLTAGE" value="" x="57.55" y="-4.56" size="1.778" layer="27" display="off"/>
 </element>
 <element name="J1" library="SparkFun-Connectors" package="2X5-SMD-1.27MM" value="JTAG" x="31.4" y="38" smashed="yes" rot="R180">
@@ -790,13 +790,13 @@ design rules under a new name.</description>
 <attribute name="NAME" x="37.738" y="34.3255" size="1.016" layer="25"/>
 <attribute name="PACKAGE" value="1206" x="61.36" y="-2.06" size="1.778" layer="27" display="off"/>
 <attribute name="PRECISION" value="" x="61.36" y="-2.06" size="1.778" layer="27" display="off"/>
-<attribute name="VALUE" x="34.984" y="34.268" size="0.8128" layer="27" font="vector" align="center"/>
+<attribute name="VALUE" x="38.5" y="33.5" size="0.8128" layer="27" font="vector" rot="R90" align="center"/>
 </element>
 <element name="R3" library="passives" package="1206" value="10k" x="33.5" y="32.5" smashed="yes" rot="R180">
 <attribute name="NAME" x="34.262" y="31.6745" size="1.016" layer="25" rot="R180"/>
 <attribute name="PACKAGE" value="1206" x="6.83" y="68.06" size="1.778" layer="27" rot="R180" display="off"/>
 <attribute name="PRECISION" value="" x="6.83" y="68.06" size="1.778" layer="27" rot="R180" display="off"/>
-<attribute name="VALUE" x="29.816" y="32.532" size="0.8128" layer="27" font="vector" rot="R180" align="center"/>
+<attribute name="VALUE" x="33.5" y="30.9" size="0.8128" layer="27" font="vector" rot="R180" align="center"/>
 </element>
 <element name="S1" library="passives" package="TACT-SWITCH-KMR6" value="2-8X4-5_SWITCH" x="38.2" y="25.6" smashed="yes" rot="R180"/>
 <element name="U1" library="microcontrollers" package="TQFP-32-FAB" value="ATSAMD21E18A-AFFAB" x="24.5" y="26" smashed="yes" rot="R270">
@@ -809,7 +809,7 @@ design rules under a new name.</description>
 <attribute name="NAME" x="32.3255" y="16.962" size="1.016" layer="25" rot="R270"/>
 <attribute name="PACKAGE" value="1206" x="31.5" y="16.2" size="1.778" layer="27" rot="R270" display="off"/>
 <attribute name="TYPE" value="" x="31.5" y="16.2" size="1.778" layer="27" rot="R270" display="off"/>
-<attribute name="VALUE" x="31.616" y="19.432" size="0.8128" layer="27" font="vector" rot="R180" align="center"/>
+<attribute name="VALUE" x="31.5" y="16.2" size="0.8128" layer="27" font="vector" rot="R180" align="center"/>
 <attribute name="VOLTAGE" value="" x="31.5" y="16.2" size="1.778" layer="27" rot="R270" display="off"/>
 </element>
 <element name="U3" library="power" package="SOT223" value="REGULATOR_SOT223" x="37.3" y="12.4" smashed="yes" rot="R270">
@@ -818,30 +818,30 @@ design rules under a new name.</description>
 <element name="U2" library="power" package="SOIC8_PAD_THRU_FAB" value="A4950FAB" x="8" y="24" smashed="yes" rot="R180">
 <attribute name="NAME" x="10.159" y="21.1425" size="1.27" layer="25" ratio="10" rot="R180"/>
 </element>
-<element name="R1" library="passives" package="1206" value="100mOhm" x="5" y="20" smashed="yes">
+<element name="R1" library="passives" package="1206" value="0R100" x="5" y="20" smashed="yes">
 <attribute name="NAME" x="3.73" y="21.143" size="1.016" layer="25"/>
 <attribute name="PACKAGE" value="1206" x="5" y="20" size="1.778" layer="27" display="off"/>
 <attribute name="PRECISION" value="" x="5" y="20" size="1.778" layer="27" display="off"/>
-<attribute name="VALUE" x="10.203" y="20.006" size="0.8128" layer="27" font="vector" align="center"/>
+<attribute name="VALUE" x="9.2" y="20" size="0.8128" layer="27" font="vector" align="center"/>
 </element>
 <element name="C3" library="passives" package="1206" value="10uF" x="6" y="28.5" smashed="yes">
 <attribute name="NAME" x="4.73" y="29.643" size="1.016" layer="25"/>
 <attribute name="PACKAGE" value="1206" x="6" y="28.5" size="1.778" layer="27" display="off"/>
 <attribute name="TYPE" value="" x="6" y="28.5" size="1.778" layer="27" display="off"/>
-<attribute name="VALUE" x="9.903" y="28.606" size="0.8128" layer="27" font="vector" align="center"/>
+<attribute name="VALUE" x="6" y="28.4" size="0.8128" layer="27" font="vector" rot="R90" align="center"/>
 <attribute name="VOLTAGE" value="" x="6" y="28.5" size="1.778" layer="27" display="off"/>
 </element>
 <element name="R4" library="passives" package="1206" value="120R" x="14.7" y="29.1" smashed="yes" rot="R180">
 <attribute name="NAME" x="15.97" y="27.957" size="1.016" layer="25" rot="R180"/>
 <attribute name="PACKAGE" value="1206" x="14.7" y="29.1" size="1.778" layer="27" rot="R180" display="off"/>
 <attribute name="PRECISION" value="" x="14.7" y="29.1" size="1.778" layer="27" rot="R180" display="off"/>
-<attribute name="VALUE" x="18.597" y="29.094" size="0.8128" layer="27" font="vector" rot="R180" align="center"/>
+<attribute name="VALUE" x="14.7" y="29.4" size="0.8128" layer="27" font="vector" rot="R270" align="center"/>
 </element>
 <element name="C5" library="passives" package="1206" value="0.1uF" x="14.7" y="26.6" smashed="yes">
 <attribute name="NAME" x="13.43" y="27.743" size="1.016" layer="25"/>
 <attribute name="PACKAGE" value="1206" x="14.7" y="26.6" size="1.778" layer="27" display="off"/>
 <attribute name="TYPE" value="" x="14.7" y="26.6" size="1.778" layer="27" display="off"/>
-<attribute name="VALUE" x="18.803" y="26.606" size="0.8128" layer="27" font="vector" align="center"/>
+<attribute name="VALUE" x="14.7" y="26.3" size="0.8128" layer="27" font="vector" rot="R90" align="center"/>
 <attribute name="VOLTAGE" value="" x="14.7" y="26.6" size="1.778" layer="27" display="off"/>
 </element>
 <element name="J2" library="SparkFun-Connectors" package="2X5-SHROUDED_SMD_LONGPADS" value="" x="14.5" y="8" smashed="yes" rot="R270">
@@ -851,30 +851,30 @@ design rules under a new name.</description>
 <element name="U4" library="power" package="SOIC8_PAD_THRU_FAB" value="A4950FAB" x="15" y="35" smashed="yes" rot="R180">
 <attribute name="NAME" x="17.159" y="32.1425" size="1.27" layer="25" ratio="10" rot="R180"/>
 </element>
-<element name="R5" library="passives" package="1206" value="100mOhm" x="10" y="33" smashed="yes" rot="R270">
+<element name="R5" library="passives" package="1206" value="0R100" x="10" y="33" smashed="yes" rot="R270">
 <attribute name="NAME" x="11.143" y="34.27" size="1.016" layer="25" rot="R270"/>
 <attribute name="PACKAGE" value="1206" x="19.5" y="42" size="1.778" layer="27" rot="R270" display="off"/>
 <attribute name="PRECISION" value="" x="19.5" y="42" size="1.778" layer="27" rot="R270" display="off"/>
-<attribute name="VALUE" x="13.803" y="31.806" size="0.8128" layer="27" font="vector" align="center"/>
+<attribute name="VALUE" x="12.9" y="31.5" size="0.8128" layer="27" font="vector" align="center"/>
 </element>
 <element name="C6" library="passives" package="1206" value="10uF" x="13" y="39" smashed="yes">
 <attribute name="NAME" x="11.73" y="40.143" size="1.016" layer="25"/>
 <attribute name="PACKAGE" value="1206" x="-1" y="48.5" size="1.778" layer="27" display="off"/>
 <attribute name="TYPE" value="" x="-1" y="48.5" size="1.778" layer="27" display="off"/>
-<attribute name="VALUE" x="13.103" y="40.906" size="0.8128" layer="27" font="vector" align="center"/>
+<attribute name="VALUE" x="13" y="39" size="0.8128" layer="27" font="vector" rot="R90" align="center"/>
 <attribute name="VOLTAGE" value="" x="-1" y="48.5" size="1.778" layer="27" display="off"/>
 </element>
 <element name="R6" library="passives" package="1206" value="120R" x="23" y="39" smashed="yes" rot="R180">
 <attribute name="NAME" x="24.27" y="37.857" size="1.016" layer="25" rot="R180"/>
 <attribute name="PACKAGE" value="1206" x="32" y="35.5" size="1.778" layer="27" rot="R180" display="off"/>
 <attribute name="PRECISION" value="" x="32" y="35.5" size="1.778" layer="27" rot="R180" display="off"/>
-<attribute name="VALUE" x="22.097" y="40.794" size="0.8128" layer="27" font="vector" rot="R180" align="center"/>
+<attribute name="VALUE" x="23" y="39.4" size="0.8128" layer="27" font="vector" rot="R270" align="center"/>
 </element>
 <element name="C8" library="passives" package="1206" value="0.1uF" x="23" y="36.5" smashed="yes">
 <attribute name="NAME" x="21.73" y="37.643" size="1.016" layer="25"/>
 <attribute name="PACKAGE" value="1206" x="5.5" y="28" size="1.778" layer="27" display="off"/>
 <attribute name="TYPE" value="" x="5.5" y="28" size="1.778" layer="27" display="off"/>
-<attribute name="VALUE" x="22.103" y="34.706" size="0.8128" layer="27" font="vector" align="center"/>
+<attribute name="VALUE" x="23" y="36" size="0.8128" layer="27" font="vector" rot="R270" align="center"/>
 <attribute name="VOLTAGE" value="" x="5.5" y="28" size="1.778" layer="27" display="off"/>
 </element>
 <element name="U$1" library="fablab" package="LED1206" value="LED" x="28.5" y="9.5" smashed="yes" rot="R270">
@@ -885,13 +885,13 @@ design rules under a new name.</description>
 <attribute name="NAME" x="29.643003125" y="5.269996875" size="1.016" layer="25" rot="R270"/>
 <attribute name="PACKAGE" value="1206" x="28.5" y="4" size="1.778" layer="27" rot="R270" display="off"/>
 <attribute name="PRECISION" value="" x="28.5" y="4" size="1.778" layer="27" rot="R270" display="off"/>
-<attribute name="VALUE" x="28.603003125" y="0.806" size="0.8128" layer="27" font="vector" align="center"/>
+<attribute name="VALUE" x="28.8" y="4" size="0.8128" layer="27" font="vector" align="center"/>
 </element>
 <element name="R7" library="passives" package="1206" value="0R" x="38.5" y="36" smashed="yes">
 <attribute name="NAME" x="37.23" y="37.143" size="1.016" layer="25"/>
 <attribute name="PACKAGE" value="1206" x="38.5" y="36" size="1.778" layer="27" display="off"/>
 <attribute name="PRECISION" value="" x="38.5" y="36" size="1.778" layer="27" display="off"/>
-<attribute name="VALUE" x="38.503" y="37.706" size="0.8128" layer="27" font="vector" align="center"/>
+<attribute name="VALUE" x="38.5" y="36" size="0.8128" layer="27" font="vector" rot="R90" align="center"/>
 </element>
 <element name="S2" library="passives" package="TACT-SWITCH-KMR6" value="2-8X4-5_SWITCH" x="32" y="23.3" smashed="yes" rot="R270"/>
 <element name="U$2" library="fablab" package="LED1206" value="LED" x="26" y="9.5" smashed="yes" rot="R270">
@@ -902,28 +902,26 @@ design rules under a new name.</description>
 <attribute name="NAME" x="27.143" y="5.27" size="1.016" layer="25" rot="R270"/>
 <attribute name="PACKAGE" value="1206" x="26" y="4" size="1.778" layer="27" rot="R270" display="off"/>
 <attribute name="PRECISION" value="" x="26" y="4" size="1.778" layer="27" rot="R270" display="off"/>
-<attribute name="VALUE" x="26.006" y="-0.003" size="0.8128" layer="27" font="vector" rot="R270" align="center"/>
+<attribute name="VALUE" x="25.6" y="4" size="0.8128" layer="27" font="vector" rot="R180" align="center"/>
 </element>
 <element name="U5" library="comm" package="8-MSOP-FAB" value="RS485-ISL83078EMSOP-FAB" x="19.2" y="17.1" smashed="yes" rot="R225">
 <attribute name="NAME" x="22.381975" y="17.453553125" size="0.8128" layer="25" font="vector" rot="R225"/>
-<attribute name="VALUE" x="19.55355" y="20.281978125" size="0.8128" layer="27" font="vector" rot="R225" align="top-left"/>
 </element>
 <element name="U6" library="comm" package="8-MSOP-FAB" value="RS485-ISL83078EMSOP-FAB" x="15.6" y="18.9" smashed="yes" rot="R225">
 <attribute name="NAME" x="18.781975" y="19.25355625" size="0.8128" layer="25" font="vector" rot="R225"/>
-<attribute name="VALUE" x="15.95355" y="22.08198125" size="0.8128" layer="27" font="vector" rot="R225" align="top-left"/>
 </element>
 <element name="C10" library="passives" package="1206" value="1uF" x="23.1" y="16.3" smashed="yes" rot="R45">
 <attribute name="NAME" x="21.393753125" y="16.210196875" size="1.016" layer="25" rot="R45"/>
 <attribute name="PACKAGE" value="1206" x="23.1" y="16.3" size="0.8128" layer="27" rot="R45" display="off"/>
 <attribute name="TYPE" value="" x="23.1" y="16.3" size="0.8128" layer="27" rot="R45" display="off"/>
-<attribute name="VALUE" x="24.08783125" y="13.3365125" size="1.016" layer="27" rot="R45"/>
+<attribute name="VALUE" x="23.2" y="16.2" size="0.8128" layer="27" font="vector" rot="R135" align="center"/>
 <attribute name="VOLTAGE" value="" x="23.1" y="16.3" size="0.8128" layer="27" rot="R45" display="off"/>
 </element>
 <element name="R11" library="passives" package="1206" value="0R" x="31.5" y="11" smashed="yes" rot="R90">
 <attribute name="NAME" x="30.357" y="9.73" size="1.016" layer="25" rot="R90"/>
 <attribute name="PACKAGE" value="1206" x="31.5" y="11" size="0.8128" layer="27" rot="R90" display="off"/>
 <attribute name="PRECISION" value="" x="31.5" y="11" size="0.8128" layer="27" rot="R90" display="off"/>
-<attribute name="VALUE" x="34.294" y="9.603" size="1.016" layer="27" rot="R90"/>
+<attribute name="VALUE" x="31.5" y="11" size="0.8128" layer="27" font="vector" rot="R180" align="center"/>
 </element>
 </elements>
 <signals>
diff --git a/2021-06_fab-step-ucbus/fab-step-ucbus.sch b/2021-06_fab-step-ucbus/fab-step-ucbus.sch
index b3920ed..8d6b02d 100644
--- a/2021-06_fab-step-ucbus/fab-step-ucbus.sch
+++ b/2021-06_fab-step-ucbus/fab-step-ucbus.sch
@@ -2563,7 +2563,7 @@ maximum frequency of 48MHz and reach 2.46 CoreMark®
 <part name="GND3" library="supply1" deviceset="GND" device=""/>
 <part name="U3" library="power" deviceset="REGULATOR_SOT223" device=""/>
 <part name="U2" library="power" deviceset="A4950" device="FAB"/>
-<part name="R1" library="passives" deviceset="RESISTOR" device="1206" value="100mOhm"/>
+<part name="R1" library="passives" deviceset="RESISTOR" device="1206" value="0R100"/>
 <part name="GND4" library="supply1" deviceset="GND" device=""/>
 <part name="GND5" library="supply1" deviceset="GND" device=""/>
 <part name="P+3" library="supply1" deviceset="+24V" device=""/>
@@ -2574,7 +2574,7 @@ maximum frequency of 48MHz and reach 2.46 CoreMark®
 <part name="GND10" library="supply1" deviceset="GND" device=""/>
 <part name="J2" library="SparkFun-Connectors" deviceset="CONN_05X2" device="SMD_LONGPADS"/>
 <part name="U4" library="power" deviceset="A4950" device="FAB"/>
-<part name="R5" library="passives" deviceset="RESISTOR" device="1206" value="100mOhm"/>
+<part name="R5" library="passives" deviceset="RESISTOR" device="1206" value="0R100"/>
 <part name="GND11" library="supply1" deviceset="GND" device=""/>
 <part name="GND12" library="supply1" deviceset="GND" device=""/>
 <part name="P+4" library="supply1" deviceset="+24V" device=""/>
diff --git a/fab-step-controller/src/main.cpp b/fab-step-controller/src/main.cpp
deleted file mode 100644
index 8e8f172..0000000
--- a/fab-step-controller/src/main.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-#include <Arduino.h>
-
-void setup() {
-  // put your setup code here, to run once:
-  PORT->Group[0].DIRSET.reg = (1 << 23);
-}
-
-void loop() {
-  // put your main code here, to run repeatedly:
-  PORT->Group[0].OUTSET.reg = (1 << 23);
-  delay(100);
-  PORT->Group[0].OUTCLR.reg = (1 << 23);
-  delay(100);
-}
\ No newline at end of file
diff --git a/fab-step-controller/.gitignore b/firmware/fab-step/.gitignore
similarity index 100%
rename from fab-step-controller/.gitignore
rename to firmware/fab-step/.gitignore
diff --git a/fab-step-controller/.vscode/extensions.json b/firmware/fab-step/.vscode/extensions.json
similarity index 100%
rename from fab-step-controller/.vscode/extensions.json
rename to firmware/fab-step/.vscode/extensions.json
diff --git a/fab-step-controller/include/README b/firmware/fab-step/include/README
similarity index 100%
rename from fab-step-controller/include/README
rename to firmware/fab-step/include/README
diff --git a/fab-step-controller/lib/README b/firmware/fab-step/lib/README
similarity index 100%
rename from fab-step-controller/lib/README
rename to firmware/fab-step/lib/README
diff --git a/fab-step-controller/platformio.ini b/firmware/fab-step/platformio.ini
similarity index 100%
rename from fab-step-controller/platformio.ini
rename to firmware/fab-step/platformio.ini
diff --git a/firmware/fab-step/src/config.h b/firmware/fab-step/src/config.h
new file mode 100644
index 0000000..53df0cd
--- /dev/null
+++ b/firmware/fab-step/src/config.h
@@ -0,0 +1,3 @@
+// head or drop on the bus 
+//#define UCBUS_IS_HEAD
+#define UCBUS_IS_DROP
\ No newline at end of file
diff --git a/firmware/fab-step/src/drivers/step_a4950.cpp b/firmware/fab-step/src/drivers/step_a4950.cpp
new file mode 100644
index 0000000..244a8f2
--- /dev/null
+++ b/firmware/fab-step/src/drivers/step_a4950.cpp
@@ -0,0 +1,133 @@
+/*
+drivers/step_a4950.cpp
+
+stepper code for two A4950s w/ VREF via TC -> RC Filters 
+
+Jake Read at the Center for Bits and Atoms
+(c) Massachusetts Institute of Technology 2021
+
+This work may be reproduced, modified, distributed, performed, and
+displayed for any purpose, but must acknowledge the squidworks and ponyo
+projects. Copyright is retained and must be preserved. The work is provided as
+is; no warranty is provided, and users accept all liability.
+*/
+
+#include "step_a4950.h"
+
+// LUT, 0-1022, 64 entries, sin w/ 511 at midpoint 
+uint16_t LUT_1022[64] = {
+    511,561,611,659,707,752,795,835,872,906,936,962,983,1000,1012,1020,
+    1022,1020,1012,1000,983,962,936,906,872,835,795,752,707,659,611,561,
+    511,461,411,363,315,270,227,187,150,116,86,60,39,22,10,2,
+    0,2,10,22,39,60,86,116,150,187,227,270,315,363,411,461,
+};
+
+uint16_t LUT_CURRENTS[64];
+
+// startup stepper hardware 
+void step_a4950_init(void){
+    // all of 'em, outputs 
+    AIN1_PORT.DIRSET.reg = AIN1_BM;
+    AIN2_PORT.DIRSET.reg = AIN2_BM;
+    BIN1_PORT.DIRSET.reg = BIN1_BM;
+    BIN2_PORT.DIRSET.reg = BIN2_BM;
+    // setup DAC for CHB (dac is 10 bit)
+    DAC->CTRLA.bit.ENABLE = 0;
+    DAC->CTRLB.reg |= DAC_CTRLB_REFSEL_INT1V; // I think this is 3v3, not sure 
+    DAC->CTRLA.bit.ENABLE = 1;
+    // setup TCC0-1 / PA05 
+    // set pin as output, 
+    AVREF_PORT.DIRSET.reg = AVREF_BM;
+    // mux pin onto peripheral, it's peripheral E, and *odd numbered pin* 
+    AVREF_PORT.PINCFG[AVREF_PIN].reg |= PORT_PINCFG_PMUXEN;
+    AVREF_PORT.PMUX[AVREF_PIN >> 1].reg = PORT_PMUX_PMUXO_E;
+    // s/o https://blog.thea.codes/phase-shifted-pwm-on-samd/ 
+    // unmask the peripheral, 
+    PM->APBCMASK.reg |= PM_APBCMASK_TCC0;
+    // route this clk (on 0) to our peripheral 
+    GCLK->CLKCTRL.reg =  GCLK_CLKCTRL_CLKEN |       // (?)
+                         GCLK_CLKCTRL_GEN_GCLK0 |   // select 0: already generated main clk
+                         GCLK_CLKCTRL_ID_TCC0_TCC1; // route to TCC0 / TCC1  
+    while(GCLK->STATUS.bit.SYNCBUSY);
+    // prescaler: we will probably go very fast, for now I want to see it 
+    TCC0->CTRLA.reg |= TCC_CTRLA_PRESCALER_DIV1;    
+    TCC0->WAVE.reg = TCC_WAVE_WAVEGEN_NPWM;
+    while(TCC0->SYNCBUSY.bit.WAVE);
+    TCC0->PER.reg = 128;
+    while(TCC0->SYNCBUSY.bit.PER);
+    TCC0->CC[1].reg = 0;
+    TCC0->CTRLA.bit.ENABLE = 1;
+    // now, setup current table, default to 0.0 (disabled).
+    step_a4950_set_cscale(0.0F);
+    // push a step to init up/down states 
+    step_a4950_step();
+}
+
+// to set scale, we write a new LUT, this avoids math-in-the-step-tick, 
+void step_a4950_set_cscale(float scale){
+    // scale max 1.0, min 0.0,
+    if(scale > 1.0F) scale = 1.0F;
+    if(scale < 0.0F) scale = 0.0F;
+    // for each item in the LUTs,
+    for(uint8_t i = 0; i < 64; i ++){
+        if(LUT_1022[i] > 511){
+            // top half, no invert, but shift-down and scale 
+            LUT_CURRENTS[i] = (LUT_1022[i] - 511) * 2.0F * scale;
+        } else if (LUT_1022[i] < 511){
+            // lower half, invert and shift down 
+            float temp = LUT_1022[i];   // get lut as float, 
+            temp = (temp * -2.0F + 1022) * scale; // scale (flipping) and offset back up 
+            LUT_CURRENTS[i] = temp; // set table element, 
+        } else {
+            // the midpoint: off, 
+            LUT_CURRENTS[i] = 0;
+        }
+    }
+}
+
+// step states
+boolean _dir = true;        // current direction 
+boolean _dirInvert = false; // invert directions ?
+uint8_t lutptra = 16;       // current pt. in microstep phase 
+uint8_t lutptrb = 0;        // A leads B by 1/4 period 
+
+uint8_t cntr = 0;
+
+void step_a4950_step(){
+    // step LUT ptrs thru table, 
+    if(_dir){
+        lutptra ++; if(lutptra >= 64) lutptra = 0;
+        lutptrb ++; if(lutptrb >= 64) lutptrb = 0;
+    } else {
+        (lutptra == 0) ? lutptra = 63 : lutptra --;
+        (lutptrb == 0) ? lutptrb = 63 : lutptrb --;
+    }
+    // depending on sign of phase, set up / down on gates 
+    if(LUT_1022[lutptra] > 511){
+        A_UP;
+    } else if (LUT_1022[lutptra] < 511){
+        A_DOWN;
+    } else {
+        A_OFF;
+    }
+    if(LUT_1022[lutptrb] > 511){
+        B_UP;
+    } else if (LUT_1022[lutptrb] < 511){
+        B_DOWN;
+    } else {
+        B_OFF;
+    }
+    // set vref currents: this is messy at this rev we have DAC and TC, should be two TCs
+    // that was a circuit bug: note division as well, >> 3 is removing smallest 3 bits 
+    TCC0->CC[1].reg = LUT_CURRENTS[lutptra] >> 3;   // TC resolution is 0-128   (7 bit)
+    DAC->DATA.reg = LUT_CURRENTS[lutptrb];          // DAC resolution is 0-1024 (10 bit)
+}
+
+// set direction 
+void step_a4950_dir(boolean dir){
+    if(_dirInvert){
+        _dir = !dir;
+    } else {
+        _dir = dir;
+    }
+}
\ No newline at end of file
diff --git a/firmware/fab-step/src/drivers/step_a4950.h b/firmware/fab-step/src/drivers/step_a4950.h
new file mode 100644
index 0000000..3f1736b
--- /dev/null
+++ b/firmware/fab-step/src/drivers/step_a4950.h
@@ -0,0 +1,68 @@
+/*
+drivers/step_a4950.h
+
+stepper code for two A4950s w/ VREF via TC -> RC Filters 
+
+Jake Read at the Center for Bits and Atoms
+(c) Massachusetts Institute of Technology 2021
+
+This work may be reproduced, modified, distributed, performed, and
+displayed for any purpose, but must acknowledge the squidworks and ponyo
+projects. Copyright is retained and must be preserved. The work is provided as
+is; no warranty is provided, and users accept all liability.
+*/
+
+#ifndef STEP_A4950_H_
+#define STEP_A4950_H_
+
+#include <arduino.h> 
+
+// AIN1 PA06
+// AIN2 PA07 
+// BIN1 PA03 
+// BIN2 PA04 
+#define AIN1_PIN 6
+#define AIN1_PORT PORT->Group[0]
+#define AIN1_BM (uint32_t)(1 << AIN1_PIN)
+#define AIN2_PIN 7
+#define AIN2_PORT PORT->Group[0]
+#define AIN2_BM (uint32_t)(1 << AIN2_PIN)
+#define BIN1_PIN 3 
+#define BIN1_PORT PORT->Group[0]
+#define BIN1_BM (uint32_t)(1 << BIN1_PIN)
+#define BIN2_PIN 4 
+#define BIN2_PORT PORT->Group[0] 
+#define BIN2_BM (uint32_t)(1 << BIN2_PIN)
+
+// handles
+#define AIN1_HI AIN1_PORT.OUTSET.reg = AIN1_BM
+#define AIN1_LO AIN1_PORT.OUTCLR.reg = AIN1_BM
+#define AIN2_HI AIN2_PORT.OUTSET.reg = AIN2_BM
+#define AIN2_LO AIN2_PORT.OUTCLR.reg = AIN2_BM 
+#define BIN1_HI BIN1_PORT.OUTSET.reg = BIN1_BM
+#define BIN1_LO BIN1_PORT.OUTCLR.reg = BIN1_BM
+#define BIN2_HI BIN2_PORT.OUTSET.reg = BIN2_BM
+#define BIN2_LO BIN2_PORT.OUTCLR.reg = BIN2_BM
+
+// set a phase up or down direction
+// transition low first, avoid brake condition for however many ns 
+#define A_UP AIN2_LO; AIN1_HI
+#define A_OFF AIN2_LO; AIN1_LO
+#define A_DOWN AIN1_LO; AIN2_HI
+#define B_UP BIN2_LO; BIN1_HI 
+#define B_OFF BIN2_LO; BIN1_LO
+#define B_DOWN BIN1_LO; BIN2_HI
+
+// BVREF via PA02 / DAC
+// AVREF via PA05 / TCC0-1 RC Filt 
+
+#define AVREF_PIN 5
+#define AVREF_PORT PORT->Group[0] 
+#define AVREF_BM (uint32_t)(1 << AVREF_PIN)
+
+void step_a4950_init(void);
+void step_a4950_set_cscale(float scale);
+void step_a4950_step();
+void step_a4950_dir(boolean dir);
+
+#endif 
\ No newline at end of file
diff --git a/firmware/fab-step/src/indicators.h b/firmware/fab-step/src/indicators.h
new file mode 100644
index 0000000..29eff40
--- /dev/null
+++ b/firmware/fab-step/src/indicators.h
@@ -0,0 +1,29 @@
+// circuit specific indicators: D21 fab-step, w/ ucbus interface 
+
+// PA23
+#define CLKLIGHT_PIN 23
+#define CLKLIGHT_PORT PORT->Group[0]
+#define CLKLIGHT_BM (uint32_t)(1 << CLKLIGHT_PIN)
+#define CLKLIGHT_ON CLKLIGHT_PORT.OUTSET.reg = CLKLIGHT_BM
+#define CLKLIGHT_OFF CLKLIGHT_PORT.OUTCLR.reg = CLKLIGHT_BM
+#define CLKLIGHT_TOGGLE CLKLIGHT_PORT.OUTTGL.reg = CLKLIGHT_BM
+#define CLKLIGHT_SETUP CLKLIGHT_PORT.DIRSET.reg = CLKLIGHT_BM; CLKLIGHT_OFF
+
+// PA22
+#define BUSLIGHT_PIN 22
+#define BUSLIGHT_PORT PORT->Group[0]
+#define BUSLIGHT_BM (uint32_t)(1 << BUSLIGHT_PIN)
+#define BUSLIGHT_ON BUSLIGHT_PORT.OUTSET.reg = BUSLIGHT_BM
+#define BUSLIGHT_OFF BUSLIGHT_PORT.OUTCLR.reg = BUSLIGHT_BM
+#define BUSLIGHT_TOGGLE BUSLIGHT_PORT.OUTTGL.reg = BUSLIGHT_BM
+#define BUSLIGHT_SETUP BUSLIGHT_PORT.DIRSET.reg = BUSLIGHT_BM; BUSLIGHT_OFF
+
+// probably would use the limit conn, that's 
+// PA03
+#define DEBUG1PIN_PIN 3
+#define DEBUG1PIN_PORT PORT->Group[0]
+#define DEBUG1PIN_BM (uint32_t)(1 << DEBUG1PIN_PIN)
+#define DEBUG1PIN_ON DEBUG1PIN_PORT.OUTSET.reg = DEBUG1PIN_BM
+#define DEBUG1PIN_OFF DEBUG1PIN_PORT.OUTCLR.reg = DEBUG1PIN_BM
+#define DEBUG1PIN_TOGGLE DEBUG1PIN_PORT.OUTTGL.reg = DEBUG1PIN_BM
+#define DEBUG1PIN_SETUP DEBUG1PIN_PORT.DIRSET.reg = DEBUG1PIN_BM; DEBUG1PIN_OFF
diff --git a/firmware/fab-step/src/main.cpp b/firmware/fab-step/src/main.cpp
new file mode 100644
index 0000000..b2e54a4
--- /dev/null
+++ b/firmware/fab-step/src/main.cpp
@@ -0,0 +1,75 @@
+#include <Arduino.h>
+#include "indicators.h"
+#include "config.h"
+//#include "drivers/ucBusHead.h"
+//#include "drivers/step_a4950.h"
+//#include "osape-d21/osape/osap/osap.h"
+//#include "osape-d21/vertices/vt_usbSerial.h"
+
+#include "osape-d21/vertices/ucBusDrop.h"
+
+/*
+// -------------------------------------------------------- Dummy
+
+vertex_t* spiBusDummy = osapBuildEndpoint("spiDummy", nullptr, nullptr);
+
+// -------------------------------------------------------- Axis Pick
+
+boolean onAxisPickData(uint8_t* data, uint16_t len){
+  ERRLIGHT_TOGGLE;
+  return true;
+}
+
+vertex_t* axisPickEp = osapBuildEndpoint("axisPick", onAxisPickData, nullptr);
+
+// -------------------------------------------------------- Axis Invert
+
+vertex_t* axisInvertEp = osapBuildEndpoint("axisInvert", nullptr, nullptr);
+
+// -------------------------------------------------------- SPU
+
+vertex_t* spuEp = osapBuildEndpoint("steps per unit", nullptr, nullptr);
+
+// -------------------------------------------------------- CScale 
+
+vertex_t* cScaleEp = osapBuildEndpoint("currentScale", nullptr, nullptr);
+
+// -------------------------------------------------------- Homing
+
+*/
+
+// -------------------------------------------------------- SETUP
+
+void setup() {
+  CLKLIGHT_SETUP;
+  BUSLIGHT_SETUP;
+  DEBUG1PIN_SETUP;
+  // osap setup...
+  // osapSetup();
+  ucBusDrop_setup(2);
+  // startup stepper HW 
+  // step_a4950_init();
+  // step_a4950_set_cscale(0.25F);
+  // startup 1st vertex as usbserial entrance, 
+  //vt_usbSerial_setup();
+  //osapAddVertex(vt_usbSerial);    // 0
+  //osapAddVertex(spiBusDummy);     // 1 
+  //osapAddVertex(axisPickEp);      // 2 
+  //osapAddVertex(axisInvertEp);    // 3 
+}
+
+// -------------------------------------------------------- LOOP 
+
+#define CLK_TICK 100
+unsigned long last_tick = 0;
+
+void loop() {
+  // do osap things, 
+  // osapLoop();
+  // blink 
+  if(millis() > last_tick + CLK_TICK){
+    //step_a4950_step();
+    CLKLIGHT_TOGGLE;
+    last_tick = millis();
+  }
+}
\ No newline at end of file
diff --git a/firmware/fab-step/src/osape-d21 b/firmware/fab-step/src/osape-d21
new file mode 160000
index 0000000..c69fc0f
--- /dev/null
+++ b/firmware/fab-step/src/osape-d21
@@ -0,0 +1 @@
+Subproject commit c69fc0fdf12b697c8e1658accdf6832197691aa8
diff --git a/firmware/fab-step/src/syserror.cpp b/firmware/fab-step/src/syserror.cpp
new file mode 100644
index 0000000..cd75815
--- /dev/null
+++ b/firmware/fab-step/src/syserror.cpp
@@ -0,0 +1,92 @@
+#include "syserror.h"
+#include "config.h"
+//#include "../../drivers/indicators.h"
+#include "osape-d21/osape/osap/ts.h"
+#include "osape-d21/osape/utils/cobs.h"
+
+uint8_t errBuf[1028];
+uint8_t errEncoded[1028];
+
+/*
+boolean writeString(unsigned char* dest, uint16_t* dptr, String msg){
+  uint16_t len = msg.length();
+  dest[(*dptr) ++] = TS_STRING_KEY;
+  writeLenBytes(dest, dptr, len);
+  msg.getBytes(dest, len + 1);
+  return true;
+}
+
+boolean writeLenBytes(unsigned char* dest, uint16_t* dptr, uint16_t len){
+  dest[(*dptr) ++] = len;
+  dest[(*dptr) ++] = (len >> 8) & 255;
+  return true;
+}
+*/
+
+#ifdef SPIPHY_IS_DROP
+
+//uint8_t escape[512];
+//uint8_t escapeHeader[10] = { PK_BUSF_KEY, 0, 0, 0, 0, PK_PTR, PK_PORTF_KEY, 0, 0, PK_DEST };
+
+// config-your-own-ll-escape-hatch
+void sysError(String msg){
+  //ERRLIGHT_ON;
+  /*
+  uint32_t len = msg.length();
+  errBuf[0] = PK_LLERR; // the ll-errmsg-key
+  errBuf[1] = len & 255;
+  errBuf[2] = (len >> 8) & 255;
+  errBuf[3] = (len >> 16) & 255;
+  errBuf[4] = (len >> 24) & 255;
+  msg.getBytes(&(errBuf[5]), len + 1);
+  // write header, 
+  memcpy(escape, escapeHeader, 10);
+  // write segsize, checksum 
+  uint16_t wptr = 10;
+  ts_writeUint16(128, escape, &wptr);
+  ts_writeUint16(len + 5, escape, &wptr);
+  memcpy(&(escape[wptr]), errBuf, len + 5);
+  // transmit on ucbus 
+  // potential here to hang-up and do while(!(ucBusDrop->cts())) ... I *think* that would clear on an interrupt
+  ucBusDrop->transmit(escape, len + wptr + 5);
+  */
+}
+
+#else 
+
+// config-your-own-ll-escape-hatch
+void sysError(String msg){
+  // escape this message w/ whatever low level device you have... 
+  // could be i.e. OLED write, here is serial print 
+  uint32_t len = msg.length();
+  errBuf[0] = 0; // serport looks for acks in each msg, this is not one
+  errBuf[1] = PK_PTR; 
+  errBuf[2] = PK_LLESCAPE_KEY; // the ll-errmsg-key
+  errBuf[3] = len & 255;
+  errBuf[4] = (len >> 8) & 255;
+  errBuf[5] = (len >> 16) & 255;
+  errBuf[6] = (len >> 24) & 255;
+  msg.getBytes(&(errBuf[7]), len + 1);
+  size_t ecl = cobsEncode(errBuf, len + 7, errEncoded);
+  // direct escape 
+  //if(Serial.availableForWrite() > (int64_t)ecl){
+    Serial.write(errEncoded, ecl);
+    Serial.flush();
+  //} else {
+  //  ERRLIGHT_ON;
+  //}
+}
+
+#endif 
+
+void logPacket(uint8_t* pck, uint16_t len){
+  String errmsg;
+  errmsg.reserve(1024);
+  errmsg = "pck: "; // max 64 
+  for(uint8_t i = 0; i < 64; i ++){
+    if(i >= len) break;
+    errmsg += String(pck[i]);
+    errmsg += ", ";
+  }
+  sysError(errmsg);
+}
\ No newline at end of file
diff --git a/firmware/fab-step/src/syserror.h b/firmware/fab-step/src/syserror.h
new file mode 100644
index 0000000..1b47d7a
--- /dev/null
+++ b/firmware/fab-step/src/syserror.h
@@ -0,0 +1,10 @@
+#ifndef SYSERROR_H_
+#define SYSERROR_H_
+
+#include <arduino.h>
+
+void sysError(String msg);
+void logPacket(uint8_t* pck, uint16_t len);
+//void sysError(uint8_t* bytes, uint16_t len);
+
+#endif
diff --git a/fab-step-controller/test/README b/firmware/fab-step/test/README
similarity index 100%
rename from fab-step-controller/test/README
rename to firmware/fab-step/test/README
-- 
GitLab