# Circuit described using an approximation to the sort of tools we used # at university in the 70's to describe, simulate, and lay out circuit boards. # (back in the 70's we were wire-wrapping them or using pre-soldered eurocards # with capacitive discharge spot welding. Later in the 80's we had similar # tools to handle VLSI chip design). # However in the absence of tools to automate this, the description below # should still be clear enough to follow manually. # First define the pinouts - in an automated layout system, these descriptions would # include the physical layout and coordinates of pins etc. pinout PI pin 1 = 3.3v pin 2 = 5v pin 3 = BCM.2 = SDA.1 = I2C1.SDA pin 4 = 5v pin 5 = BCM.3 = SCL.1 = I2C1.SDL pin 6 = 0v pin 7 = BCM.4 = GPIO.7 = GPCLK0 pin 8 = BCM.14 = UART.TX = TxD pin 9 = 0v pin 10 = BCM.15 = UART.RX = RxD pin 11 = BCM.17 = GPIO.0 = SPI1.CE1 pin 12 = BCM.18 = GPIO.1 = SPI1.CE0 pin 13 = BCM.27 = GPIO.2 pin 14 = 0v pin 15 = BCM.22 = GPIO.3 pin 16 = BCM.23 = GPIO.4 pin 17 = 3.3v pin 18 = BCM.24 = GPIO.5 pin 19 = BCM.10 = SPI0.MOSI pin 20 = 0v pin 21 = BCM.9 = SPI0.MISO pin 22 = BCM.25 = GPIO.6 pin 23 = BCM.11 = SPI0.SCLK pin 24 = BCM.8 = SPI0.CE0 pin 25 = 0v pin 26 = BCM.7 = SPI0.CE1 pin 27 = BCM.0 = EEPROM.SDA = SDA.0 pin 28 = BCM.1 = EEPROM.SCL = SCL.0 pin 29 = BCM.5 = GPIO.21 pin 30 = 0v pin 31 = BCM.6 = GPIO.22 pin 32 = BCM.12 = PWM0 = GPIO.26 pin 33 = BCM.13 = PWM1 = GPIO.23 pin 34 = 0v pin 35 = BCM.19 = SPI1.MISO = GPIO.24 pin 36 = BCM.16 = SPI1.CE2 = GPIO.27 pin 37 = BCM.26 = GPIO.25 pin 38 = BCM.20 = GPIO.28 pin 39 = 0v pin 40 = BCM.21 = GPIO.29 end MCP42010 pinout MCP42010 pin 1 = CS' pin 2 = SCK pin 3 = SI pin 4 = Vss pin 5 = PB1 pin 6 = PW1 pin 7 = PA1 pin 8 = PA0 pin 9 = PW0 pin 10 = PB0 pin 11 = RS' pin 12 = SHDN' pin 13 = SO pin 14 = Vdd end PI pinout PC817 pin 1 = Anode # Input source pin 2 = Cathode # Input ground pin 3 = Emitter # Output source pin 4 = Collector # Output ground end PC917 # From DB9: pinout VecPort pin 1 = B1 pin 2 = B2 pin 3 = B3 pin 4 = B4 pin 5 = X pin 6 = Y pin 7 = +5v pin 8 = 0v pin 9 = -5v end VecPort pinout Trimpot_3386P1_103LF pin 1 = Left pin 2 = Mid pin 3 = Right end Trimpot_3386P1_103LF # now instantiate the packages package PI PI package MCP42010 Digipot1 Digipot2 package PC817 Opto1 Opto2 Opto3 Opto4 Opto5 Opto6 Opto7 Opto8 package VecPort LeftPort RightPort # Trimpots for left/right controllers (R/L), X and Y axes (X/Y), Above/below origin (Hi/Lo): package Trimpot_3386P1_103LF RXHi RXLo RYHi RYLo LXHi LXLo LYHi LYLo # and finally describe the connections: circuit USB2Vec # primary controller digipot PI.5v -> Digipot1.Vdd PI.0v -> Digipot1.Vss PI.5v -> Digipot1.SHDN' PI.5v -> Digipot1.RS' PI.SPI0.CE0 -> Digipot1.CS' PI.SPI0.SCLK -> Digipot1.SCK PI.SPI0.MOSI -> Digipot1.SI # Digipot1.SO -> unconnected # primary controller buttons PI.BCM.25 -> Opto0.Anode ; Opto0.Cathode -> PI.0v PI.BCM.5 -> Opto1.Anode ; Opto1.Cathode -> PI.0v PI.BCM.6 -> Opto2.Anode ; Opto2.Cathode -> PI.0v PI.BCM.16 -> Opto3.Anode ; Opto3.Cathode -> PI.0v RightPort.B1 -> Opto0.Collector ; Opto0.Emitter -> RightPort.0v RightPort.B2 -> Opto1.Collector ; Opto1.Emitter -> RightPort.0v RightPort.B3 -> Opto2.Collector ; Opto2.Emitter -> RightPort.0v RightPort.B4 -> Opto3.Collector ; Opto3.Emitter -> RightPort.0v # voltage dividers and Analog joystick # Primary controller cable: # Y: RightPort.+5v -> RYHi.Right RYHi.Mid -> Digipot1.PB1 RightPort.0v -> RYHi.Left RightPort.0v -> RYLo.Right RYLo.Mid -> Digipot1.PA1 RightPort.-5v -> RYLo.Left Digipot1.PW1 -> RightPort.Y # X: RightPort.+5v -> RXHi.Left RXHi.Mid -> Digipot1.PB0 RightPort.0v -> RXHi.Right RightPort.0v -> RXLo.Left RYLo.Mid -> Digipot1.PA0 RightPort.-5v -> RXLo.Right Digipot1.PW0 -> RightPort.X # secondary controller digipot PI.5v -> Digipot2.Vdd PI.0v -> Digipot2.Vss PI.5v -> Digipot2.SHDN' PI.5v -> Digipot2.RS' PI.SPI0.CE1 -> Digipot2.CS' # note CE1 - this is only difference between the two digipot control signals PI.SPI0.SCLK -> Digipot2.SCK PI.SPI0.MOSI -> Digipot2.SI # Digipot1.SO -> unconnected # secondary controller buttons PI.BCM.17 -> Opto4.Anode ; Opto4.Cathode -> PI.0v PI.BCM.27 -> Opto5.Anode ; Opto5.Cathode -> PI.0v PI.BCM.22 -> Opto6.Anode ; Opto6.Cathode -> PI.0v PI.BCM.23 -> Opto7.Anode ; Opto7.Cathode -> PI.0v LeftPort.B1 -> Opto4.Collector ; Opto4.Emitter -> LeftPort.0v LeftPort.B2 -> Opto5.Collector ; Opto5.Emitter -> LeftPort.0v LeftPort.B3 -> Opto6.Collector ; Opto6.Emitter -> LeftPort.0v LeftPort.B4 -> Opto7.Collector ; Opto7.Emitter -> LeftPort.0v # secondary controller cable: # Y: LeftPort.+5v -> LYHi.Right LYHi.Mid -> Digipot2.PB1 LeftPort.0v -> LYHi.Left LeftPort.0v -> LYLo.Right LYLo.Mid -> Digipot2.PA1 LeftPort.-5v -> LYLo.Left Digipot2.PW1 -> LeftPort.Y # X: LeftPort.+5v -> LXHi.Left LXHi.Mid -> Digipot2.PB0 LeftPort.0v -> LXHi.Right LeftPort.0v -> LXLo.Left LYLo.Mid -> Digipot2.PA0 LeftPort.-5v -> LXLo.Right Digipot2.PW0 -> LeftPort.X end USB2Vec