From 3741f29c9005fe1232cf262286a3b1fec1de676f Mon Sep 17 00:00:00 2001
From: Jake Read <jake.read@cba.mit.edu>
Date: Thu, 18 Nov 2021 16:32:08 -0500
Subject: [PATCH] concludes d21 d51 bus align

---
 2020-06_ucbus-stepper-melted/eagle.epf | 21 ++++++++++-----------
 firmware/stepper-drop/src/config.h     |  5 +++++
 firmware/stepper-drop/src/main.cpp     |  2 +-
 firmware/stepper-drop/src/osape-d51    |  2 +-
 4 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/2020-06_ucbus-stepper-melted/eagle.epf b/2020-06_ucbus-stepper-melted/eagle.epf
index ddffdca..c6124db 100644
--- a/2020-06_ucbus-stepper-melted/eagle.epf
+++ b/2020-06_ucbus-stepper-melted/eagle.epf
@@ -265,7 +265,6 @@ UsedLibraryUrn="urn:adsk.eagle:library:196"
 UsedLibraryUrn="urn:adsk.eagle:library:197"
 UsedLibraryUrn="urn:adsk.eagle:library:198"
 UsedLibraryUrn="urn:adsk.eagle:library:199"
-UsedLibrary="C:/Dropbox/CBA/circuits/eagle/parts/810-22-003-40-005191.lbr"
 UsedLibrary="C:/Dropbox/CBA/circuits/eagle/parts/comm.lbr"
 UsedLibrary="C:/Dropbox/CBA/circuits/eagle/parts/connector.lbr"
 UsedLibrary="C:/Dropbox/CBA/circuits/eagle/parts/dfet.lbr"
@@ -285,8 +284,8 @@ UsedLibrary="C:/Dropbox/CBA/circuits/eagle/parts/usbraw.lbr"
 [Win_1]
 Type="Schematic Editor"
 Number=1
-File="2020-06_ucbus-stepper-melted.sch"
-View="142.399 22.4818 328.676 123.78"
+File="C:/dropbox/cba/advisory/bhutan/2021-09-14_lora/2021-07-20_loRA-jake.sch"
+View="32.1497 9.16998 132.794 77.8767"
 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"
@@ -325,20 +324,20 @@ ArcDirection=0
 AddLevel=2
 PadsSameType=0
 Layer=91
-Views=" 1: 142.399 22.4818 328.676 123.78"
+Views=" 1: 32.1497 9.16998 132.794 77.8767"
 Sheet="1"
 
 [Win_2]
 Type="Board Editor"
 Number=2
-File="2020-06_ucbus-stepper-melted.brd"
-View="8.9747 13.925 33.6679 40.1306"
+File="C:/dropbox/cba/advisory/bhutan/2021-09-14_lora/2021-07-20_loRA-jake.brd"
+View="12.7615 -1.4366 44.9353 36.7389"
 WireWidths=" 0.8 0.9 0.1 0.05 0.5 0 0.3 0.2032 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"
+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.9 1 0.6 0.85"
 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.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 1 0.35 0.4 0.3"
-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"
+ViaDrills=" 0.2 0.25 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.9 1 0.35 0.4 0.3 0.85"
+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.9 1 0.35 0.85"
 TextSizes=" 0.254 0.3048 0.4064 0.6096 0.8128 1.27 1.4224 1.6764 1.9304 2.1844 2.54 3.81 5.08 6.4516 1.778 1.016"
 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"
@@ -348,7 +347,7 @@ 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=3
+WireBend=1
 WireBendSet=0
 WireCap=1
 MiterStyle=1
@@ -370,7 +369,7 @@ SwapLevel=0
 ArcDirection=0
 AddLevel=2
 PadsSameType=0
-Layer=15
+Layer=1
 
 [Win_3]
 Type="Control Panel"
diff --git a/firmware/stepper-drop/src/config.h b/firmware/stepper-drop/src/config.h
index fea257a..05c5713 100644
--- a/firmware/stepper-drop/src/config.h
+++ b/firmware/stepper-drop/src/config.h
@@ -4,11 +4,16 @@
 
 // for the bus: head, or drop? 
 //#define UCBUS_IS_HEAD
+// *genuine* max is 63 ! 
+#define UCBUS_MAX_DROPS 32
 #define UCBUS_IS_DROP
 // and D21 or D51?
 #define UCBUS_IS_D51
 //#define UCBUS_IS_D21 
 
+// 3, 2, or 1 MBaud: 
+#define UCBUS_BAUD 2
+
 // if you're using the 'module board' https://gitlab.cba.mit.edu/jakeread/ucbus-module
 // the first (og) revision has an SMT header, and some of the RS485 pins are varied, 
 // set this flag. otherwise, if you have thru-hole JTAG header, comment it out 
diff --git a/firmware/stepper-drop/src/main.cpp b/firmware/stepper-drop/src/main.cpp
index e82c36d..64702ea 100644
--- a/firmware/stepper-drop/src/main.cpp
+++ b/firmware/stepper-drop/src/main.cpp
@@ -158,7 +158,7 @@ void setup() {
   // ports 
   vt_usbSerial_setup();
   osapAddVertex(vt_usbSerial);    // 0
-  vt_ucBusDrop_setup();
+  vt_ucBusDrop_setup(true, 0);
   osapAddVertex(vt_ucBusDrop);    // 1
   // axis pick 
   osapAddVertex(axisPickEp);      // 2
diff --git a/firmware/stepper-drop/src/osape-d51 b/firmware/stepper-drop/src/osape-d51
index 0ae34dd..2306433 160000
--- a/firmware/stepper-drop/src/osape-d51
+++ b/firmware/stepper-drop/src/osape-d51
@@ -1 +1 @@
-Subproject commit 0ae34dd7e5bca95f22725a970c2c2eb69e55ddb2
+Subproject commit 23064339e200c3819af8bc55988b57d3eaa28a2e
-- 
GitLab