<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://test.pinballmakers.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tfulenwider</id>
	<title>Pinball Makers (Staging) - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://test.pinballmakers.com/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tfulenwider"/>
	<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php/Special:Contributions/Tfulenwider"/>
	<updated>2026-05-28T05:23:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52695</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52695"/>
		<updated>2024-09-20T23:59:07Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Opto Trough===&lt;br /&gt;
This is intended to give people a more affordable option for a 6-ball opto trough. I prefer opto troughs rather than mechanical microswitches. I also wanted something that could more easily be connected to CobraPin hardware.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_troughTrial.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
===Opto Flipper Switches===&lt;br /&gt;
Opto flipper switches, built in neopixel lighting, better connection strategy to CobraPin hardware&lt;br /&gt;
&lt;br /&gt;
===Open Source Pinball Game===&lt;br /&gt;
I am slowly making a game! It will be open source so people can build it, mod it, and make it their own. There will be a new set of CobraPin electronics hardware developed to make the connecting and wiring task easier for people.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_prototypeGame.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk (*) in silkscreen.&#039;&#039;&#039; This pin should not be connected to a coil. Quadruple check your pinout or you will burn fuses, transistors, diodes, traces, etc.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output. Version 2+ of the CobraPin boards enables the use of 1-0-1 for one relay and 1-0-2 for the other relay.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin. Similarly for 1-0-2 as well when it is in use. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinRelayOutputSelect.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://missionpinball.org/tutorial/ MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://missionpinball.org/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://missionpinball.org/hardware/opp/cobrapin/ CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
[https://www.youtube.com/watch?v=te29dw7oe3o Xpansion Board Wiring Explanation Video]&lt;br /&gt;
&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
MPF Config Information: [https://missionpinball.org/hardware/opp/cobrapin/cobrapin_serial_segment_displays/ NeoSeg Serial Segment Displays]&lt;br /&gt;
&lt;br /&gt;
Original Kickstarter here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
The NeoSeg display is an 8-digit alphanumeric display that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display.&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also a 2-digit version for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=8hY2MuBaE14 Joust Head to Head Serial Segment Display Test]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52671</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52671"/>
		<updated>2023-12-20T02:41:17Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Opto Trough===&lt;br /&gt;
This is intended to give people a more affordable option for a 6-ball opto trough. I prefer opto troughs rather than mechanical microswitches. I also wanted something that could more easily be connected to CobraPin hardware.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_troughTrial.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
===Opto Flipper Switches===&lt;br /&gt;
Opto flipper switches, built in neopixel lighting, better connection strategy to CobraPin hardware&lt;br /&gt;
&lt;br /&gt;
===Open Source Pinball Game===&lt;br /&gt;
I am slowly making a game! It will be open source so people can build it, mod it, and make it their own. There will be a new set of CobraPin electronics hardware developed to make the connecting and wiring task easier for people.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_prototypeGame.jpg|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk (*) in silkscreen.&#039;&#039;&#039; This pin should not be connected to a coil. Quadruple check your pinout or you will burn fuses, transistors, diodes, traces, etc.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output. Version 2+ of the CobraPin boards enables the use of 1-0-1 for one relay and 1-0-2 for the other relay.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin. Similarly for 1-0-2 as well when it is in use. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinRelayOutputSelect.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://missionpinball.org/tutorial/ MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://missionpinball.org/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://missionpinball.org/hardware/opp/cobrapin/ CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
MPF Config Information: [https://missionpinball.org/hardware/opp/cobrapin/cobrapin_serial_segment_displays/ NeoSeg Serial Segment Displays]&lt;br /&gt;
&lt;br /&gt;
Original Kickstarter here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
The NeoSeg display is an 8-digit alphanumeric display that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display.&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also a 2-digit version for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[https://www.youtube.com/watch?v=8hY2MuBaE14 Joust Head to Head Serial Segment Display Test]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52670</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52670"/>
		<updated>2023-12-08T21:49:50Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
MPF Config Information: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/cobrapin_serial_segment_displays.html NeoSeg Serial Segment Displays]&lt;br /&gt;
&lt;br /&gt;
Original Kickstarter here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit display was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk (*) in silkscreen.&#039;&#039;&#039; This pin should not be connected to a coil. Quadruple check your pinout or you will burn fuses, transistors, diodes, traces, etc.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output. Version 2+ of the CobraPin boards enables the use of 1-0-1 for one relay and 1-0-2 for the other relay.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin. Similarly for 1-0-2 as well when it is in use. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinRelayOutputSelect.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52669</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52669"/>
		<updated>2023-12-08T21:24:46Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
MPF Config Information: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/cobrapin_serial_segment_displays.html NeoSeg Serial Segment Displays]&lt;br /&gt;
&lt;br /&gt;
Original Kickstarter here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit display was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk (*) in silkscreen.&#039;&#039;&#039; This pin should not be connected to a coil. Quadruple check your pinout or you will burn fuses, transistors, diodes, traces, etc.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output. Version 2+ of the CobraPin boards enables the use of 1-0-1 for one relay and 1-0-2 for the other relay.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin. Similarly for 1-0-2 as well when it is in use. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinRelayOutputSelect.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
...test&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=File:CobraPin_prototypeGame.jpg&amp;diff=52668</id>
		<title>File:CobraPin prototypeGame.jpg</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=File:CobraPin_prototypeGame.jpg&amp;diff=52668"/>
		<updated>2023-11-09T17:41:34Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=File:CobraPin_troughTrial.jpg&amp;diff=52667</id>
		<title>File:CobraPin troughTrial.jpg</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=File:CobraPin_troughTrial.jpg&amp;diff=52667"/>
		<updated>2023-11-09T17:39:15Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52665</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52665"/>
		<updated>2023-05-09T21:02:02Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Relay Control Output */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
MPF Config Information: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/cobrapin_serial_segment_displays.html NeoSeg Serial Segment Displays]&lt;br /&gt;
&lt;br /&gt;
Original Kickstarter here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit display was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk (*) in silkscreen.&#039;&#039;&#039; This pin should not be connected to a coil. Quadruple check your pinout or you will burn fuses, transistors, diodes, traces, etc.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output. Version 2+ of the CobraPin boards enables the use of 1-0-1 for one relay and 1-0-2 for the other relay.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin. Similarly for 1-0-2 as well when it is in use. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinRelayOutputSelect.PNG|800px]]&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=File:CobraPinRelayOutputSelect.PNG&amp;diff=52664</id>
		<title>File:CobraPinRelayOutputSelect.PNG</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=File:CobraPinRelayOutputSelect.PNG&amp;diff=52664"/>
		<updated>2023-05-09T21:00:50Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52663</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52663"/>
		<updated>2023-05-09T21:00:13Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Relay Control Output */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
MPF Config Information: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/cobrapin_serial_segment_displays.html NeoSeg Serial Segment Displays]&lt;br /&gt;
&lt;br /&gt;
Original Kickstarter here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit display was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk (*) in silkscreen.&#039;&#039;&#039; This pin should not be connected to a coil. Quadruple check your pinout or you will burn fuses, transistors, diodes, traces, etc.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output. Version 2+ of the CobraPin boards enable the use of 1-0-1 for one relay and 1-0-2 for the other relay.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin. Similarly for 1-0-2 as well when it is in use. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52661</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52661"/>
		<updated>2023-01-27T22:08:47Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* NeoSeg Serial Segment Displays */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
MPF Config Information: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/cobrapin_serial_segment_displays.html NeoSeg Serial Segment Displays]&lt;br /&gt;
&lt;br /&gt;
Original Kickstarter here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit display was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk (*) in silkscreen.&#039;&#039;&#039; This pin should not be connected to a coil. Quadruple check your pinout or you will burn fuses, transistors, diodes, traces, etc.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52660</id>
		<title>OPP Autofire Workaround</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52660"/>
		<updated>2022-12-29T00:03:36Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Issue: ==&lt;br /&gt;
&lt;br /&gt;
A bug was introduced in OPP firmware version 2.3.0.0 (November 2021) and persisted through 2.3.0.5. Under certain conditions, when you reconfigure an autofire coil, &#039;&#039;&#039;&#039;&#039;the coil can get stuck on&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The most common instance of this bug is when a dual coil flipper is configured with 100% hold power. If the flipper button is held while the ball drains, the flipper autofire device is disabled and the state of the flipper is frozen instead of reset to off. So after a drain, the flipper remains on even after the flipper button is released. When the next ball starts, the flipper device is re-enabled and all goes back to normal.&lt;br /&gt;
&lt;br /&gt;
Similarly, if you have single coil flippers with 8% hold power, you have an 8% chance of seeing the bug if you hold the flipper button as the ball drains. While less likely than the dual wound case, this single wound condition is much worse since a coil intended for an 8% hold could get stuck on at 100% power. This will likely blow a fuse, transistor, coil, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you are going to test for this bug or any workarounds for this bug, try it first with coil power off. If you are using CobraPin products, use the yellow LEDs to verify correct operation with no stuck-on outputs prior to applying coil power.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Am I Affected?==&lt;br /&gt;
Run &amp;quot;mpf hardware scan&amp;quot; from your machine&#039;s folder with the hardware connected.&lt;br /&gt;
&lt;br /&gt;
The board firmware version is reported as something like &amp;quot;0x20300050&amp;quot;. If you have 0x20300000 or 0x20300050, this bug could affect you.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Options: ==&lt;br /&gt;
=== A) Flash OPP version 2.4.0.0 or newer ===&lt;br /&gt;
This bug was fixed in OPP version 2.4.0.0. Consider flashing 2.4.0.0 or later to your STM32 processors.&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* Regression tested version&lt;br /&gt;
* No config changes or vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Flashing new firmware requires an STM32 programmer, STLINK software, and python 2.7 setup to run OPP configuration&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Instructions for loading firmware: ====&lt;br /&gt;
Be sure to use the &#039;&#039;&#039;OppStm32.2.4.0.0.hex&#039;&#039;&#039; file or later from here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Stm32Workbench/Gen3Images/ Gen3Images]&lt;br /&gt;
&lt;br /&gt;
There are a couple versions of these instructions:&lt;br /&gt;
&lt;br /&gt;
# [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
# [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== B) Add Dummy devices in MPF: ===&lt;br /&gt;
&lt;br /&gt;
If you can prevent disabling an autofire device, you will not see this bug. One method of doing this is to setup a dummy autofire device in MPF. This method requires one unused direct input (two if your autofire devices span across both STM32 processor boards). You must create a dummy autofire device for each autofire device in your machine but all the dummy devices can use the same switch.&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* No firmware flashing&lt;br /&gt;
* Simple MPF config change&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Requires an unused direct input (potentially two if your autofire devices span across both STM32 processor boards)&lt;br /&gt;
* Requires user to account for each autofire coil so the user could accidentally miss one in the MPF config&lt;br /&gt;
* Could unintentionally fire coils from the dummy device if you accidentally connect the dummy switch to something&lt;br /&gt;
* There could be a form of config where this does not prevent the bug from appearing&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example: ====&lt;br /&gt;
Check here for an example config with dummy devices: [https://github.com/cobra18t/CobraPin/blob/main/Errata/OPP_AutoFire_Workaround.yaml OPP_AutoFire_Workaround.yaml]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52659</id>
		<title>OPP Autofire Workaround</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52659"/>
		<updated>2022-12-20T00:52:15Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Issue: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Issue: ==&lt;br /&gt;
&lt;br /&gt;
A bug was introduced in OPP firmware version 2.3.0.0 (November 2021) and persisted through 2.3.0.5. Under certain conditions, when you reconfigure an autofire coil, &#039;&#039;&#039;&#039;&#039;the coil can get stuck on&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The most common instance of this bug is when a dual coil flipper is configured with 100% hold power. If the flipper button is held while the ball drains, the flipper autofire device is disabled and the state of the flipper is frozen instead of reset to off. So after a drain, the flipper remains on even after the flipper button is released. When the next ball starts, the flipper device is re-enabled and all goes back to normal.&lt;br /&gt;
&lt;br /&gt;
Similarly, if you have single coil flippers with 8% hold power, you have an 8% chance of seeing the bug if you hold the flipper button as the ball drains. While less likely than the dual wound case, this single wound condition is much worse since a coil intended for an 8% hold could get stuck on at 100% power. This will likely blow a fuse, transistor, coil, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you are going to test for this bug or any workarounds for this bug, try it first with coil power off. If you are using CobraPin products, use the yellow LEDs to verify correct operation with no stuck-on outputs prior to applying coil power.&lt;br /&gt;
&lt;br /&gt;
==Am I Affected?==&lt;br /&gt;
Run &amp;quot;mpf hardware scan&amp;quot; from your machine&#039;s folder with the hardware connected.&lt;br /&gt;
&lt;br /&gt;
The board firmware version is reported as something like &amp;quot;0x20300050&amp;quot;. If you have 0x20300000 or 0x20300050, this bug could affect you.&lt;br /&gt;
&lt;br /&gt;
== Options: ==&lt;br /&gt;
=== A) Flash new OPP version 2.x.x.x ===&lt;br /&gt;
A new firmware fix is currently in the works, but in the meantime, consider one of the other workaround options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== B) Add Dummy devices in MPF: ===&lt;br /&gt;
&lt;br /&gt;
If you can prevent disabling an autofire device, you will not see this bug. One method of doing this is to setup a dummy autofire device in MPF. This method requires one unused direct input (two if your autofire devices span across both STM32 processor boards). You must create a dummy autofire device for each autofire device in your machine but all the dummy devices can use the same switch.&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* No firmware flashing&lt;br /&gt;
* Simple MPF config change&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Requires an unused direct input (potentially two if your autofire devices span across both STM32 processor boards)&lt;br /&gt;
* Requires user to account for each autofire coil so the user could accidentally miss one in the MPF config&lt;br /&gt;
* Could unintentionally fire coils from the dummy device if you accidentally connect the dummy switch to something&lt;br /&gt;
* There could be a form of config where this does not prevent the bug from appearing&lt;br /&gt;
&lt;br /&gt;
==== Example: ====&lt;br /&gt;
Check here for an example config with dummy devices: [https://github.com/cobra18t/CobraPin/blob/main/Errata/OPP_AutoFire_Workaround.yaml OPP_AutoFire_Workaround.yaml]&lt;br /&gt;
&lt;br /&gt;
=== C) Revert to OPP version 2.2.0.0: ===&lt;br /&gt;
This bug did not exist in OPP version 2.2.0.0. Consider flashing 2.2.0.0 to your STM32 processors if you do not use the following features that were introduced after 2.2.0.0:&lt;br /&gt;
# Coil pulse power (kick PWM)&lt;br /&gt;
# RC servo support&lt;br /&gt;
# SPI LED support (APA102, SK9822, etc.)&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* Regression tested version&lt;br /&gt;
* No config changes or vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Flashing new firmware requires an STM32 programmer, STLINK software, and python 2.7 setup to run OPP configuration&lt;br /&gt;
* No longer have the most recent firmware features&lt;br /&gt;
&lt;br /&gt;
==== Instructions for loading firmware: ====&lt;br /&gt;
Be sure to use the &#039;&#039;&#039;OppStm32.2.2.0.0.hex&#039;&#039;&#039; file from here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Stm32Workbench/Gen3Images/ Gen3Images]&lt;br /&gt;
&lt;br /&gt;
There are a couple versions of these instructions:&lt;br /&gt;
&lt;br /&gt;
# [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
# [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52658</id>
		<title>OPP Autofire Workaround</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52658"/>
		<updated>2022-12-20T00:48:12Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Issue: ==&lt;br /&gt;
