Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 29 additions & 22 deletions boards/SonarArrayBoard/SonarArrayBoard.spin2
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

{ Version History }
{
23-March-2025: Added support for Comm Port and Debug Port
18-March-2025: Changed units to mm instead of cm for Sonars
}

Expand All @@ -17,10 +18,13 @@ CON { IO-Comms }

RX_DEBUG = 63
TX_DEBUG = 62
RX_COMM = 0
TX_COMM = 1

CON { Comms Constants }

BAUDRATE_DEBUG = 115_200
BAUDRATE_COMM = 115_200

CON { Sonar Constants }
PIN_SONAR1 = 46
Expand All @@ -45,7 +49,8 @@ VAR { Sensor Variables }


OBJ
term : "jm_fullduplexserial" 'ref: https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/jm_full_duplex_serial
comm_debug : "jm_fullduplexserial" 'ref: https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/jm_full_duplex_serial
comm_board : "jm_fullduplexserial" 'ref: https://github.com/parallaxinc/propeller/tree/master/libraries/community/p2/All/jm_full_duplex_serial
ping : "jm_ping"

PUB init()
Expand Down Expand Up @@ -90,10 +95,11 @@ PUB run_medium_loop()


PUB run_slow_loop()
send_debug()
slow_loop_counter++

PUB run_veryslow_loop()
send_debug()


veryslow_loop_counter++

Expand All @@ -106,29 +112,30 @@ PUB init_variables()

PUB setup_comms()

term.start(RX_DEBUG, TX_DEBUG, %0000, BAUDRATE_DEBUG)
comm_debug.start(RX_DEBUG, TX_DEBUG, %0000, BAUDRATE_DEBUG)
comm_board.start(RX_COMM, TX_COMM, %0000, BAUDRATE_COMM)
PUB send_sonar_packet()

term.str(string("$AA"))
term.fxdec(sequence_number,4)
term.fxdec(1,2) ' Only 1 Sonar supported currently
term.fxdec(distance1_mm,4)
term.str(string(10,13))
comm_board.str(string("$AA"))
comm_board.fxdec(sequence_number,4)
comm_board.fxdec(1,2) ' Only 1 Sonar supported currently
comm_board.fxdec(distance1_mm,4)
comm_board.str(string(10,13))
if sequence_number >= 9999
sequence_number := 0
else
sequence_number++


PUB send_dummy_sonar_packet()
term.str(string("$AA")) ' Packet Header
term.fxdec(sequence_number,4) ' Sequence Number
term.fxdec(max_number_sonars,2) ' Max Number of Sonars
comm_board.str(string("$AA")) ' Packet Header
comm_board.fxdec(sequence_number,4) ' Sequence Number
comm_board.fxdec(max_number_sonars,2) ' Max Number of Sonars
repeat MAX_NUMBER_SONARS
term.fxdec(fakedistance_cm,4) ' Max Sonar Value
comm_board.fxdec(fakedistance_cm,4) ' Max Sonar Value


term.str(string(10,13))
comm_board.str(string(10,13))
if sequence_number >= 9999
sequence_number := 0
else
Expand All @@ -140,15 +147,15 @@ PUB send_dummy_sonar_packet()
fakedistance_cm++

PUB send_debug()
term.str(string("Fast:"))
term.dec(fast_loop_counter)
term.str(string(" Med: "))
term.dec(medium_loop_counter)
term.str(string(" Slow: "))
term.dec(slow_loop_counter)
term.str(string(" Very Slow: "))
term.dec(veryslow_loop_counter)
term.str(string(10,13))
comm_debug.str(string("Fast:"))
comm_debug.dec(fast_loop_counter)
comm_debug.str(string(" Med: "))
comm_debug.dec(medium_loop_counter)
comm_debug.str(string(" Slow: "))
comm_debug.dec(slow_loop_counter)
comm_debug.str(string(" Very Slow: "))
comm_debug.dec(veryslow_loop_counter)
comm_debug.str(string(10,13))

PUB read_sonars()
distance1_mm := ping.millimeters(PIN_SONAR1)
38 changes: 35 additions & 3 deletions doc/Boards/ConnectBoard/ConnectBoard.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,44 @@
# Connect Board
The Connect Board provides the GPIO connections necessary to connect multiple Sonar's to the Parallax Propeller.

