-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7d0a1ae
commit 416877f
Showing
25 changed files
with
1,313 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""Bourns TVS diodes.""" | ||
|
||
|
||
component Cdsot23Sm712: | ||
""" | ||
CDSOT23-SM712 - Surface Mount TVS Diode. | ||
|
||
# Reference | ||
|
||
* [CDSOT23-SM712 Surface Mount TVS Diode](https://www.bourns.com/pdfs/CDSOT23-SM712.pdf) | ||
""" | ||
footprint = "Package_TO_SOT_SMD:SOT-23-3" | ||
lcsc_id = "C404012" | ||
mpn = "C404012" # CDSOT23-SM712 | ||
|
||
signal p1 ~ pin 1 | ||
signal p2 ~ pin 2 | ||
signal common ~ pin 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
"""CAN controller and transceiver.""" | ||
|
||
from "generics/interfaces.ato" import Power, SPI | ||
|
||
from "ck-js-series/smd.ato" import CkJs102011jcqn | ||
|
||
from "lib/capacitors.ato" import PowerDecouplingCap100nf | ||
from "lib/connectors.ato" import JstGhHorizontalCan | ||
from "lib/leds.ato" import LedIndicatorsCanTtl, LEDIndicatorUser | ||
from "lib/microchip/MCP2517FDT.ato" import MCP2517FDT | ||
from "lib/microchip/MCP2562FD.ato" import MCP2562FD | ||
from "lib/oscillators.ato" import ABM8_20MHzOscillator | ||
from "lib/resistors.ato" import Resistor1608 | ||
|
||
|
||
module CanControllerTrx: | ||
"""CAN controller and transceiver.""" | ||
# power | ||
power = new Power | ||
power.voltage = 3.1V to 3.3V | ||
signal gnd ~ power.gnd | ||
|
||
spi = new SPI | ||
|
||
controller = new MCP2517FDT | ||
controller.power ~ power | ||
controller.spi ~ spi | ||
|
||
# controller power decoupling capacitor | ||
controller_power_cap = new PowerDecouplingCap100nf | ||
controller_power_cap.power ~ power | ||
|
||
# controller oscillator | ||
oscillator = new ABM8_20MHzOscillator | ||
oscillator.gnd ~ gnd | ||
oscillator.xin.io ~ controller.xin | ||
oscillator.xout.io ~ controller.xout | ||
|
||
# user LED on controller GPIO 0 | ||
user_led_indicator = new LEDIndicatorUser | ||
user_led_indicator.v_in = power.voltage | ||
user_led_indicator.input ~ controller.gpio0.io | ||
user_led_indicator.gnd ~ gnd | ||
|
||
# transceiver | ||
transceiver = new MCP2562FD | ||
transceiver.power ~ power | ||
controller.can_ttl ~ transceiver.can_ttl | ||
|
||
# indicator LEDs | ||
can_leds = new LedIndicatorsCanTtl | ||
can_leds.voltage = power.voltage | ||
can_leds.power ~ power | ||
can_leds.can_ttl ~ controller.can_ttl | ||
|
||
# transceiver power decoupling capacitor | ||
transceiver_power_cap = new PowerDecouplingCap100nf | ||
transceiver_power_cap.power ~ power | ||
|
||
# CAN termination switch | ||
switch = new CkJs102011jcqn | ||
switch.common ~ transceiver.can.CANH | ||
|
||
# CAN termination resistor | ||
termination_resistor = new Resistor1608 | ||
termination_resistor.value = 120 ohm +/- 5% | ||
termination_resistor.p1 ~ switch.p1 | ||
termination_resistor.p2 ~ transceiver.can.CANL | ||
|
||
# CAN in connector | ||
can_in = new JstGhHorizontalCan | ||
can_in.can ~ transceiver.can | ||
can_in.power ~ power | ||
|
||
# CAN out connector | ||
can_out = new JstGhHorizontalCan | ||
can_out.can ~ transceiver.can | ||
can_out.power ~ power |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
"""Capacitors.""" | ||
|
||
from "generics/capacitors.ato" import Capacitor | ||
|
||
|
||
component PowerDecouplingCap100nf from Capacitor: | ||
"""100nF power decoupling capacitor.""" | ||
value = 100nF +/- 20% | ||
package = "0603" # equivalent to 1608 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
"""Connectors.""" | ||
|
||
from "generics/interfaces.ato" import CAN, Power | ||
|
||
from "lib/interfaces.ato" import RS485 | ||
|
||
|
||
component _Connector: | ||
"""Connector base.""" | ||
designator_prefix = "J" | ||
|
||
|
||
component JstB2bPhKS from _Connector: | ||
""" | ||
JST B2B-PH-K-S top entry 2-pin PH header. | ||
|
||
2.0 mm pitch disconnectable crimp style connector. | ||
|
||
# Reference | ||
|
||
* [PH connectors](https://www.jst.com/wp-content/uploads/2021/09/ePH.pdf) | ||
""" | ||
footprint = "Connector_JST:JST_PH_B2B-PH-K_1x02_P2.00mm_Vertical" | ||
lcsc_id = "C5251182" | ||
mpn = "C5251182" # B2B-PH-K-S | ||
|
||
signal p1 ~ pin 1 | ||
signal p2 ~ pin 2 | ||
|
||
|
||
component PhoenixPt1x3P3mm5Horizontal from _Connector: | ||
"""Phoenix Contact terminal block 3-way side entry 3.5mm PCB | ||
|
||
Phoenix Contact PT 1,5 Series 3.5mm 3-way terminal block. | ||
""" | ||
footprint = "TerminalBlock_Phoenix:TerminalBlock_Phoenix_PT-1,5-3-3.5-H_1x03_P3.50mm_Horizontal" | ||
lcsc_id = "" | ||
mpn = "" # 1984620 | ||
|
||
signal p1 ~ pin 1 | ||
signal p2 ~ pin 2 | ||
signal p3 ~ pin 3 | ||
|
||
|
||
component JstGhHorizontalCan from _Connector: | ||
""" | ||
UAVCAN/CAN Micro connector. | ||
|
||
JST GH connector Header Surface Mount, Right Angle 4 position 1.25mm. | ||
|
||
# Reference | ||
|
||
* [GH connectors](https://www.jst-mfg.com/product/pdf/eng/eGH.pdf) | ||
""" | ||
footprint = "Connector_JST:JST_GH_SM04B-GHS-TB_1x04-1MP_P1.25mm_Horizontal" | ||
lcsc_id = "C189895" | ||
mpn = "C189895" # SM04B-GHS-TB(LF)(SN) | ||
|
||
can = new CAN | ||
power = new Power | ||
signal gnd ~ power.gnd | ||
|
||
power.vcc ~ pin 1 | ||
can.CANH ~ pin 2 | ||
can.CANL ~ pin 3 | ||
gnd ~ pin 4 | ||
gnd ~ pin MP | ||
|
||
|
||
component Rs485Connector from PhoenixPt1x3P3mm5Horizontal: | ||
"""RS-485 board to wire connector.""" | ||
signal gnd ~ pin 3 | ||
|
||
rs485 = new RS485 | ||
rs485.a ~ pin 1 | ||
rs485.b ~ pin 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"""Fiducial markers.""" | ||
|
||
|
||
component Fiducial0mm75Mask1mm5: | ||
"""Circular Fiducial, 0.75mm bare copper, 1.5mm solder mask opening (Level B).""" | ||
designator_prefix = "FD" | ||
footprint = "Fiducial:Fiducial_0.75mm_Mask1.5mm" | ||
exclude_from_bom = True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
"""Headers.""" | ||
|
||
from "generics/interfaces.ato" import GPIO, I2C, Power, UART | ||
|
||
|
||
component _Header: | ||
"""Header base.""" | ||
designator_prefix = "J" | ||
|
||
|
||
component PinHeader1x02P2mm54Vertical from _Header: | ||
"""1x2 2.5mm pitch vertical pin header.""" | ||
footprint="Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical" | ||
lcsc_id = "C5360898" | ||
mpn = "C5360898" # PZ2.54-1*2 | ||
|
||
signal p1 ~ pin 1 | ||
signal p2 ~ pin 2 | ||
|
||
|
||
component PinHeader1x03P2mm54Vertical from _Header: | ||
"""1x3 2.5mm pitch vertical pin header.""" | ||
footprint="Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical" | ||
lcsc_id = "C2894926" | ||
mpn = "C2894926" # PZ254-1-03-Z-8.5 | ||
|
||
signal p1 ~ pin 1 | ||
signal p2 ~ pin 2 | ||
signal p3 ~ pin 3 | ||
|
||
|
||
component PinHeader1x05P2mm54Vertical from _Header: | ||
"""1x5 2.5mm pitch vertical pin header.""" | ||
footprint="Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical" | ||
lcsc_id = "C3328227" | ||
mpn = "C3328227" # M20-9990546 | ||
|
||
signal p1 ~ pin 1 | ||
signal p2 ~ pin 2 | ||
signal p3 ~ pin 3 | ||
signal p4 ~ pin 4 | ||
signal p5 ~ pin 5 | ||
|
||
|
||
|
||
component PinHeaderUartTHT from PinHeader1x03P2mm54Vertical: | ||
"""UART pin header.""" | ||
uart = new UART | ||
|
||
uart.gnd ~ pin 1 | ||
uart.tx ~ pin 2 | ||
uart.rx ~ pin 3 | ||
|
||
|
||
component PinHeaderI2cTHT from PinHeader1x05P2mm54Vertical: | ||
"""I2C pin header. | ||
|
||
Follows Pimoroni Breakout Garden specification. | ||
""" | ||
i2c = new I2C | ||
power = new Power | ||
int = new GPIO | ||
|
||
signal gnd ~ pin 1 | ||
|
||
int.io ~ pin 2 | ||
int.gnd ~ gnd | ||
|
||
power.vcc ~ pin 5 | ||
power.gnd ~ gnd | ||
|
||
i2c.sda ~ pin 4 | ||
i2c.scl ~ pin 3 | ||
i2c.gnd ~ gnd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
"""Interfaces.""" | ||
|
||
|
||
interface RS485: | ||
signal a | ||
signal b |
Oops, something went wrong.