&lt;br /&gt;
A bug was introduced in OPP firmware version 2.3.0.0 and persisted through 2.3.0.5. Under certain conditions, when you reconfigure an autofire coil, &#039;&#039;&#039;&#039;&#039;the coil can get stuck on&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The most common instance of this bug is when a dual coil flipper is configured with 100% hold power. If the flipper button is held while the ball drains, the flipper autofire device is disabled and the state of the flipper is frozen instead of reset to off. So after a drain, the flipper remains on even after the flipper button is released. When the next ball starts, the flipper device is re-enabled and all goes back to normal.&lt;br /&gt;
&lt;br /&gt;
Similarly, if you have single coil flippers with 8% hold power, you have an 8% chance of seeing the bug if you hold the flipper button as the ball drains. While less likely than the dual wound case, this single wound condition is much worse since a coil intended for an 8% hold could get stuck on at 100% power. This will likely blow a fuse, transistor, coil, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you are going to test for this bug or any workarounds for this bug, try it first with coil power off. If you are using CobraPin products, use the yellow LEDs to verify correct operation with no stuck-on outputs prior to applying coil power.&lt;br /&gt;
&lt;br /&gt;
==Am I Affected?==&lt;br /&gt;
Run &amp;quot;mpf hardware scan&amp;quot; from your machine&#039;s folder with the hardware connected.&lt;br /&gt;
&lt;br /&gt;
The board firmware version is reported as something like &amp;quot;0x20300050&amp;quot;. If you have 0x20300000 or 0x20300050, this bug could affect you.&lt;br /&gt;
&lt;br /&gt;
== Options: ==&lt;br /&gt;
=== A) Flash new OPP version 2.x.x.x ===&lt;br /&gt;
A new firmware fix is currently in the works, but in the meantime, consider one of the other workaround options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== B) Add Dummy devices in MPF: ===&lt;br /&gt;
&lt;br /&gt;
If you can prevent disabling an autofire device, you will not see this bug. One method of doing this is to setup a dummy autofire device in MPF. This method requires one unused direct input (two if your autofire devices span across both STM32 processor boards). You must create a dummy autofire device for each autofire device in your machine but all the dummy devices can use the same switch.&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* No firmware flashing&lt;br /&gt;
* Simple MPF config change&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Requires an unused direct input (potentially two if your autofire devices span across both STM32 processor boards)&lt;br /&gt;
* Requires user to account for each autofire coil so the user could accidentally miss one in the MPF config&lt;br /&gt;
* Could unintentionally fire coils from the dummy device if you accidentally connect the dummy switch to something&lt;br /&gt;
* There could be a form of config where this does not prevent the bug from appearing&lt;br /&gt;
&lt;br /&gt;
==== Example: ====&lt;br /&gt;
Check here for an example config with dummy devices: [https://github.com/cobra18t/CobraPin/blob/main/Errata/OPP_AutoFire_Workaround.yaml OPP_AutoFire_Workaround.yaml]&lt;br /&gt;
&lt;br /&gt;
=== C) Revert to OPP version 2.2.0.0: ===&lt;br /&gt;
This bug did not exist in OPP version 2.2.0.0. Consider flashing 2.2.0.0 to your STM32 processors if you do not use the following features that were introduced after 2.2.0.0:&lt;br /&gt;
# Coil pulse power (kick PWM)&lt;br /&gt;
# RC servo support&lt;br /&gt;
# SPI LED support (APA102, SK9822, etc.)&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* Regression tested version&lt;br /&gt;
* No config changes or vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Flashing new firmware requires an STM32 programmer, STLINK software, and python 2.7 setup to run OPP configuration&lt;br /&gt;
* No longer have the most recent firmware features&lt;br /&gt;
&lt;br /&gt;
==== Instructions for loading firmware: ====&lt;br /&gt;
Be sure to use the &#039;&#039;&#039;OppStm32.2.2.0.0.hex&#039;&#039;&#039; file from here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Stm32Workbench/Gen3Images/ Gen3Images]&lt;br /&gt;
&lt;br /&gt;
There are a couple versions of these instructions:&lt;br /&gt;
&lt;br /&gt;
# [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
# [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52657</id>
		<title>OPP Autofire Workaround</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52657"/>
		<updated>2022-12-20T00:35:37Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* B) Add Dummy devices in MPF: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Under Construction... stand by for greatness.&lt;br /&gt;
&lt;br /&gt;
== Issue: ==&lt;br /&gt;
&lt;br /&gt;
A bug was introduced in OPP firmware version 2.3.0.0 and persisted through 2.3.0.5. Under certain conditions, when you reconfigure an autofire coil, &#039;&#039;&#039;&#039;&#039;the coil can get stuck on&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The most common instance of this bug is when a dual coil flipper is configured with 100% hold power. If the flipper button is held while the ball drains, the flipper autofire device is disabled and the state of the flipper is frozen instead of reset to off. So after a drain, the flipper remains on even after the flipper button is released. When the next ball starts, the flipper device is re-enabled and all goes back to normal.&lt;br /&gt;
&lt;br /&gt;
Similarly, if you have single coil flippers with 8% hold power, you have an 8% chance of seeing the bug if you hold the flipper button as the ball drains. While less likely than the dual wound case, this single wound condition is much worse since a coil intended for an 8% hold could get stuck on at 100% power. This will likely blow a fuse, transistor, coil, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you are going to test for this bug or any workarounds for this bug, try it first with coil power off. If you are using CobraPin products, use the yellow LEDs to verify correct operation with no stuck-on outputs prior to applying coil power.&lt;br /&gt;
&lt;br /&gt;
== Options: ==&lt;br /&gt;
=== A) Flash new OPP version 2.x.x.x ===&lt;br /&gt;
A new firmware fix is currently in the works, but in the meantime, consider one of the other workaround options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== B) Add Dummy devices in MPF: ===&lt;br /&gt;
&lt;br /&gt;
If you can prevent disabling an autofire device, you will not see this bug. One method of doing this is to setup a dummy autofire device in MPF. This method requires one unused direct input (two if your autofire devices span across both STM32 processor boards). You must create a dummy autofire device for each autofire device in your machine but all the dummy devices can use the same switch.&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* No firmware flashing&lt;br /&gt;
* Simple MPF config change&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Requires an unused direct input (potentially two if your autofire devices span across both STM32 processor boards)&lt;br /&gt;
* Requires user to account for each autofire coil so the user could accidentally miss one in the MPF config&lt;br /&gt;
* Could unintentionally fire coils from the dummy device if you accidentally connect the dummy switch to something&lt;br /&gt;
* There could be a form of config where this does not prevent the bug from appearing&lt;br /&gt;
&lt;br /&gt;
==== Example: ====&lt;br /&gt;
Check here for an example config with dummy devices: [https://github.com/cobra18t/CobraPin/blob/main/Errata/OPP_AutoFire_Workaround.yaml OPP_AutoFire_Workaround.yaml]&lt;br /&gt;
&lt;br /&gt;
=== C) Revert to OPP version 2.2.0.0: ===&lt;br /&gt;
This bug did not exist in OPP version 2.2.0.0. Consider flashing 2.2.0.0 to your STM32 processors if you do not use the following features that were introduced after 2.2.0.0:&lt;br /&gt;
# Coil pulse power (kick PWM)&lt;br /&gt;
# RC servo support&lt;br /&gt;
# SPI LED support (APA102, SK9822, etc.)&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* Regression tested version&lt;br /&gt;
* No config changes or vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Flashing new firmware requires an STM32 programmer, STLINK software, and python 2.7 setup to run OPP configuration&lt;br /&gt;
* No longer have the most recent firmware features&lt;br /&gt;
&lt;br /&gt;
==== Instructions for loading firmware: ====&lt;br /&gt;
Be sure to use the &#039;&#039;&#039;OppStm32.2.2.0.0.hex&#039;&#039;&#039; file from here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Stm32Workbench/Gen3Images/ Gen3Images]&lt;br /&gt;
&lt;br /&gt;
There are a couple versions of these instructions:&lt;br /&gt;
&lt;br /&gt;
# [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
# [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52656</id>
		<title>OPP Autofire Workaround</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52656"/>
		<updated>2022-12-20T00:34:28Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Issue: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Under Construction... stand by for greatness.&lt;br /&gt;