## ToDo List
| Status | ToDo |
| --- | --- |
| OK | Check Shunt Size/Footprint |
| OK | Resistor Footprint |
| OK | Board Mounting Holes |
| OK | Prop Pin Connection Names |
| OK | Fine tune Footprint connections to Edge Breakout Board |
| OK | Verify Footprint: 2 x 6 Connector |
| OK | Verify Footprint: Resistor |
| | Fix Edge Switches to run content even if debug port is connected at startup |
| OK | Change individual resistors to resistor array |
| OK | Fix silkscreen |
| | PCB Manufacturer ERC Rules |
| | Verify Standoff/Height connection (include check for DC Barrel Jack)
| | Test Print PCB |

## Bill Of Materials
| On-Hand? | Part | Quantity | Description |
| --- | --- | --- | --- |
| YES | 1x3 Vertical Header-Male | 27 | Headers for Sonars and PS Connections |
| NO | 2x6 Vertical Header-Female | 3 | Headers for Propeller 2 |
| YES | 1x4 Vertical Header-Male | 1 | Prop Plug Comm Port |
| NO | M3x? Standoff | 3 | Standoffs for Sonar Connect Board |
| NO | 4 Resistor 8pin DIP Network Isolated | 6 | Resistor Network. Can substitute for 3 16pin DIP 8 Resistors package. [part](https://www.bourns.com/docs/Product-Datasheets/4100R.pdf) |

## Requirements
| Requirement | Description |
| --- | --- |
| Connect up to 24 Sonars | GPIO connection for up to 24 Sonars |
| Propeller Pin Protection | 4.7k Ohm Resistor on every Sonar Signal Pin. |
| Connect groups of 4 Sonars | 6 Banks of 4 Sonars |
| Signal protection disable resistor | Able to disable signal protection resistor per 4-bank |
| Connect groups of 4 Sonars | 3 Banks of 8 Sonars |
| Signal protection disable resistor | Able to disable signal protection resistor per 8-bank |
| Secure connection | Secure connection to Propeller 2 |
| 3.3V/5V Select | Jumper selector for each 4-bank |
| 3.3V/5V Select | Jumper selector for each 8-bank |
| Comm Port | Has 4-pin comm port connection to Raspeberry Pi |

## Electrical Design
![](elec/ConnectBoard/ConnectBoard.png)
- [Connect Board Schematic](elec/ConnectBoard/ConnectBoardSchematic.pdf)
- [Connect Board PCB](elec/ConnectBoard/ConnectBoardPCB.pdf)
144 changes: 144 additions & 0 deletions doc/Boards/ConnectBoard/elec/ConnectBoard/ConnectBoard-cache.lib
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
EESchema-LIBRARY Version 2.4
#encoding utf-8
#
# Connector_Conn_01x03_Male
#
DEF Connector_Conn_01x03_Male J 0 40 Y N 1 F N
F0 "J" 0 200 50 H V C CNN
F1 "Connector_Conn_01x03_Male" 0 -200 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*_1x??_*
$ENDFPLIST
DRAW
S 34 -95 0 -105 1 1 6 F
S 34 5 0 -5 1 1 6 F
S 34 105 0 95 1 1 6 F
P 2 1 1 6 50 -100 34 -100 N
P 2 1 1 6 50 0 34 0 N
P 2 1 1 6 50 100 34 100 N
X Pin_1 1 200 100 150 L 50 50 1 1 P
X Pin_2 2 200 0 150 L 50 50 1 1 P
X Pin_3 3 200 -100 150 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Connector_Conn_01x04_Male
#
DEF Connector_Conn_01x04_Male J 0 40 Y N 1 F N
F0 "J" 0 200 50 H V C CNN
F1 "Connector_Conn_01x04_Male" 0 -300 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*_1x??_*
$ENDFPLIST
DRAW
S 34 -195 0 -205 1 1 6 F
S 34 -95 0 -105 1 1 6 F
S 34 5 0 -5 1 1 6 F
S 34 105 0 95 1 1 6 F
P 2 1 1 6 50 -200 34 -200 N
P 2 1 1 6 50 -100 34 -100 N
P 2 1 1 6 50 0 34 0 N
P 2 1 1 6 50 100 34 100 N
X Pin_1 1 200 100 150 L 50 50 1 1 P
X Pin_2 2 200 0 150 L 50 50 1 1 P
X Pin_3 3 200 -100 150 L 50 50 1 1 P
X Pin_4 4 200 -200 150 L 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Connector_Generic_Conn_02x06_Odd_Even
#
DEF Connector_Generic_Conn_02x06_Odd_Even J 0 40 Y N 1 F N
F0 "J" 50 300 50 H V C CNN
F1 "Connector_Generic_Conn_02x06_Odd_Even" 50 -400 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
Connector*:*_2x??_*
$ENDFPLIST
DRAW
S -50 -295 0 -305 1 1 6 N
S -50 -195 0 -205 1 1 6 N
S -50 -95 0 -105 1 1 6 N
S -50 5 0 -5 1 1 6 N
S -50 105 0 95 1 1 6 N
S -50 205 0 195 1 1 6 N
S -50 250 150 -350 1 1 10 f
S 150 -295 100 -305 1 1 6 N
S 150 -195 100 -205 1 1 6 N
S 150 -95 100 -105 1 1 6 N
S 150 5 100 -5 1 1 6 N
S 150 105 100 95 1 1 6 N
S 150 205 100 195 1 1 6 N
X Pin_1 1 -200 200 150 R 50 50 1 1 P
X Pin_10 10 300 -200 150 L 50 50 1 1 P
X Pin_11 11 -200 -300 150 R 50 50 1 1 P
X Pin_12 12 300 -300 150 L 50 50 1 1 P
X Pin_2 2 300 200 150 L 50 50 1 1 P
X Pin_3 3 -200 100 150 R 50 50 1 1 P
X Pin_4 4 300 100 150 L 50 50 1 1 P
X Pin_5 5 -200 0 150 R 50 50 1 1 P
X Pin_6 6 300 0 150 L 50 50 1 1 P
X Pin_7 7 -200 -100 150 R 50 50 1 1 P
X Pin_8 8 300 -100 150 L 50 50 1 1 P
X Pin_9 9 -200 -200 150 R 50 50 1 1 P
ENDDRAW
ENDDEF
#
# Device_R_Pack04_Split
#
DEF Device_R_Pack04_Split R 0 0 N Y 4 F N
F0 "R" 80 0 50 V V C CNN
F1 "Device_R_Pack04_Split" 0 0 50 V V C CNN
F2 "" -70 0 50 V I C CNN
F3 "" 0 0 50 H I C CNN
$FPLIST
DIP*
SOIC*
R*Array*Concave*
R*Array*Convex*
$ENDFPLIST
DRAW
S -40 -100 40 100 0 1 10 N
X ~ 1 0 -150 50 U 50 50 1 1 P
X ~ 8 0 150 50 D 50 50 1 1 P
X ~ 2 0 -150 50 U 50 50 2 1 P
X ~ 7 0 150 50 D 50 50 2 1 P
X ~ 3 0 -150 50 U 50 50 3 1 P
X ~ 6 0 150 50 D 50 50 3 1 P
X ~ 4 0 -150 50 U 50 50 4 1 P
X ~ 5 0 150 50 D 50 50 4 1 P
ENDDRAW
ENDDEF
#
# power_GND
#
DEF power_GND #PWR 0 0 Y Y 1 F P
F0 "#PWR" 0 -250 50 H I C CNN
F1 "power_GND" 0 -150 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 6 0 1 0 0 0 0 -50 50 -50 0 -100 -50 -50 0 -50 N
X GND 1 0 0 0 D 50 50 1 1 W N
ENDDRAW
ENDDEF
#
# power_PWR_FLAG
#
DEF power_PWR_FLAG #FLG 0 0 N N 1 F P
F0 "#FLG" 0 75 50 H I C CNN
F1 "power_PWR_FLAG" 0 150 50 H V C CNN
F2 "" 0 0 50 H I C CNN
F3 "" 0 0 50 H I C CNN
DRAW
P 6 0 1 0 0 0 0 50 -40 75 0 100 40 75 0 50 N
X pwr 1 0 0 0 U 50 50 0 0 w
ENDDRAW
ENDDEF
#
#End Library
Loading