&lt;br /&gt;
== Issue: ==&lt;br /&gt;
&lt;br /&gt;
A bug was introduced in OPP firmware version 2.3.0.0 and persisted through 2.3.0.5. Under certain conditions, when you reconfigure an autofire coil, &#039;&#039;&#039;&#039;&#039;the coil can get stuck on&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The most common instance of this bug is when a dual coil flipper is configured with 100% hold power. If the flipper button is held while the ball drains, the flipper autofire device is disabled and the state of the flipper is frozen instead of reset to off. So after a drain, the flipper remains on even after the flipper button is released. When the next ball starts, the flipper device is re-enabled and all goes back to normal.&lt;br /&gt;
&lt;br /&gt;
Similarly, if you have single coil flippers with 8% hold power, you have an 8% chance of seeing the bug if you hold the flipper button as the ball drains. While less likely than the dual wound case, this single wound condition is much worse since a coil intended for an 8% hold could get stuck on at 100% power. This will likely blow a fuse, transistor, coil, etc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039; If you are going to test for this bug or any workarounds for this bug, try it first with coil power off. If you are using CobraPin products, use the yellow LEDs to verify correct operation with no stuck-on outputs prior to applying coil power.&lt;br /&gt;
&lt;br /&gt;
== Options: ==&lt;br /&gt;
=== A) Flash new OPP version 2.x.x.x ===&lt;br /&gt;
A new firmware fix is currently in the works, but in the meantime, consider one of the other workaround options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== B) Add Dummy devices in MPF: ===&lt;br /&gt;
&lt;br /&gt;
If you can prevent disabling an autofire device, you will not see this bug. One method of doing this is to setup a dummy autofire device in MPF. This method requires one unused direct input (two if your autofire devices span across both STM32 processor boards). You must create a dummy autofire device for each autofire device in your machine but all the dummy devices can use the same switch.&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* No firmware flashing&lt;br /&gt;
* Simple MPF config change&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Requires an unused direct input (potentially two if your autofire devices span across both STM32 processor boards)&lt;br /&gt;
* Requires user to account for each autofire coil so the user could accidentally miss one in the MPF config&lt;br /&gt;
* Could unintentionally fire coils from the dummy device if you accidentally connect the dummy switch to something&lt;br /&gt;
* There could be a form of config where this does not protect the bug from appearing&lt;br /&gt;
&lt;br /&gt;
==== Example: ====&lt;br /&gt;
Check here for an example config with dummy devices: [https://github.com/cobra18t/CobraPin/blob/main/Errata/OPP_AutoFire_Workaround.yaml OPP_AutoFire_Workaround.yaml]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== C) Revert to OPP version 2.2.0.0: ===&lt;br /&gt;
This bug did not exist in OPP version 2.2.0.0. Consider flashing 2.2.0.0 to your STM32 processors if you do not use the following features that were introduced after 2.2.0.0:&lt;br /&gt;
# Coil pulse power (kick PWM)&lt;br /&gt;
# RC servo support&lt;br /&gt;
# SPI LED support (APA102, SK9822, etc.)&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* Regression tested version&lt;br /&gt;
* No config changes or vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Flashing new firmware requires an STM32 programmer, STLINK software, and python 2.7 setup to run OPP configuration&lt;br /&gt;
* No longer have the most recent firmware features&lt;br /&gt;
&lt;br /&gt;
==== Instructions for loading firmware: ====&lt;br /&gt;
Be sure to use the &#039;&#039;&#039;OppStm32.2.2.0.0.hex&#039;&#039;&#039; file from here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Stm32Workbench/Gen3Images/ Gen3Images]&lt;br /&gt;
&lt;br /&gt;
There are a couple versions of these instructions:&lt;br /&gt;
&lt;br /&gt;
# [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
# [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52655</id>
		<title>OPP Autofire Workaround</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52655"/>
		<updated>2022-12-20T00:30:47Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Under Construction... stand by for greatness.&lt;br /&gt;
&lt;br /&gt;
== Issue: ==&lt;br /&gt;
&lt;br /&gt;
A bug was introduced in OPP firmware version 2.3.0.0 and persisted through 2.3.0.5. Under certain conditions, when you reconfigure an autofire coil, &#039;&#039;&#039;&#039;&#039;the coil can get stuck on&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The most common instance of this bug is when a dual coil flipper is configured with 100% hold power. If the flipper button is held while the ball drains, the flipper autofire device is disabled and the state of the flipper is frozen instead of reset to off. So after a drain, the flipper remains on even after the flipper button is released. When the next ball starts, the flipper device is re-enabled and all goes back to normal.&lt;br /&gt;
&lt;br /&gt;
Similarly, if you have single coil flippers with 8% hold power, you have an 8% chance of seeing the bug if you hold the flipper button as the ball drains. While less likely than the dual wound case, this single wound condition is much worse since a coil intended for an 8% hold could get stuck on at 100% power. This will likely blow a fuse, transistor, coil, etc.&lt;br /&gt;
&lt;br /&gt;
== Options: ==&lt;br /&gt;
=== A) Flash new OPP version 2.x.x.x ===&lt;br /&gt;
A new firmware fix is currently in the works, but in the meantime, consider one of the other workaround options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== B) Add Dummy devices in MPF: ===&lt;br /&gt;
&lt;br /&gt;
If you can prevent disabling an autofire device, you will not see this bug. One method of doing this is to setup a dummy autofire device in MPF. This method requires one unused direct input (two if your autofire devices span across both STM32 processor boards). You must create a dummy autofire device for each autofire device in your machine but all the dummy devices can use the same switch.&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* No firmware flashing&lt;br /&gt;
* Simple MPF config change&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Requires an unused direct input (potentially two if your autofire devices span across both STM32 processor boards)&lt;br /&gt;
* Requires user to account for each autofire coil so the user could accidentally miss one in the MPF config&lt;br /&gt;
* Could unintentionally fire coils from the dummy device if you accidentally connect the dummy switch to something&lt;br /&gt;
* There could be a form of config where this does not protect the bug from appearing&lt;br /&gt;
&lt;br /&gt;
==== Example: ====&lt;br /&gt;
Check here for an example config with dummy devices: [https://github.com/cobra18t/CobraPin/blob/main/Errata/OPP_AutoFire_Workaround.yaml OPP_AutoFire_Workaround.yaml]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== C) Revert to OPP version 2.2.0.0: ===&lt;br /&gt;
This bug did not exist in OPP version 2.2.0.0. Consider flashing 2.2.0.0 to your STM32 processors if you do not use the following features that were introduced after 2.2.0.0:&lt;br /&gt;
# Coil pulse power (kick PWM)&lt;br /&gt;
# RC servo support&lt;br /&gt;
# SPI LED support (APA102, SK9822, etc.)&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* Regression tested version&lt;br /&gt;
* No config changes or vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Flashing new firmware requires an STM32 programmer, STLINK software, and python 2.7 setup to run OPP configuration&lt;br /&gt;
* No longer have the most recent firmware features&lt;br /&gt;
&lt;br /&gt;
==== Instructions for loading firmware: ====&lt;br /&gt;
Be sure to use the &#039;&#039;&#039;OppStm32.2.2.0.0.hex&#039;&#039;&#039; file from here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Stm32Workbench/Gen3Images/ Gen3Images]&lt;br /&gt;
&lt;br /&gt;
There are a couple versions of these instructions:&lt;br /&gt;
&lt;br /&gt;
# [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
# [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52654</id>
		<title>OPP Autofire Workaround</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52654"/>
		<updated>2022-12-20T00:26:46Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Under Construction... stand by for greatness.&lt;br /&gt;
&lt;br /&gt;
== Issue: ==&lt;br /&gt;
&lt;br /&gt;
A bug was introduced in OPP firmware version 2.3.0.0 and persisted through 2.3.0.5. Under certain conditions, when you reconfigure an autofire coil, &#039;&#039;&#039;&#039;&#039;the coil can get stuck on&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The most common instance of this bug is when a dual coil flipper is configured with 100% hold power. If the flipper button is held while the ball drains, the flipper autofire device is disabled and the state of the flipper is frozen instead of reset to off. So after a drain, the flipper remains on even after the flipper button is released. When the next ball starts, the flipper device is re-enabled and all goes back to normal.&lt;br /&gt;
&lt;br /&gt;
Similarly, if you have single coil flippers with 8% hold power, you have an 8% chance of seeing the bug if you hold the flipper button as the ball drains. While less likely than the dual wound case, this single wound condition is much worse since a coil intended for an 8% hold could get stuck on at 100% power. This will likely blow a fuse, transistor, coil, etc.&lt;br /&gt;
&lt;br /&gt;
== Options: ==&lt;br /&gt;
=== A) Flash new OPP version 2.x.x.x ===&lt;br /&gt;
A new firmware fix is currently in the works, but in the meantime, consider one of the other workaround options.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== B) Add Dummy devices in MPF: ===&lt;br /&gt;
&lt;br /&gt;
If you can prevent disabling an autofire device, you will not see this bug. One method of doing this is to setup a dummy autofire device in MPF. This method requires one unused direct input (two if your autofire devices span across both STM32 processor boards). You must create a dummy autofire device for each autofire device in your machine but all the dummy devices can use the same switch.&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* No firmware flashing&lt;br /&gt;
* Simple MPF config change&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Requires an unused direct input (potentially two if your autofire devices span across both STM32 processor boards)&lt;br /&gt;
* Requires user to account for each autofire coil so the user could accidentally miss one in the MPF config&lt;br /&gt;
* Could unintentionally fire coils from the dummy device if you accidentally connect the dummy switch to something&lt;br /&gt;
* There could be a form of config where this does not protect the bug from appearing&lt;br /&gt;
&lt;br /&gt;
==== Example: ====&lt;br /&gt;
Check here for an example config with dummy devices: &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== C) Revert to OPP version 2.2.0.0: ===&lt;br /&gt;
This bug did not exist in OPP version 2.2.0.0. Consider flashing 2.2.0.0 to your STM32 processors if you do not use the following features that were introduced after 2.2.0.0:&lt;br /&gt;
# Coil pulse power (kick PWM)&lt;br /&gt;
# RC servo support&lt;br /&gt;
# SPI LED support (APA102, SK9822, etc.)&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* Regression tested version&lt;br /&gt;
* No config changes or vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Flashing new firmware requires an STM32 programmer, STLINK software, and python 2.7 setup to run OPP configuration&lt;br /&gt;
* No longer have the most recent firmware features&lt;br /&gt;
&lt;br /&gt;
==== Instructions for loading firmware: ====&lt;br /&gt;
Be sure to use the &#039;&#039;&#039;OppStm32.2.2.0.0.hex&#039;&#039;&#039; file from here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Stm32Workbench/Gen3Images/ Gen3Images]&lt;br /&gt;
&lt;br /&gt;
There are a couple versions of these instructions:&lt;br /&gt;
&lt;br /&gt;
# [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
# [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52653</id>
		<title>OPP Autofire Workaround</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52653"/>
		<updated>2022-12-19T23:50:25Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Under Construction... stand by for greatness.&lt;br /&gt;
&lt;br /&gt;
== Issue: ==&lt;br /&gt;
&lt;br /&gt;
A bug was introduced in OPP firmware version 2.3.0.0 and persisted through 2.3.0.5. Under certain conditions, when you reconfigure an autofire coil, &#039;&#039;&#039;&#039;&#039;the coil can get stuck on&#039;&#039;&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
The most common instance of this bug is when a dual coil flipper is configured with 100% hold power. If the flipper button is held while the ball drains, the flipper autofire device is disabled and the state of the flipper is frozen instead of reset to off. So after a drain, the flipper remains on even after the flipper button is released. When the next ball starts, the flipper device is re-enabled and all goes back to normal.&lt;br /&gt;
&lt;br /&gt;
Similarly, if you have single coil flippers with 8% hold power, you have an 8% chance of seeing the bug if you hold the flipper button as the ball drains. While less likely than the dual wound case, this single wound condition is much worse since a coil intended for an 8% hold could get stuck on at 100% power. This will likely blow a fuse, transistor, coil, etc.&lt;br /&gt;
&lt;br /&gt;
== Options: ==&lt;br /&gt;
A new firmware fix is currently in the works, but in the meantime, consider one of these workaround options.&lt;br /&gt;
&lt;br /&gt;
=== A) Add Dummy devices in MPF: ===&lt;br /&gt;
&lt;br /&gt;
If you can prevent disabling an autofire device, you will not see this bug. One method of doing this is to setup a dummy autofire device in MPF. This method requires a single unused direct input. You must create a dummy autofire device for each autofire device in your machine but all the dummy devices can use the same switch.&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* No firmware flashing&lt;br /&gt;
* Simple MPF config change&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Requires an unused direct input&lt;br /&gt;
* Requires user to account for each autofire coil so the user could accidentally miss one in the MPF config&lt;br /&gt;
* Could unintentionally fire coils from the dummy device if you accidentally connect the dummy switch to something&lt;br /&gt;
&lt;br /&gt;
==== Example: ====&lt;br /&gt;
Check here for an example config with dummy devices:&lt;br /&gt;
&lt;br /&gt;
=== B) Revert to OPP version 2.2.0.0: ===&lt;br /&gt;
This bug did not exist in OPP version 2.2.0.0. Consider flashing 2.2.0.0 to your STM32 processors if you do not use the following features that were introduced after 2.2.0.0:&lt;br /&gt;
# Coil pulse power (kick PWM)&lt;br /&gt;
# RC servo support&lt;br /&gt;
# SPI LED support (APA102, SK9822, etc.)&lt;br /&gt;
&lt;br /&gt;
Pros:&lt;br /&gt;
* Regression tested version&lt;br /&gt;
* No config changes or vulnerabilities&lt;br /&gt;
&lt;br /&gt;
Cons:&lt;br /&gt;
* Flashing new firmware requires an STM programmer, STLINK software, and python 2.7 setup to run OPP configuration&lt;br /&gt;
* No longer have the most recent firmware features&lt;br /&gt;
&lt;br /&gt;
==== Instructions for loading firmware: ====&lt;br /&gt;
Be sure to use the &#039;&#039;&#039;OppStm32.2.2.0.0.hex&#039;&#039;&#039; file from here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Stm32Workbench/Gen3Images/ Gen3Images]&lt;br /&gt;
&lt;br /&gt;
There are a couple versions of these instructions:&lt;br /&gt;
&lt;br /&gt;
# [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
# [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52652</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52652"/>
		<updated>2022-12-19T22:55:46Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
&#039;&#039;&#039;Custom alphanumeric boards are available now on Kickstarter!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check it out here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit display was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk (*) in silkscreen.&#039;&#039;&#039; This pin should not be connected to a coil. Quadruple check your pinout or you will burn fuses, transistors, diodes, traces, etc.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire coils getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52651</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52651"/>
		<updated>2022-12-19T22:53:27Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Autofire Devices */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
&#039;&#039;&#039;Custom alphanumeric boards are available now on Kickstarter!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check it out here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit display was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk (*) in silkscreen.&#039;&#039;&#039; This pin should not be connected to a coil. Quadruple check your pinout or you will burn fuses, transistors, diodes, traces, etc.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; OPP firmware versions 2.3.0.0 to 2.3.0.5 have a bug that can lead to autofire devices getting stuck on. Look into more details and your workaround options here: [[OPP_Autofire_Workaround]]&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52650</id>
		<title>OPP Autofire Workaround</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=OPP_Autofire_Workaround&amp;diff=52650"/>
		<updated>2022-12-19T22:48:42Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: Created page with &amp;quot;Under Construction... stand by for greatness.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Under Construction... stand by for greatness.&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52649</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52649"/>
		<updated>2022-12-15T06:41:32Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Switch Inputs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
&#039;&#039;&#039;Custom alphanumeric boards are available now on Kickstarter!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check it out here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit display was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk (*) in silkscreen.&#039;&#039;&#039; This pin should not be connected to a coil. Quadruple check your pinout or you will burn fuses, transistors, diodes, traces, etc.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52648</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52648"/>
		<updated>2022-12-15T06:40:45Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Coil Outputs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
&#039;&#039;&#039;Custom alphanumeric boards are available now on Kickstarter!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check it out here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit display was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk (*) in silkscreen.&#039;&#039;&#039; This pin should not be connected to a coil. Quadruple check your pinout or you will burn fuses, transistors, diodes, traces, etc.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Pinout Information:&#039;&#039;&#039;&lt;br /&gt;
[[File:CobraPin_STM32_Mappings_ALL.pdf]]&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=File:CobraPin_STM32_Mappings_ALL.pdf&amp;diff=52647</id>
		<title>File:CobraPin STM32 Mappings ALL.pdf</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=File:CobraPin_STM32_Mappings_ALL.pdf&amp;diff=52647"/>
		<updated>2022-12-15T06:31:05Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52646</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52646"/>
		<updated>2022-11-17T19:47:43Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* MPF Configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
&#039;&#039;&#039;Custom alphanumeric boards are available now on Kickstarter!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check it out here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit display was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/latest/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52645</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52645"/>
		<updated>2022-10-09T20:56:19Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Segment Displays */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===NeoSeg Serial Segment Displays===&lt;br /&gt;
&#039;&#039;&#039;Custom alphanumeric boards are available now on Kickstarter!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check it out here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit display was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52644</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52644"/>
		<updated>2022-10-09T20:53:45Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Future Hardware Plans */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;&#039;Custom alphanumeric boards are available now on Kickstarter!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Check it out here: [http://kck.st/3QPUDRv NeoSeg Kickstarter]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit display was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52641</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52641"/>
		<updated>2022-06-12T05:49:59Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Future Hardware Plans */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;An 8-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 40 pixels to create an 8-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 40 = 240 &amp;lt; 256). You can also arrange 4 displays together to create a 16x2 digit display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A 2-digit version will also be produced for Ball, Match, Credit, and playfield displays where the 8 digit version may not fit or align with backglass openings. This exact arrangement was used in a custom Joust head-to-head build:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin NeoSeg14 Displays.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
A previous beta version of the displays used 7-digits of a 16-segment display module. That one will not be produced moving forward, but &#039;&#039;shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=File:CobraPin_NeoSeg14_Displays.jpg&amp;diff=52640</id>
		<title>File:CobraPin NeoSeg14 Displays.jpg</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=File:CobraPin_NeoSeg14_Displays.jpg&amp;diff=52640"/>
		<updated>2022-06-12T05:44:12Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52639</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52639"/>
		<updated>2022-06-12T05:36:21Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Xpansion Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
The Satellite Board is now available on my Pinside shop!&lt;br /&gt;
&lt;br /&gt;
Satellite Features:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52638</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52638"/>
		<updated>2022-06-12T05:35:29Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Satellite Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
The Satellite Board is now available on my Pinside shop!&lt;br /&gt;
&lt;br /&gt;
Satellite Features:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
	&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52637</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52637"/>
		<updated>2022-06-12T05:34:13Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Satellite Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
The Satellite Board is now available on my Pinside shop!&lt;br /&gt;
&lt;br /&gt;
Satellite Features:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52636</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52636"/>
		<updated>2022-05-23T01:37:43Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Fuses===&lt;br /&gt;
There are 4 fuses that are 5x20mm size. 3 are for the coil output banks (A, B, C) and one for the LED power. You have to select the current rating of the fuses based on the load you are fusing for each. 10A is the maximum current rating of fuse you should use. I recommend only using slow blow fuses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52635</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52635"/>
		<updated>2022-05-10T05:08:28Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52634</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52634"/>
		<updated>2022-05-10T05:07:27Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Transistor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
You can replace a blown surface mount transistor with a through hole part. Most people will find this a bit easier than a surface mount replacement. The through hole transistor is a TO-251 (IPAK) package. It is a bit smaller than the typical TO-220 package that many pinball techs are used to.&lt;br /&gt;
&lt;br /&gt;
Carefully snip the two leads on the surface mount transistor as close to the body of the transistors as possible. You want to put as little strain on the circuit board pads as possible which is why you cut flush to the transistor body. Then desolder the now vestigial leads from the board. You can leave the body of the FET attached if the two leads are gone. Then solder in the new through hole part. The metal tab side of the transistor faces the output connectors. There are some very small silkscreen marks in the footprint to further identify which side the tab is on. &lt;br /&gt;
&lt;br /&gt;
Here are a variety of options for transistors:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Surface Mount:&#039;&#039;&lt;br /&gt;
* Infineon IRLR3110ZTRPBF&lt;br /&gt;
* ST STD25NF10LT4&lt;br /&gt;
* Wuxi NCE0140KA&lt;br /&gt;
* Wuxi NCEP0178AK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Through Hole:&#039;&#039;&lt;br /&gt;
* Infineon IRLU3110ZPBF&lt;br /&gt;
* Diode Inc. DMT10H009LH3&lt;br /&gt;
* Alpha and Omega AOI296A&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52633</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52633"/>
		<updated>2022-03-23T17:17:39Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* LEDs on the STM32 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board with white buttons, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board or a Type-C version with brass colored buttons, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52627</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52627"/>
		<updated>2022-01-18T05:10:21Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Power Input */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V). &#039;&#039;BEWARE&#039;&#039; J7 is the same connector type as J4 and is right next to it. Swapping them can put the coil high voltage on the 5V bus and destroy lots of things. Check your connections!&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board that is shipped with CobraPin, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52626</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52626"/>
		<updated>2022-01-07T19:03:30Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;. The first LED in the chain is 0-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;. The first LED in the chain is 1-0-0).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board that is shipped with CobraPin, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=Beginner%27s_Guide_to_STM32_flashing&amp;diff=52625</id>
		<title>Beginner&#039;s Guide to STM32 flashing</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=Beginner%27s_Guide_to_STM32_flashing&amp;diff=52625"/>
		<updated>2021-12-14T17:17:08Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==A Beginner&#039;s Guide To Setting Up Cobrapin STM32&#039;s==&lt;br /&gt;
&lt;br /&gt;
I had a lot of difficulty getting the programming of my STM-32s to work out right.  I’m not a Python “super-user” so I put together this guide to help anyone in the same boat as me successfully program your boards.&lt;br /&gt;
&lt;br /&gt;
There are two parts to getting the STM-32’s ready to work with the Cobrapin Board.  Both of these processes need Python 2 so you’ll need to install that on your computer.  You can have both Python 2 and Python 3 on the same machine but you might want to rename the Python 2 exe file to “Python2” and leave the Python 3 file as just “Python”.  In my case I installed Python 2 in the C directory while Python3 resides in the default installation location.&lt;br /&gt;
&lt;br /&gt;
The first step in the process is to use a ST Link programmer to load the firmware for Cobrapin.  A copy of the file can be found here [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Stm32Workbench/Gen3Images/  OppStm32.2.x.x.x.hex].  &lt;br /&gt;
&lt;br /&gt;
Download the appropriate .hex file to an easy to get to location and plug the pins on the bottom header of the STM-32 to the appropriate wires from the programmer.  Also move the top jumper from the “0” to the “1” position as in this photo.&lt;br /&gt;
&lt;br /&gt;
[[File:ST Link and STM32.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can download the ST-Link Utility from STMicroelectronics [https://www.st.com/en/development-tools/stsw-link004.html  ST-Link Utility] and install it on your machine.&lt;br /&gt;
&lt;br /&gt;
Within the ST Link Utility choose file you downloaded in the previous step and choose “program and verify” in the utility.  It should look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:STlink Utility Program.jpg]]&lt;br /&gt;
&lt;br /&gt;
Once the firmware is loaded, unplug the programmer and return the jumper to the “0” position.  Next you will need a USB cable to connect your STM-32 to your computer. &lt;br /&gt;
&lt;br /&gt;
[[File:STM32 with USB.jpg]]&lt;br /&gt;
&lt;br /&gt;
Plug in the USB cable and open “Device Manager”, take note of which port your STM-32 is on like in this screen capture.&lt;br /&gt;
&lt;br /&gt;
[[File:COM_Port.jpg]]&lt;br /&gt;
&lt;br /&gt;
You will need to get a copy of  Gen2Test from here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Python/Gen2Test/ Gen2Test]   Place the  file in your python 2 folder.  &lt;br /&gt;
&lt;br /&gt;
This python program needs some helper programs to make it function and some of these may not already be installed with your version of python 2.  Here is a list of the files needed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Imports.jpg]]&lt;br /&gt;
&lt;br /&gt;
In my case I needed to add “serial” and “rs232Intf”.  Serial can be added by using pip in command prompt.  In command prompt, navigate to your Python 2 folder and if you named your Python 2 exe “python2” then you can enter “python2  -m pip install serial” and it will install serial into your python 2 system (not your Python 3 system that is needed for MPF)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note by cobra18t:&#039;&#039;&#039; The original author installed &amp;quot;serial&amp;quot;. This does not work for me. I had to install &amp;quot;&#039;&#039;&#039;pyserial&#039;&#039;&#039;&amp;quot; with:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;python2 -m pip install pyserial&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:PIP_install_2.7.jpg]]&lt;br /&gt;
&lt;br /&gt;
The “rs232Intf” file can not be installed with pip so you need to go here to download a copy of the file: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Python/Gen2Test/rs232Intf.py rs232Intf] &lt;br /&gt;
&lt;br /&gt;
Once downloaded, place the file in your Lib folder in Python 2&lt;br /&gt;
&lt;br /&gt;
[[File:Lib.jpg]]&lt;br /&gt;
&lt;br /&gt;
Congrats!  You are now ready to install the Cobrapin software for chains 0 and 1.&lt;br /&gt;
&lt;br /&gt;
Go here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config Cobrapin Files]  and download the appropriate versions of the Cobrapin software for your particular needs for both boards “0” and “1”.    Place these files in your Python 2 folder&lt;br /&gt;
&lt;br /&gt;
Lets start with board “0”.  In command prompt (while still in the python 2 directory) enter “python2.exe Gen2Test.py -port=COMx” where “x”  is the COM port number that you noted from Device manger.  In my case it was COM9.  Hit return and you should get a readout of the board firmware version along with the wings.  The printout for this and the following steps should look like this.&lt;br /&gt;
&lt;br /&gt;
[[File:Board_0_program.jpg]]&lt;br /&gt;
&lt;br /&gt;
After this enter these commands where “x” is your board’s Com port.&lt;br /&gt;
&lt;br /&gt;
1)	python2.exe Gen2Test.py -port=COMx –eraseCfg&lt;br /&gt;
&lt;br /&gt;
2)	python2.exe Gen2Test.py -port=COMx –saveCfg –loadCfg=CobraPin_Board0.py (make sure this matches the file name for your board “0” file)&lt;br /&gt;
&lt;br /&gt;
3)	python2.exe Gen2Test.py -port=COMx&lt;br /&gt;
&lt;br /&gt;
4)	python2.exe Gen2Test.py -port=COMx –ser=0&lt;br /&gt;
&lt;br /&gt;
Wow you are done with board 0!  Board 1 is exactly the same but use the file name for your board 1 file in step 2.  Also set the serial number to 1 in step 4 by using “–ser=1”.  The output should look like this.&lt;br /&gt;
&lt;br /&gt;
[[File:Board1_program.jpg]]&lt;br /&gt;
&lt;br /&gt;
Hooray you have just completed programming your STM-32’s!&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=Beginner%27s_Guide_to_STM32_flashing&amp;diff=52624</id>
		<title>Beginner&#039;s Guide to STM32 flashing</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=Beginner%27s_Guide_to_STM32_flashing&amp;diff=52624"/>
		<updated>2021-12-14T07:12:44Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==A Beginner&#039;s Guide To Setting Up Cobrapin STM32&#039;s==&lt;br /&gt;
&lt;br /&gt;
I had a lot of difficulty getting the programming of my STM-32s to work out right.  I’m not a Python “super-user” so I put together this guide to help anyone in the same boat as me successfully program your boards.&lt;br /&gt;
&lt;br /&gt;
There are two parts to getting the STM-32’s ready to work with the Cobrapin Board.  Both of these processes need Python 2 so you’ll need to install that on your computer.  You can have both Python 2 and Python 3 on the same machine but you might want to rename the Python 2 exe file to “Python2” and leave the Python 3 file as just “Python”.  In my case I installed Python 2 in the C directory while Python3 resides in the default installation location.&lt;br /&gt;
&lt;br /&gt;
The first step in the process is to use a ST Link programmer to load the firmware for Cobrapin.  A copy of the file can be found here [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Stm32Workbench/Gen3Images/  OppStm32.2.x.x.x.hex].  &lt;br /&gt;
&lt;br /&gt;
Download the appropriate .hex file to an easy to get to location and plug the pins on the bottom header of the STM-32 to the appropriate wires from the programmer.  Also move the top jumper from the “0” to the “1” position as in this photo.&lt;br /&gt;
&lt;br /&gt;
[[File:ST Link and STM32.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can download the ST-Link Utility from STMicroelectronics [https://www.st.com/en/development-tools/stsw-link004.html  ST-Link Utility] and install it on your machine.&lt;br /&gt;
&lt;br /&gt;
Within the ST Link Utility choose file you downloaded in the previous step and choose “program and verify” in the utility.  It should look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:STlink Utility Program.jpg]]&lt;br /&gt;
&lt;br /&gt;
Once the firmware is loaded, unplug the programmer and return the jumper to the “0” position.  Next you will need a USB cable to connect your STM-32 to your computer. &lt;br /&gt;
&lt;br /&gt;
[[File:STM32 with USB.jpg]]&lt;br /&gt;
&lt;br /&gt;
Plug in the USB cable and open “Device Manager”, take note of which port your STM-32 is on like in this screen capture.&lt;br /&gt;
&lt;br /&gt;
[[File:COM_Port.jpg]]&lt;br /&gt;
&lt;br /&gt;
You will need to get a copy of  Gen2Test from here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Python/Gen2Test/ Gen2Test]   Place the  file in your python 2 folder.  &lt;br /&gt;
&lt;br /&gt;
This python program needs some helper programs to make it function and some of these may not already be installed with your version of python 2.  Here is a list of the files needed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Imports.jpg]]&lt;br /&gt;
&lt;br /&gt;
In my case I needed to add “serial” and “rs232Intf”.  Serial can be added by using pip in command prompt.  In command prompt, navigate to your Python 2 folder and if you named your Python 2 exe “python2” then you can enter “python2  -m pip install serial” and it will install serial into your python 2 system (not your Python 3 system that is needed for MPF)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note by cobra18t:&#039;&#039;&#039; The original author installed &amp;quot;serial&amp;quot;. This does not work for me. I had to install &amp;quot;&#039;&#039;&#039;pyserial&#039;&#039;&#039;&amp;quot; with:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;python2 -m pip install pyserial&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:PIP_install_2.7.jpg]]&lt;br /&gt;
&lt;br /&gt;
The “rs232Intf” file can not be installed with pip so you need to go here to download a copy of the file: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Python/Gen2Test/rs232Intf.py rs232Intf] &lt;br /&gt;
&lt;br /&gt;
Once downloaded, place the file in your Lib folder in Python 2&lt;br /&gt;
&lt;br /&gt;
[[File:Lib.jpg]]&lt;br /&gt;
&lt;br /&gt;
Congrats!  You are now ready to install the Cobrapin software for chains 0 and 1.&lt;br /&gt;
&lt;br /&gt;
Go here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config Cobrapin Files]  and download the appropriate versions of the Cobrapin software for your particular needs for both boards “0” and “1”.    Place these files in your Python 2 folder&lt;br /&gt;
&lt;br /&gt;
Lets start with board “0”.  In command prompt (while still in the python 2 directory) enter “python2 .exe Gen2Test.py port=COMx” where “x”  is the COM port number that you noted from Device manger.  In my case it was COM9.  Hit return and you should get a readout of the board firmware version along with the wings.  The printout for this and the following steps should look like this.&lt;br /&gt;
&lt;br /&gt;
[[File:Board_0_program.jpg]]&lt;br /&gt;
&lt;br /&gt;
After this enter these commands where “x” is your board’s Com port.&lt;br /&gt;
&lt;br /&gt;
1)	python2.exe Gen2Test.py -port=COMx –eraseCfg&lt;br /&gt;
&lt;br /&gt;
2)	python2.exe Gen2Test.py -port=COMx –saveCfg –loadCfg=CobraPin_Board0.py (make sure this matches the file name for your board “0” file)&lt;br /&gt;
&lt;br /&gt;
3)	python2.exe Gen2Test.py -port=COMx&lt;br /&gt;
&lt;br /&gt;
4)	python2.exe Gen2Test.py -port=COMx –ser=0&lt;br /&gt;
&lt;br /&gt;
Wow you are done with board 0!  Board 1 is exactly the same but use the file name for your board 1 file in step 2.  Also set the serial number to 1 in step 4 by using “–ser=1”.  The output should look like this.&lt;br /&gt;
&lt;br /&gt;
[[File:Board1_program.jpg]]&lt;br /&gt;
&lt;br /&gt;
Hooray you have just completed programming your STM-32’s!&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=Beginner%27s_Guide_to_STM32_flashing&amp;diff=52623</id>
		<title>Beginner&#039;s Guide to STM32 flashing</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=Beginner%27s_Guide_to_STM32_flashing&amp;diff=52623"/>
		<updated>2021-12-14T05:57:14Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==A Beginner&#039;s Guide To Setting Up Cobrapin STM32&#039;s==&lt;br /&gt;
&lt;br /&gt;
I had a lot of difficulty getting the programming of my STM-32s to work out right.  I’m not a Python “super-user” so I put together this guide to help anyone in the same boat as me successfully program your boards.&lt;br /&gt;
&lt;br /&gt;
There are two parts to getting the STM-32’s ready to work with the Cobrapin Board.  Both of these processes need Python 2 so you’ll need to install that on your computer.  You can have both Python 2 and Python 3 on the same machine but you might want to rename the Python 2 exe file to “Python2” and leave the Python 3 file as just “Python”.  In my case I installed Python 2 in the C directory while Python3 resides in the default installation location.&lt;br /&gt;
&lt;br /&gt;
The first step in the process is to use a ST Link programmer to load the firmware for Cobrapin.  A copy of the file can be found here [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Stm32Workbench/Gen3Images/  OppStm32.2.x.x.x.hex].  &lt;br /&gt;
&lt;br /&gt;
Download the appropriate .hex file to an easy to get to location and plug the pins on the bottom header of the STM-32 to the appropriate wires from the programmer.  Also move the top jumper from the “0” to the “1” position as in this photo.&lt;br /&gt;
&lt;br /&gt;
[[File:ST Link and STM32.jpg]]&lt;br /&gt;
&lt;br /&gt;
You can download the ST-Link Utility from STMicroelectronics [https://www.st.com/en/development-tools/stsw-link004.html  ST-Link Utility] and install it on your machine.&lt;br /&gt;
&lt;br /&gt;
Within the ST Link Utility choose file you downloaded in the previous step and choose “program and verify” in the utility.  It should look like this:&lt;br /&gt;
&lt;br /&gt;
[[File:STlink Utility Program.jpg]]&lt;br /&gt;
&lt;br /&gt;
Once the firmware is loaded, unplug the programmer and return the jumper to the “0” position.  Next you will need a USB cable to connect your STM-32 to your computer. &lt;br /&gt;
&lt;br /&gt;
[[File:STM32 with USB.jpg]]&lt;br /&gt;
&lt;br /&gt;
Plug in the USB cable and open “Device Manager”, take note of which port your STM-32 is on like in this screen capture.&lt;br /&gt;
&lt;br /&gt;
[[File:COM_Port.jpg]]&lt;br /&gt;
&lt;br /&gt;
You will need to get a copy of  Gen2Test from here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Python/Gen2Test/ Gen2Test]   Place the  file in your python 2 folder.  &lt;br /&gt;
&lt;br /&gt;
This python program needs some helper programs to make it function and some of these may not already be installed with your version of python 2.  Here is a list of the files needed.  &lt;br /&gt;
&lt;br /&gt;
[[File:Imports.jpg]]&lt;br /&gt;
&lt;br /&gt;
In my case I needed to add “serial” and “rs232Intf”.  Serial can be added by using pip in command prompt.  In command prompt, navigate to your Python 2 folder and if you named your Python 2 exe “python2” then you can enter “python2  -m pip install serial” and it will install serial into your python 2 system (not your Python 3 system that is needed for MPF)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note by cobra18t:&#039;&#039;&#039; The original author installed &amp;quot;serial&amp;quot;. This does not work for me. I had to install &amp;quot;&#039;&#039;&#039;pyserial&#039;&#039;&#039;&amp;quot; with:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;python2 -m pip install pyserial&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:PIP_install_2.7.jpg]]&lt;br /&gt;
&lt;br /&gt;
The “rs232Intf” file can not be installed with pip so you need to go here to download a copy of the file: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/Python/Gen2Test/rs232Intf.py rs232Intf] &lt;br /&gt;
&lt;br /&gt;
Once downloaded, place the file in your Lib folder in Python 2&lt;br /&gt;
&lt;br /&gt;
[[File:Lib.jpg]]&lt;br /&gt;
&lt;br /&gt;
Congrats!  You are now ready to install the Cobrapin software for chains 0 and 1.&lt;br /&gt;
&lt;br /&gt;
Go here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config Cobrapin Files]  and download the appropriate versions of the Cobrapin software for your particular needs for both boards “0” and “1”.    Place these files in your Python 2 folder&lt;br /&gt;
&lt;br /&gt;
Lets start with board “0”.  In command prompt (while still in the python 2 directory) enter “python2 .exe Gen2Test.py port=COMx” where “x”  is the COM port number that you noted from Device manger.  In my case it was COM9.  Hit return and you should get a readout of the board firmware version along with the wings.  The printout for this and the following steps should look like this.&lt;br /&gt;
&lt;br /&gt;
[[File:Board_0_program.jpg]]&lt;br /&gt;
&lt;br /&gt;
After this enter these commands where “x” is your board’s Com port.&lt;br /&gt;
&lt;br /&gt;
1)	python2 .exe Gen2Test.py port=COMx –eraseCfg&lt;br /&gt;
&lt;br /&gt;
2)	python2 .exe Gen2Test.py port=COMx –saveCfg –loadCfg=CobraPin_Board0.py (make sure this matches the file name for your board “0” file)&lt;br /&gt;
&lt;br /&gt;
3)	python2 .exe Gen2Test.py port=COMx&lt;br /&gt;
&lt;br /&gt;
4)	python2 .exe Gen2Test.py port=COMx –ser=0&lt;br /&gt;
&lt;br /&gt;
Wow you are done with board 0!  Board 1 is exactly the same but use the file name for your board 1 file in step 2.  Also set the serial number to 1 in step 4 by using “–ser=1”.  The output should look like this.&lt;br /&gt;
&lt;br /&gt;
[[File:Board1_program.jpg]]&lt;br /&gt;
&lt;br /&gt;
Hooray you have just completed programming your STM-32’s!&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52622</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52622"/>
		<updated>2021-11-12T23:58:36Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;12-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (12-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Outputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Expansion Boards ==&lt;br /&gt;
As with any &amp;quot;all-in-one&amp;quot; solution, sometimes people want something extra or slightly different than the main offering. That is what these expansion boards are for. These can be used together with the main board, separately, or even alongside another board supported by MPF.&lt;br /&gt;
== Xpansion Board ==&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps. The lamp matrix can drive either incandescent or LED lamps.&lt;br /&gt;
===Xpansion Features ===&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Switch diode protection&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Xpansion Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and Lamp power input (usually 18V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank D outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There is a 9-pin 2.54mm pitch KF2510 style connector for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against both high and negative voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J2&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
==== Lamp Matrix Outputs ====&lt;br /&gt;
&lt;br /&gt;
There is a 9-pin 3.96mm JST VH style connector for matrix columns and a 9-pin 2.54mm pitch KF2510 style connector for matrix rows. Column and row numbers are labeled in silkscreen. There is an unused pin on each connector marked with an asterisk in silkscreen.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1&#039;&#039;&#039;: Lamp matrix Columns.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J3&#039;&#039;&#039;: Lamp matrix Rows.&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Satellite Board ==&lt;br /&gt;
The Satellite board offers more direct switch inputs to make it easier to avoid using a switch matrix. It also carries with it a number of other expanded capabilities.&lt;br /&gt;
=== Satellite Features ===&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
=== Satellite Wiring ===&lt;br /&gt;
==== Power Input ====&lt;br /&gt;
Power comes in to the board on a 4-pin 3.96mm pitch JST VH style connector. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4&#039;&#039;&#039;: Coil power input (12-50V) and LED power input (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== Coil Power Output ====&lt;br /&gt;
The output power for the coils comes from a pin on the coil output connector (J6). It is marked with an asterisk in silkscreen. This output is fused by F2. The blue D26 LED lights when power is applied. Check this LED if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
==== Coil Outputs ====&lt;br /&gt;
The 8 coil outputs are on a 9-pin 3.96mm JST VH style connector. There is a ninth pin on the connector that provides fused coil power and is marked with an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank E outputs&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
==== Switch Inputs ====&lt;br /&gt;
There are 3 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return.&lt;br /&gt;
&lt;br /&gt;
Switches have diode protection against negative voltages. There is also bidirectional protection based on resettable polyfuses to protect switch inputs from higher voltages.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
If you are using a the Satellite Board to drive a switch matrix, see section above.&lt;br /&gt;
&lt;br /&gt;
====Neopixel RGB LEDs====&lt;br /&gt;
The neopixel chain supports 256 RGB pixels. This output is on a 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J7 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J5&#039;&#039;&#039;: NEO 3 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;3-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Fused LED power output (5-12V)&lt;br /&gt;
&lt;br /&gt;
==== USB ====&lt;br /&gt;
The processor board is connected to the host computer via a separate USB-C cable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board that is shipped with CobraPin, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52621</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52621"/>
		<updated>2021-11-12T21:10:59Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Satellite Board */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;24-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;5 or 12V&#039;&#039;&#039; LED power&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (24-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Ouputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board that is shipped with CobraPin, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52620</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52620"/>
		<updated>2021-11-10T17:00:42Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;24-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
Here is an example of the working 14-segment 8-digit version:&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg14_example.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (24-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Ouputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board that is shipped with CobraPin, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=File:CobraPin_Neoseg14_example.jpg&amp;diff=52619</id>
		<title>File:CobraPin Neoseg14 example.jpg</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=File:CobraPin_Neoseg14_example.jpg&amp;diff=52619"/>
		<updated>2021-11-10T16:57:22Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52618</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52618"/>
		<updated>2021-11-10T16:56:06Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;24-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
There is also another variant in the works that uses 14-segment modules. This one has 8 digits instead of 7 but is still slightly narrower overall. The character height/width is the same, it is just the module that is narrower. The individual segments are also a bit thinner. Shown here is a 16-segment based display along with the 14-segment modules for comparison.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_Neoseg_digitComparison.jpg|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (24-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Ouputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Lamp Matrix Numbering===&lt;br /&gt;
The lamp matrix is hosted on the Xpansion board. The valid numbers are 2-0-0 through 2-0-63. An example config can be found [https://raw.githubusercontent.com/cobra18t/CobraPin/main/MPF%20Config/lamp_matrix_example_config.yaml here].&lt;br /&gt;
[[File:Cobrapin_lamp_matrix.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
&lt;br /&gt;
For those not familiar with python, a detailed step by step walkthrough of the process can be found here: [[Beginner&#039;s Guide to STM32 flashing]]&lt;br /&gt;
&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board that is shipped with CobraPin, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=File:CobraPin_Neoseg_digitComparison.jpg&amp;diff=52617</id>
		<title>File:CobraPin Neoseg digitComparison.jpg</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=File:CobraPin_Neoseg_digitComparison.jpg&amp;diff=52617"/>
		<updated>2021-11-10T16:48:37Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52593</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52593"/>
		<updated>2021-08-28T22:17:25Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;24-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (24-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Ouputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board that is shipped with CobraPin, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52592</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52592"/>
		<updated>2021-08-28T20:06:11Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Where to Buy: */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was be released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;24-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (24-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Ouputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board that is shipped with CobraPin, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
	<entry>
		<id>https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52591</id>
		<title>CobraPin</title>
		<link rel="alternate" type="text/html" href="https://test.pinballmakers.com/wiki/index.php?title=CobraPin&amp;diff=52591"/>
		<updated>2021-08-28T20:05:52Z</updated>

		<summary type="html">&lt;p&gt;Tfulenwider: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==CobraPin Pinball Controller==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPinV1_02_isoSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
== Overview ==&lt;br /&gt;
CobraPin is a pinball controller designed to offer a basic all-in-one assembled affordable solution. It is intended to be hosted by a computer running the Mission Pinball Framework ([https://missionpinball.org/ MPF]) and is based on the Open Pinball Project ([https://pinballmakers.com/wiki/index.php?title=OPP OPP]) It was be released to the public in 2021 on Kickstarter.&lt;br /&gt;
&lt;br /&gt;
===Features:===&lt;br /&gt;
* &#039;&#039;&#039;24 coil drivers&#039;&#039;&#039; for solenoids, flashers, motors, etc. Outputs are broken out into 3 banks of 8 outputs.&lt;br /&gt;
* &#039;&#039;&#039;38 direct switch inputs&#039;&#039;&#039; &amp;lt;OR&amp;gt; &#039;&#039;&#039;22 direct inputs&#039;&#039;&#039; and an &#039;&#039;&#039;8x8 switch matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Neopixel support&#039;&#039;&#039; for 512 RGB or RGBW LEDs&lt;br /&gt;
*&#039;&#039;&#039;24-50V power filter&#039;&#039;&#039;. Board also provides the common ground for the supplies.&lt;br /&gt;
*&#039;&#039;&#039;Fuses&#039;&#039;&#039; for solenoid banks and Neopixels&lt;br /&gt;
*&#039;&#039;&#039;Relay Control Output&#039;&#039;&#039; for common dual relay boards&lt;br /&gt;
*Easy replacement of at-risk components&lt;br /&gt;
**Processor boards are socketed&lt;br /&gt;
**Transistors can be removed with simple soldering tools and replaced with through-hole components&lt;br /&gt;
**Fuse clips for common 5x20mm fuses&lt;br /&gt;
&lt;br /&gt;
===Where to Buy:===&lt;br /&gt;
CobraPin is now available on the [https://pinside.com/pinball/market/shops/1254-cobra-amusements Cobra Amusements] Pinside shop.&lt;br /&gt;
&lt;br /&gt;
==Future Hardware Plans==&lt;br /&gt;
===Satellite Board===&lt;br /&gt;
By popular demand, I will start work on another expansion board with more switch inputs to make it easier for users to avoid a switch matrix if they so desire. &lt;br /&gt;
The current plan is have:&lt;br /&gt;
* &#039;&#039;&#039;23 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;Neopixel output&#039;&#039;&#039; for 256 RGB or RGBW LEDs&lt;br /&gt;
* &#039;&#039;&#039;I/O Protection&#039;&#039;&#039; for input pins.&lt;br /&gt;
&lt;br /&gt;
This would bring the total--using a CobraPin main board and this board--up to 61 direct switch inputs, 32 coil outputs, and 3 neopixel chains totalling 768 lights.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin Satellite isoSmall.png|500px]]&lt;br /&gt;
&lt;br /&gt;
===Xpansion Board===&lt;br /&gt;
The Xpansion is a beta expansion board for CobraPin. Contact cobra18t on Pinside if you would like to get your hands on one.&lt;br /&gt;
It supports:&lt;br /&gt;
* &#039;&#039;&#039;8x8 Lamp matrix&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;8 coil outputs&#039;&#039;&#039; for solenoids, flashers, motors, etc.&lt;br /&gt;
* &#039;&#039;&#039;8 direct switch inputs&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The purpose of the Xpansion board is to make it easier for people to control existing machines with flashers and matrix controlled lamps.&lt;br /&gt;
&lt;br /&gt;
[[File:Xpansion_v0_02_small.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
===Segment Displays===&lt;br /&gt;
&#039;&#039;While regular segment displays will not be supported by CobraPin, custom alphanumeric boards are under development.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A 7-digit prototype was created that is controlled by the neopixel output and the display is mono color. Multiple color options are available. Each segment acts as a neopixel channel, so it takes the equivalent of 42 pixels to create a 7-digit display. Multiple displays can be daisy-chained together, so you can have up to 6 displays on a single CobraPin output channel (6 x 42 = 252 &amp;lt; 256). You can also arrange 4 displays together to create a 14x2 display that fits in the same area as something like a WPC89 display. &#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Shown here are two displays next to each other, a red and blue.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_NeoSeg.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
== Wiring ==&lt;br /&gt;
[[File:CobraPinConnectionDiagram.jpg]]&lt;br /&gt;
===Power Input===&lt;br /&gt;
Power comes in to the board on two 4-pin 3.96mm pitch connectors. The default connectors are JST VH style. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J9&#039;&#039;&#039;: Coil power input (24-50V). &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J10&#039;&#039;&#039;: Neopixel 5V input&lt;br /&gt;
&lt;br /&gt;
====Coil Power Supply Requirement====&lt;br /&gt;
Since CobraPin has large capacitors, it takes high current for a short time to charge them up at initial power-on. Most switch mode power supplies (digital rather than the old transformers) have overload protection that kick in during this initial power-on state. Some protection modes are incompatible with CobraPin. The incompatible protection modes will just shut off while trying to charge the capacitors. Nothing bad happens, but you just don&#039;t have power.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO NOT&#039;&#039;&#039; use a power supply that shuts down its output in an overload state. Meanwell SE series is an examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list.&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_Cut.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DO&#039;&#039;&#039; use a power supply with &#039;&#039;&#039;constant-current limiting&#039;&#039;&#039; or something that says &amp;quot;&#039;&#039;&#039;recovers automatically&#039;&#039;&#039;&amp;quot; for overload protection. Meanwell RSP, HRP, and MSP series are examples of this. This is &#039;&#039;not&#039;&#039; an exhaustive list. Most generic power supplies sold for LED strip lighting applications have constant current limiting. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_PS_ConstantCurrent.png]]&lt;br /&gt;
&lt;br /&gt;
====Power Jumper====&lt;br /&gt;
&#039;&#039;&#039;JP9&#039;&#039;&#039;: The input goes through an NTC thermistor to limit the load on the power supply when it first turns on and charges the large power capacitors. When cold, the thermistor is about 1.5ohms, as it heats up, the resistance drops considerably (1/10th or 1/20th of the cold resistance). If you find that the first minute of play is too weak, you can bypass the thermistor by soldering a wire at JP9. This will further load your power supply at startup, so proceed with caution.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Power Output===&lt;br /&gt;
The output power for the coils comes from a 3-pin 3.96mm JST VH style connector. These outputs are fused by F1, F2, and F3. Each pin provides an output for one of the coil banks. The pinout is labeled in silkscreen on the board.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J13&#039;&#039;&#039;: Coil power outputs. Each pin should be used to power the coils in its corresponding bank.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Coil Ouputs===&lt;br /&gt;
The 24 coils are broken up into 3 banks of 8 outputs. The 3 9-pin 3.96mm connectors are JST VH style. There is a ninth pin on the connector that can be used as a key. That pin is marked by an asterisk in silkscreen. The coil outputs are labeled in silkscreen with the MPF compatible numbers.&lt;br /&gt;
&lt;br /&gt;
Each coil output has a diode to help protect the transistor. You may still use coils with axial diodes installed, but you &#039;&#039;&#039;MUST&#039;&#039;&#039; ensure that you connect them with the &#039;&#039;&#039;correct polarity&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Every coil in a bank should be powered by the associated bank power pin on J13. For example, coils in Bank A should be powered by the HV_A pin of J13.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J6&#039;&#039;&#039;: Coil bank A outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J7&#039;&#039;&#039;: Coil bank B outputs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J8&#039;&#039;&#039;: Coil bank C outputs&lt;br /&gt;
&lt;br /&gt;
Each bank has an LED next to it to indicate if that bank has power. Check these if you are concerned you have blown a fuse.&lt;br /&gt;
&lt;br /&gt;
Each solenoid has an associated yellow LED to indicate it is being driven by the processor. It is highly recommended to test a new setup &#039;&#039;&#039;&#039;&#039;without&#039;&#039;&#039;&#039;&#039; high voltage power or without the coils plugged in. Using these LEDs, you can verify that each output is being driven correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Switch Inputs===&lt;br /&gt;
There are 5 9-pin 2.54mm pitch KF2510 style connectors for switches. The switch inputs are labeled in silkscreen with the MPF compatible numbers. Each connector also includes a logic ground pin. Use this for the direct input return. The two pins labeled “N/C” are not connected to anything.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J1, J2, J3&#039;&#039;&#039;: Direct input switches.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J4, J5&#039;&#039;&#039;: Remaining direct input switches &amp;lt;OR&amp;gt; switch matrix input/output. The matrix row and column numbers are labeled in silkscreen in parentheses. See MPF section below for switch matrix anomalies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; the switch inputs should be limited to 3.3V since the &#039;&#039;&#039;STM32 is a 3.3V device&#039;&#039;&#039;. If you are using an active switch like a drop target opto board, make sure none of the switch pins can go above 3.3V. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Board Error:&#039;&#039;&#039; On board versions 1.02 and older, the silkscreen pin labels for J4 and J5 are swapped. As an example, the pin labelled 1-0-16 on J4 is actually 1-0-24 and the pin labelled 1-0-24 on J5 is actually 1-0-16. This only applies if you are using a Direct switch configuration. Switch matrix users will use the matrix numbering anyway. &lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_label swap.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
====3.3V Input Limiting Example====&lt;br /&gt;
&lt;br /&gt;
For an example of limiting a device to 3.3V, the 5768-12368-00 drop target opto board from Police Force requires 10k resistors in the R9, R10, and R11 positions (see below) to keep the column voltage under 3.3V. If you do not do this, the opto board will try to the pull the column up to 12V. If you only use the 18k resistors suggested in the manual, the voltage will be limited to 4.8V...which is still too high. &lt;br /&gt;
&lt;br /&gt;
Your other option in the case of 5768-12368-00 is to power the drop target board off of 3.3V &#039;&#039;&#039;instead&#039;&#039;&#039; of 12V so there are no higher voltages even present on the board. This would require changing R1, R3, R5 to 100ohms (standard 1/4W resistor would be fine) in order to drive the opto with a similar current given the lower drive voltage. The LM339 should operate fine at 3.3V.&lt;br /&gt;
&lt;br /&gt;
[[File:Wiliams_5768-12368-00_schematic.PNG|600px]]&lt;br /&gt;
&lt;br /&gt;
====Matrix Row Pull Resistor Jumpers====&lt;br /&gt;
&lt;br /&gt;
When using optos in a switch matrix, sometimes the internal pull resistors on the switch matrix inputs (rows) are not strong enough to register opto inputs properly. If this becomes a problem, you can use the onboard pull resistors to augment the internal resistors in the STM32. To do so, make a solder bridge on the 8 row jumpers (JP1-8) on the underside of the board. If you have a standard active-low matrix, then the solder jumper needs to be on the PULL_UP side. If you are instead using and active-high matrix, the jumper should be on the PULL_DOWN side.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;WARNING:&#039;&#039;&#039;&#039;&#039; &#039;&#039;&#039;DO NOT&#039;&#039;&#039; &#039;&#039;connect all three pads of a jumper together. This would short 3.3V and GND together and will likely destroy the STM32 processor board.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_pullupdownSmall.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
===Neopixel RGB LEDs===&lt;br /&gt;
There are two neopixel chains that support 256 RGB pixels each for a total of 512. These outputs are on 2 3-pin 3.96mm JST VH connectors. RGBW pixels are also possible.&lt;br /&gt;
&lt;br /&gt;
The J14 fused output can be used to provide additional power taps in a neopixel chain. This is a 4-pin 3.96mm JST VH style connector. Each pin is rated for 7A continuous. The fuse holder is rated for 10A. The red D25 LED can be used to confirm you have a good fuse (F4) and are providing power for neopixels.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J11&#039;&#039;&#039;: NEO 0 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;0-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J12&#039;&#039;&#039;: NEO 1 Neopixel output (all these lights have MPF numbers with the format &#039;&#039;&#039;1-0-##&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J14&#039;&#039;&#039;: Fused 5V output&lt;br /&gt;
&lt;br /&gt;
===USB===&lt;br /&gt;
The two processor boards are connected to the host computer via two separate USB-C cables (the beta version used micro-USB cables).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relay Control Output===&lt;br /&gt;
CobraPin can drive a dual relay board commonly sold for Arduino applications. These relay boards are powered by 5V and are driven by two control signals. The 5V power for the relay control comes from the Board 1 USB power.&lt;br /&gt;
&lt;br /&gt;
By default, nothing is connected to the two control outputs. On the underside of the CobraPin are two 3-way solder jumpers. Each jumper controls how one of the control outputs is driven. Connecting the middle and lower pad enables that relay control output any time there is USB power to the Board 1 processor board. Connecting the middle and upper pads gives control of the relay programmatically to MPF by using the 1-0-1 coil output.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When using the 1-0-1 coil output for relay control, do not use the 1-0-1 output on J8. These are controlled by the same processor pin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;J15&#039;&#039;&#039;: 5V power and control for a dual relay board&lt;br /&gt;
&lt;br /&gt;
[[File:CobraPin_relayJumperSmall.JPG|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MPF Configuration ==&lt;br /&gt;
It is &#039;&#039;&#039;HIGHLY RECOMMENDED&#039;&#039;&#039; that you start your MPF game-making journey with the [https://docs.missionpinball.org/en/dev/tutorial/index.html MPF Tutorial]&lt;br /&gt;
&lt;br /&gt;
You should install version 0.55 or higher of MPF. As of 20210601, this means you need to install the dev version of MPF.&lt;br /&gt;
&lt;br /&gt;
For detailed MPF documentation, head over to [https://docs.missionpinball.org/en/dev/ MPF Docs]&lt;br /&gt;
&lt;br /&gt;
CobraPin specific info can be found here: [https://docs.missionpinball.org/en/dev/hardware/opp/cobrapin/index.html CobraPin on MPF Docs]&lt;br /&gt;
&lt;br /&gt;
An [https://github.com/cobra18t/CobraPin/tree/main/MPF%20Config Example Config] is available to help you start your game&#039;s config.&lt;br /&gt;
&lt;br /&gt;
===Switch Matrix===&lt;br /&gt;
OPP now supports both active low and active high switch matrices. Active low and high refer to the direction that the columns are strobed in a switch matrix. The style that you want is selected by loading the respective OPP configuration into the STM32 board. See OPP Configuration below.&lt;br /&gt;
&lt;br /&gt;
On CobraPin, the &#039;&#039;&#039;SW MATRIX OUT&#039;&#039;&#039; connector has the column outputs 0-7 and the &#039;&#039;&#039;SW MATRIX IN&#039;&#039;&#039; connector has the row inputs 0-7.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The default Standard configuration of CobraPin uses an active low matrix.&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
====Active Low Matrix====&lt;br /&gt;
An active low matrix pulls a column down when it is selected so  that any active switch pulls the associated row down. In an active low matrix, the diodes always point toward the columns. Williams is an example of a manufacturer that always used an active low matrix. &lt;br /&gt;
&lt;br /&gt;
====Active High Matrix====&lt;br /&gt;
In an active high matrix, the logic is just reversed. Columns pulse high so active switches are pulled high. The diodes point toward the rows. Gottlieb System 3 is an example of a system that used an active high matrix.&lt;br /&gt;
&lt;br /&gt;
In many cases, you can use an active low matrix to drive a machine that was intended to have an active high matrix by just swapping the row and column connectors. Then the diodes will point to the columns as required for an active low matrix. If you do this, you will have to transpose your matrix switch numbering from what you might find in your game&#039;s manual since the rows are columns and the columns are the rows now. This method will work for simple mechanical but your mileage may vary on active switches like some optos and drop target banks.&lt;br /&gt;
&lt;br /&gt;
Switches inputs from an active high matrix in MPF appear to be inverted. So when a switch is open or &#039;&#039;&#039;OFF&#039;&#039;&#039;, it appears in MPF that it is closed or &#039;&#039;&#039;ON&#039;&#039;&#039;. To fix this, you have to invert it again. So you add &amp;quot;&#039;&#039;&#039;type: NC&#039;&#039;&#039;&amp;quot; to the switch definition of a normally-open matrix switch. The &#039;&#039;&#039;NC&#039;&#039;&#039; stands for Normally-Closed. I know it is backwards, but that is how it works. This is not required for the Standard active low matrix&lt;br /&gt;
&lt;br /&gt;
====Matrix Numbering====&lt;br /&gt;
The matrix is hosted by Board 1 on the CobraPin, so the valid numbers for switches are 1-0-32 through 1-0-95. See table below.&lt;br /&gt;
&lt;br /&gt;
[[File:OPP_SW_MAT_numbering.jpg|800px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Autofire Devices===&lt;br /&gt;
Autofire devices use a configurable link between a switch and a coil output to control the coil with the absolute minimal latency by allowing the STM32 to directly control the coil rather than the control coming from the host computer. These should be used for timing critical coils like flippers, pop bumpers, and slings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; an autofire coil must be controlled by a switch on the same STM32 board. So a 1-0-xx switch needs to control a 1-0-yy coil and a 0-0-xx switch needs to control a 0-0-yy coil.&lt;br /&gt;
&lt;br /&gt;
== STM32 Flashing and OPP Configuration ==&lt;br /&gt;
The firmware on the STM32 board exists in two parts: the &#039;&#039;&#039;base application&#039;&#039;&#039; and the &#039;&#039;&#039;OPP configuration&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;As delivered, the boards should be flashed and configured appropriately.&#039;&#039;&#039; But if you need to updated something or replace a processor board, this section is for you. &lt;br /&gt;
&lt;br /&gt;
The base application must be flashed with a separate programming device while the OPP configuration can be changed over USB via Python scripts.&lt;br /&gt;
===Flashing===&lt;br /&gt;
You can download a snapshot of the OPP source here: [https://sourceforge.net/p/open-pinball-project/code/HEAD/tree/trunk/ OPP Source]&lt;br /&gt;
&lt;br /&gt;
The STM32 firmware images can be found in the folder &#039;&#039;&#039;Stm32Workbench / Gen3Images /&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Instructions for flashing&#039;&#039;&#039; the base application on to the STM32 board can be found here on the OPP site: [https://openpinballproject.wordpress.com/2020/11/03/11-3-2020-loading-stm32-firmware/ Loading STM32 Firmware]&lt;br /&gt;
&lt;br /&gt;
===Configuration===&lt;br /&gt;
Pre-made config files can be found here: [https://github.com/cobra18t/CobraPin/tree/main/OPP%20Config CobraPin STM32 Config Files]&lt;br /&gt;
&lt;br /&gt;
You can use these or modify them for your own needs. For example, OPP has the capability to operate in &amp;quot;whitewood mode.&amp;quot; That means that switches can be assigned to coil outputs to control a machine in a basic way (flippers flipping, pops and slings firing, but no rules) before you have MPF up and running. This is setup in the config and is unique to your own machine. &lt;br /&gt;
&lt;br /&gt;
There are two processor boards on the CobraPin with the board numbers labeled on silkscreen under the boards. Board 0 is the upper board and Board 1 is the lower board. Each board requires a different config and should not be swapped without re-configuring OPP.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Putting a Board 1 config in a Board 0 slot could result in blown FETs, coils, or fuses. A Board 0 config should also not go in the Board 1 slot. Proceed with caution!&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=====Board 0=====&lt;br /&gt;
&#039;&#039;&#039;Regular:&#039;&#039;&#039; Neopixels on J11 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NoGlow:&#039;&#039;&#039; Neopixels on J11 will stay off at power up.&lt;br /&gt;
&lt;br /&gt;
=====Board 1=====&lt;br /&gt;
There are 3 variants for Board 1. By default, all of them have neopixels on J12 that glow dimly blue at power-on. The purpose of glowing dimly is to verify at a glance that all pixels are operating properly even before MPF takes control of the lights. Each variant also has a &#039;&#039;&#039;NoGlow&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Standard:&#039;&#039;&#039; Includes the standard active-low matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Direct:&#039;&#039;&#039; No matrix for a total of 38 direct inputs on the CobraPin.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;HighMatrix:&#039;&#039;&#039; Includes an active-high matrix for 64 matrix switches and 22 direct inputs.&lt;br /&gt;
&lt;br /&gt;
====Loading the Config====&lt;br /&gt;
The [https://pinballmakers.com/wiki/index.php?title=OPP#Check_Processor_Configurations OPP Config Process] consists of establishing comms, erasing the existing config, loading/saving the new config, and verifying the new config. Note that Gen2Test is a Python 2 script while MPF uses Python 3. You must have both Python versions to configure OPP and run MPF.&lt;br /&gt;
&lt;br /&gt;
Since CobraPin relies on processor board serial numbers to address the boards, use Gen2Test to load the serial number. The serial should be the board number (0,1,2, etc.).&lt;br /&gt;
&lt;br /&gt;
As an example, here is the command sequence to load the regular config into Board 0. You may have a different port name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -eraseCfg&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -saveCfg -loadCfg=CobraPin_Board0.py&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;python Gen2Test.py -port=/dev/ttyACM0 -ser=0&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
You should always try a new or significantly changed setup &#039;&#039;&#039;WITHOUT&#039;&#039;&#039; coil power. Use the yellow coil LEDs on CobraPin to check if the coil outputs are behaving as expected.&lt;br /&gt;
&lt;br /&gt;
===LEDs on the STM32===&lt;br /&gt;
Each STM32 board has a power LED and an LED connected to a processor pin. For the USB-C version of the STM32 board that is shipped with CobraPin, the blue LED connected to pin PB21 has a useful troubleshooting purpose. It is a heartbeat and activity indicator. The LED is toggled every second and whenever there is a USB packet received.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Toggling every second:&#039;&#039;&#039; The OPP firmware is running and it is not receiving any USB packets.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;On dimly or changing like there is a lot of activity:&#039;&#039;&#039; The OPP firmware is running and is receiving USB packets. The host is communicating with it. This is the state when MPF is running a game.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; If you are using a micro-USB version of the STM32 board, you should ignore the LED connected to PC13. This pin is shared with an I/O pin used for another purpose and should not be used for troubleshooting.&lt;br /&gt;
&lt;br /&gt;
===Scenarios===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil not firing&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is there a blown fuse? There are blue LEDs for banks A, B, and C. &lt;br /&gt;
      These will be lit if coil power is applied to the board and the &lt;br /&gt;
      fuses are good.&lt;br /&gt;
   2. Does the yellow LED associated with that channel light &lt;br /&gt;
      appropriately? This can be tested without coil power.&lt;br /&gt;
   3. Do you have continuity to your coil?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Coil stuck on&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Is the yellow LED associated with that channel also stuck on?&lt;br /&gt;
      If so, is a Board 1 config accidentally loaded in a Board 0 slot?&lt;br /&gt;
   2. What is the resistance from the coil output pin to GND?&lt;br /&gt;
      Check this with power off, coils disconnected, red probe on coil &lt;br /&gt;
      output, black on GND. If the resistance is low, The FET is blown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: All/many switches report as active or inverted in MPF&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have the column/row connectors swapped?&lt;br /&gt;
   2. Are your matrix diodes pointed the correct direction given the &lt;br /&gt;
      style matrix you have?&lt;br /&gt;
   3. For an active-high matrix MPF requires a &amp;quot;type: NC&amp;quot; in the switch &lt;br /&gt;
      definition for a normally-open switch.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Symptom: Neopixel chain does not glow blue on startup&lt;br /&gt;
Things to check:&lt;br /&gt;
   1. Do you have 5V applied to the board at J10?&lt;br /&gt;
   2. Is the fuse blown? Check the red 5V LED on the CobraPin board&lt;br /&gt;
   3. Does another set of neopixels work when plugged in?&lt;br /&gt;
   4. Do you have a NoGlow config loaded?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Replacing Components===&lt;br /&gt;
&#039;&#039;&#039;Static can break electronics.&#039;&#039;&#039; Avoid touching pins or components, when possible. &lt;br /&gt;
&lt;br /&gt;
If you must touch them, use a conductive wrist strap to an earth ground, discharge yourself by touching grounded metal, or at least stop shuffling your feet on the carpet.&lt;br /&gt;
&lt;br /&gt;
====STM32 Processor Board====&lt;br /&gt;
To remove a processor board, pull it out. Simple, but not always easy. Work it out slowly, always keeping it level with the CobraPin board. Failure to do so could result in bent pins or damaged female headers.&lt;br /&gt;
&lt;br /&gt;
To install a board, ensure the USB connector faces toward the outside of the CobraPin (i.e. not facing straight into the power capacitors). Set the board in place and double-check that all the pins line up. Then carefully and slowly push the board straight down, keeping it level with the CobraPin board.&lt;br /&gt;
&lt;br /&gt;
=====Soldering Headers:=====&lt;br /&gt;
If you are soldering your own pin headers on a new STM32 board, the right angle 4-pin programming header on regular STM32 blue pill boards needs to be removed so it can be replaced with a downward-facing straight pin header. Type-C STM32 blue pill boards generally come without this header installed anyway.&lt;br /&gt;
&lt;br /&gt;
Use the CobraPin female headers as a jig. Carefully plug in the 3x (4-pin, 20-pin, 20-pin) pin headers into the female headers and place the STM32 board on the headers. Solder the 44 pins. See below for pics of how the boards should look when complete.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; No other board modifications are necessary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Type-C STM32 BluePill=====&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_TypeC_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
=====Regular STM32 BluePill with microUSB=====&lt;br /&gt;
[[File:CobraPin_STM32_Top.jpg|500px]]&lt;br /&gt;
[[File:CobraPin_STM32_Bot.jpg|500px]]&lt;br /&gt;
&lt;br /&gt;
====Transistor====&lt;br /&gt;
&lt;br /&gt;
====Fuse====&lt;br /&gt;
You should use slow blow 5x20mm fuses. The maximum allowable fuse is 10A.&lt;br /&gt;
&lt;br /&gt;
1. Remove the clear plastic fuse cover&lt;br /&gt;
&lt;br /&gt;
2. Gently pull out spent fuse&lt;br /&gt;
&lt;br /&gt;
3. Push in new fuse trying to keep it level with the board and centered in the fuse holder&lt;br /&gt;
&lt;br /&gt;
4. Replace fuse cover&lt;br /&gt;
&lt;br /&gt;
5. Test your setup without powering the fuse first to make sure there are no software or configuration problems&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Source ==&lt;br /&gt;
Source files for CobraPin can be found on the [https://github.com/cobra18t/CobraPin CobraPin Github]&lt;/div&gt;</summary>
		<author><name>Tfulenwider</name></author>
	</entry>
</feed>