Thanks both. Here is my working configuration. Simply uncomment the last button to make it fail. Then comment out any button to make it work again. My main point in saying that is that its not the last button config causing the watchdog reset, its any button, hence my thought on being the 24th button.
{
// Unit identification
id:
{
unitNum: 1,
unitName: "Arcade Dreams",
ledWizUnitNum: 0,
},
serialPorts: {
usb: {
logging: true, // enable logging on this port
console: {
enable: true, // enable the interactive command line on this port
bufSize: 8192, // buffer size for console output
},
},
},
logging: {
// Message filter. This string selects which message types are
// included in the log. List all desired types, separated by
// spaces; for example, "error warning" selects only error and
// warning messages, disabling all others. Available types:
//
// debug - debug messages; code path and internal state information useful when working on the firmware
// debugex - extra debug messages; even more debugging detail, used for messages that tend to be repetitive,
// to allow filtering them out while still keeping the less voluminous debug messages
// error - error messages
// warning - warning messages (things that aren't errors but might cause unintended behavior)
// info - general information and status messages
// vendor - informational messages related to the USB vendor interface
// xinput - informational messages related to the XInput (XBox controller emulation) interface
// config - informational messages related to configuration and initialization
// tinyusb - debugging messages from the Tinyusb library; enabled only when the firmware is compiled with
// Tinyusb debug messages enabled
//
// "*" (asterisk) selects all message types
// "~ x y" selects all EXCEPT x and y
//
// For a regular deployed system, you probably want the following:
// errors, warnings, info, config.
filter: "error warning info config",
// Internal buffer size. The device stores messages in an
// internal buffer, so that it can pass them to attached
// terminals at a pace that the serial connections can handle.
// Messages are often generated at a faster rate than they can
// be sent across the wire, and the Pinscape firmware makes a
// point of never waiting for sloooow things like that, because
// its most critical mission is to respond quickly to input
// events from accelerometers, buttons, and plungers. If the
// buffer is too small, some messages might be discarded when a
// flurry of activity occurs. So the bigger the better, keeping
// in mind that the Pico only has about 256K of RAM overall, and
// lots of other features also want a piece of that. Something
// around 8K works pretty well, providing a cushion for the log
// without crowding out any other features.
bufSize: 16384,
// Include timestamps, type codes, and color coding in log
// messages? The timestamps and type codes (which announce the
// classification of each message: error, warning, info, etc)
// are nice to have but take up room in that limited buffer
// space we just allocated, so if you want to keep the buffer
// smaller, you might turn them off. The color coding also
// takes up a bit of space, but it's really helpful because it
// makes the error messages really stand out from the crowd.
// The color coding uses ANSI escape sequences, which most
// terminal programs understand, but which will look like
// gibberish on terminals that DON'T recognize them. If you
// have problems with weird sequences like "[0;31m" appearing
// all over the screen, try turning off the color coding.
timestamps: true,
typeCodes: true,
colors: true,
},
// HID keyboard interface. Enabling this allows you to assign
// button inputs to send keyboard keystrokes to the PC. This is one
// of the foundational features of a pinball controller that
// practically every virtual pin cab should include. If you're not
// using this Pinscape unit for button inputs, or if you don't wish
// to map anything to keyboard input (for example, if you want all
// buttons to generate gamepad input instead), it's okay to disable
// this.
//
// Note that enabling this won't usually have any obvious visible
// effect on the Windows side, since Windows does an excellent job
// of making multiple keyboards all appear to work together as one
// unified keyboard. You will see a new keyboard appear in Device
// Manager, but you probably won't notice any other effects.
keyboard: {
enable: true,
},
rgbStatusLight: {
red: 21, // GPIO port of RED color channel connection
green: 22, // GPIO port of GREEN color channel connection
blue: 28, // GPIO port of BLUE color channel connection
active: "high", // the pins are wired to the LED cathodes (GND side)
},
// Open Pinball Device HID. This is a new alternative to the gamepad
// interface that sends nudge, plunger, and button press information
// to the PC via a dedicated, pinball-specific virtual device. This
// only works with compatible simulators, so if you're using pinball
// games that only accept the traditional joystick input, you can
// enable BOTH the joystick and pinball device interfaces. The goal
// of the Open Pinball Device is to eventually replace the joystick
// interface in all of the popular pinball simulators, so that you
// don't have to make Pinscape Pico pretend to be a joystick. Some
// non-pinball games can behave erratically if an accelerometer is
// constantly jiggling a joystick input, so we hope to eventually
// eliminate these conflicts by making it unnecessary for pinball
// controllers to impersonate joysticks.
openPinballDevice: {
enable: true,
},
// -------------------------------------------------------------------
//
// Button inputs. The expansion board has 32 button input ports,
// wired through two PCA9555 chips. The definitions below set up the
// hardware sources for those 32 input ports. The buttons are arranged
// in the order of the pins on the button headers on the board. (Note
// that this doesn't exactly follow the order of the port labeling on
// the PCA9555 chips.)
//
// For the boilerplate below, we've given each button a keyboard key
// assignment, using the basic set of keys that Visual Pinball uses
// by default. You don't have to keep these, though - you can freely
// rearrange them and/or change the assignments to actions other than
// key presses, such as gamepad or XBox buttons. I wasn't able to
// come up with 32 standard VP buttons, so I assigned the last few
// to gamepad buttons. Gamepad buttons don't have any standard
// meanings in VP, but you can assign them functions in the VP setup
// dialogs, or perhaps you could find uses for them in other games.
//
// The first four buttons are special in that they're wired through
// GPIO ports, which makes them ideal for assigning to the flipper
// buttons. The key thing about GPIO-wired switches is that the
// Pico can read GPIO ports faster than PCA9555 ports. The time
// difference is tiny, only about a millisecond, but the flipper
// buttons are so critical to pinball play that even a small speed
// difference might have an effect on the flipper feel. The
// flippers are the only buttons in a pinball simulation where this
// small speed difference even remotely matters. The expansion
// board provides four direct GPIO switch inputs to accommodate the
// double-stacked leaf switches used on some real pinball games that
// have double flippers. If you're using ordinary single-contact
// leaf switches for your flipper buttons, you can use the extra
// two GPIO ports for any other button inputs you wish - other than
// the ultra-fast scan time, they behave just like the other button
// inputs.
//
// Basic action formats:
//
// action: { type: "key", key: "enter" }, // keyboard Enter key
// action: { type: "gamepad", button: 2 }, // gamepad button #2
// action: { type: "xInput", button: "a" }, // "A" button on XBox controller
//
buttons: [
// Joystick
{
source: { type: "74hc165", chip: 3, port: "D", debounceTimeOn:3000 },
action: { type: "key", key: "left" },
},
{
source: { type: "74hc165", chip: 3, port: "C", debounceTimeOn:3000 },
action: { type: "key", key: "right" },
},
{
source: { type: "74hc165", chip: 1, port: "F", debounceTimeOn:3000 },
action: { type: "key", key: "up" },
},
{
source: { type: "74hc165", chip: 1, port: "E", debounceTimeOn:3000 },
action: { type: "key", key: "down" },
},
//Top Row
{
source: { type: "74hc165", chip: 2, port: "F" },
action: { type: "key", key: "5" },
},
{
source: { type: "74hc165", chip: 2, port: "E" },
action: { type: "key", key: "esc" },
},
{
source: { type: "74hc165", chip: 2, port: "H" },
action: { type: "key", key: "f3" },
},
{
source: { type: "74hc165", chip: 2, port: "G" },
action: { type: "key", key: "p" },
},
{
source: { type: "74hc165", chip: 2, port: "B" },
action: { type: "key", key: "1" },
},
{
source: { type: "74hc165", chip: 2, port: "A" },
action: { type: "key", key: "2" },
},
//Playfield
{
source: { type: "74hc165", chip: 1, port: "G" },
action: { type: "key", key: "left ctrl" },
},
{
source: { type: "74hc165", chip: 1, port: "H" },
action: { type: "key", key: "left alt" },
},
{
source: { type: "74hc165", chip: 1, port: "A" },
action: { type: "key", key: "space" },
},
{
source: { type: "74hc165", chip: 1, port: "B" },
action: { type: "key", key: "y" },
},
{
source: { type: "74hc165", chip: 2, port: "D" },
action: { type: "key", key: "z" },
},
{
source: { type: "74hc165", chip: 2, port: "C" },
action: { type: "key", key: "x" },
},
//Flippers
{
source: { type: "74hc165", chip: 1, port: "C" },
action: { type: "key", key: "left shift" },
},
{
source: { type: "74hc165", chip: 1, port: "D" },
action: { type: "key", key: "right shift" },
},
// Coin Door
{
source: { type: "74hc165", chip: 0, port: "E" },
action: { type: "key", key: "6" },
},
{
source: { type: "74hc165", chip: 0, port: "A" },
action: { type: "key", key: "7" },
},
// Front Panel
{
source: { type: "74hc165", chip: 0, port: "D" },
action: { type: "media", key: "volUp" },
},
{
source: { type: "74hc165", chip: 0, port: "H" },
action: { type: "media", key: "volDn" },
},
{
source: { type: "74hc165", chip: 0, port: "C" },
action: { type: "key", key: "tab" },
},
// {
// source: { type: "74hc165", chip: 0, port: "F" },
// action: { type: "key", key: "f6" },
// },
],
// -------------------------------------------------------------------
//
// Output Ports.
//
outputs: [
// High power outputs on board A
{
device: { type: "gpio", gp: 7, pwm: false },
},
{
device: { type: "gpio", gp: 6, pwm: false },
},
{
device: { type: "gpio", gp: 5, pwm: false },
},
{
device: { type: "gpio", gp: 4, pwm: false },
},
{
device: { type: "gpio", gp: 3, pwm: false },
},
{
device: { type: "gpio", gp: 2, pwm: false },
},
// High power on board B
//
// 4th Octet on board A
{
device: { type: "gpio", gp: 15, pwm: true },
},
{
device: { type: "gpio", gp: 14, pwm: true },
},
{
device: { type: "gpio", gp: 13, pwm: true },
},
{
device: { type: "gpio", gp: 12, pwm: true },
},
{
device: { type: "gpio", gp: 11, pwm: true },
},
{
device: { type: "gpio", gp: 10, pwm: true },
},
{
device: { type: "gpio", gp: 9, pwm: true },
},
{
device: { type: "gpio", gp: 8, pwm: true},
},
// 1st Octet on board A
{
device: { type: "workerPico", unit: 0, port: 16 },
},
{
device: { type: "workerPico", unit: 0, port: 17 },
},
{
device: { type: "workerPico", unit: 0, port: 18 },
},
{
device: { type: "workerPico", unit: 0, port: 19 },
},
{
device: { type: "workerPico", unit: 0, port: 15 },
},
{
device: { type: "workerPico", unit: 0, port: 14 },
},
{
device: { type: "workerPico", unit: 0, port: 13 },
},
{
device: { type: "workerPico", unit: 0, port: 12 },
},
// 2nd Octet on board A
{
device: { type: "workerPico", unit: 0, port: 11 },
},
{
device: { type: "workerPico", unit: 0, port: 10 },
},
{
device: { type: "workerPico", unit: 0, port: 9 },
},
{
device: { type: "workerPico", unit: 0, port: 8 },
},
{
device: { type: "workerPico", unit: 0, port: 7 },
},
{
device: { type: "workerPico", unit: 0, port: 6 },
},
{
device: { type: "workerPico", unit: 0, port: 5 },
},
{
device: { type: "workerPico", unit: 0, port: 4 },
},
// 3rd Octet on board A
{
device: { type: "workerPico", unit: 0, port: 3 },
},
{
device: { type: "workerPico", unit: 0, port: 2 },
},
{
device: { type: "workerPico", unit: 0, port: 1 },
},
{
device: { type: "workerPico", unit: 0, port: 0 },
},
{
device: { type: "workerPico", unit: 0, port: 23 },
},
{
device: { type: "workerPico", unit: 0, port: 22 },
},
{
device: { type: "workerPico", unit: 0, port: 21 },
},
{
device: { type: "workerPico", unit: 0, port: 20 },
},
{
device: { type: "workerPico", unit: 1, port: 0 },
},
{
device: { type: "workerPico", unit: 1, port: 1 },
},
{
device: { type: "workerPico", unit: 1, port: 2 },
},
{
device: { type: "workerPico", unit: 1, port: 3 },
},
{
device: { type: "workerPico", unit: 1, port: 4 },
},
{
device: { type: "workerPico", unit: 1, port: 5 },
},
{
device: { type: "workerPico", unit: 1, port: 6 },
},
{
device: { type: "workerPico", unit: 1, port: 7 },
},
{
device: { type: "workerPico", unit: 1, port: 8 },
},
{
device: { type: "workerPico", unit: 1, port: 9 },
},
{
device: { type: "workerPico", unit: 1, port: 10 },
},
{
device: { type: "workerPico", unit: 1, port: 11 },
},
{
device: { type: "workerPico", unit: 1, port: 12 },
},
{
device: { type: "workerPico", unit: 1, port: 13 },
},
{
device: { type: "workerPico", unit: 1, port: 14 },
},
{
device: { type: "workerPico", unit: 1, port: 15 },
},
{
device: { type: "workerPico", unit: 1, port: 16 },
},
{
device: { type: "workerPico", unit: 1, port: 17 },
},
{
device: { type: "workerPico", unit: 1, port: 18 },
},
{
device: { type: "workerPico", unit: 1, port: 19 },
},
{
device: { type: "workerPico", unit: 1, port: 20 },
},
{
device: { type: "workerPico", unit: 1, port: 21 },
},
{
device: { type: "workerPico", unit: 1, port: 22 },
},
{
device: { type: "workerPico", unit: 1, port: 23 },
},
{
device: { type: "workerPico", unit: 2, port: 0 },
},
{
device: { type: "workerPico", unit: 2, port: 1 },
},
{
device: { type: "workerPico", unit: 2, port: 2 },
},
{
device: { type: "workerPico", unit: 2, port: 3 },
},
{
device: { type: "workerPico", unit: 2, port: 4 },
},
{
device: { type: "workerPico", unit: 2, port: 5 },
},
{
device: { type: "workerPico", unit: 2, port: 6 },
},
{
device: { type: "workerPico", unit: 2, port: 7 },
},
{
device: { type: "workerPico", unit: 2, port: 8 },
},
{
device: { type: "workerPico", unit: 2, port: 9 },
},
{
device: { type: "workerPico", unit: 2, port: 10 },
},
{
device: { type: "workerPico", unit: 2, port: 11 },
},
{
device: { type: "workerPico", unit: 2, port: 12 },
},
{
device: { type: "workerPico", unit: 2, port: 13 },
},
{
device: { type: "workerPico", unit: 2, port: 14 },
},
{
device: { type: "workerPico", unit: 2, port: 15 },
},
{
device: { type: "workerPico", unit: 2, port: 16 },
},
{
device: { type: "workerPico", unit: 2, port: 17 },
},
{
device: { type: "workerPico", unit: 2, port: 18 },
},
{
device: { type: "workerPico", unit: 2, port: 19 },
},
{
device: { type: "workerPico", unit: 2, port: 20 },
},
{
device: { type: "workerPico", unit: 2, port: 21 },
},
{
device: { type: "workerPico", unit: 2, port: 22 },
},
{
device: { type: "workerPico", unit: 2, port: 23 },
},
{
device: { type: "workerPico", unit: 3, port: 0 },
},
{
device: { type: "workerPico", unit: 3, port: 1 },
},
{
device: { type: "workerPico", unit: 3, port: 2 },
},
{
device: { type: "workerPico", unit: 3, port: 3 },
},
{
device: { type: "workerPico", unit: 3, port: 4 },
},
{
device: { type: "workerPico", unit: 3, port: 5 },
},
{
device: { type: "workerPico", unit: 3, port: 6 },
},
{
device: { type: "workerPico", unit: 3, port: 7 },
},
{
device: { type: "workerPico", unit: 3, port: 8 },
},
{
device: { type: "workerPico", unit: 3, port: 9 },
},
{
device: { type: "workerPico", unit: 3, port: 10 },
},
{
device: { type: "workerPico", unit: 3, port: 11 },
},
{
device: { type: "workerPico", unit: 3, port: 12 },
},
{
device: { type: "workerPico", unit: 3, port: 13 },
},
{
device: { type: "workerPico", unit: 3, port: 14 },
},
{
device: { type: "workerPico", unit: 3, port: 15 },
},
{
device: { type: "workerPico", unit: 3, port: 16 },
},
{
device: { type: "workerPico", unit: 3, port: 17 },
},
{
device: { type: "workerPico", unit: 3, port: 18 },
},
{
device: { type: "workerPico", unit: 3, port: 19 },
},
{
device: { type: "workerPico", unit: 3, port: 20 },
},
{
device: { type: "workerPico", unit: 3, port: 21 },
},
{
device: { type: "workerPico", unit: 3, port: 22 },
},
{
device: { type: "workerPico", unit: 3, port: 23 },
},
{
device: { type: "workerPico", unit: 4, port: 0 },
},
{
device: { type: "workerPico", unit: 4, port: 1 },
},
{
device: { type: "workerPico", unit: 4, port: 2 },
},
{
device: { type: "workerPico", unit: 4, port: 3 },
},
{
device: { type: "workerPico", unit: 4, port: 4 },
},
{
device: { type: "workerPico", unit: 4, port: 5 },
},
{
device: { type: "workerPico", unit: 4, port: 6 },
},
{
device: { type: "workerPico", unit: 4, port: 7 },
},
{
device: { type: "workerPico", unit: 4, port: 8 },
},
{
device: { type: "workerPico", unit: 4, port: 9 },
},
{
device: { type: "workerPico", unit: 4, port: 10 },
},
{
device: { type: "workerPico", unit: 4, port: 11 },
},
{
device: { type: "workerPico", unit: 4, port: 12 },
},
{
device: { type: "workerPico", unit: 4, port: 13 },
},
{
device: { type: "workerPico", unit: 4, port: 14 },
},
{
device: { type: "workerPico", unit: 4, port: 15 },
},
{
device: { type: "workerPico", unit: 4, port: 16 },
},
{
device: { type: "workerPico", unit: 4, port: 17 },
},
{
device: { type: "workerPico", unit: 4, port: 18 },
},
{
device: { type: "workerPico", unit: 4, port: 19 },
},
{
device: { type: "workerPico", unit: 4, port: 20 },
},
{
device: { type: "workerPico", unit: 4, port: 21 },
},
{
device: { type: "workerPico", unit: 4, port: 22 },
},
{
device: { type: "workerPico", unit: 4, port: 23 },
},
],
// -------------------------------------------------------------------
//
// IR Remote Control setup.
// IR Receiver
irRx: {
gpio: 16, // GPIO port for TSOP384xx OUT pin
},
// IR Transmitter
irTx: {
gpio: 17, // GPIO port for IR LED output
},
// -------------------------------------------------------------------
//
// TV ON setup. The expansion board implements the power-sensing
// circuit required for the TV ON feature, which detects when the
// main system power has just come on and uses this to send power-on
// commands to the TVs.
//
// tvon: {
// powerDetect: {
// sense: 26,
// set: 27,
// },
// Delay time after system-wide power-on is detected, in
// milliseconds. The TV ON system waits this long before
// pulsing the relay and/or sending the IR commands.
// delay: 7000,
// IR commands to send. This is a sequence of command
// strings, using the Pinscape universal remote control
// coding format, to send after a power-on event. You
// should set these to the commands necessary to power up
// your TV(s).
//
// The best way to figure out the code strings for your
// particular TVs is to fire up the Config Tool, go to the
// TV ON & IR screen, and press the remote buttons whose
// codes you want to capture. The IR screen shows commands
// received on the IR sensor as they come in, using the
// identical string format required here, so you can just
// copy and paste codes from the IR window into this list.
//
// IR: [
// "03.02.7F3A21D0", // turn on the first TV
// "07.00.6321", // turn on the second TV
// ],
// Relay port. You can hard-wire your TV's ON button to
// a relay, and use one of the output ports to control the
// relay. If you do this, you have to tell the TV ON system
// which port is wired to the relay, which you do here.
// Set 'port' to the logical output port number from the
// 'outputs:' array where the relay is attached.
//
// relay: {
// port: 1, // use the first logical output port
// pulseTime: 100, // length of relay ON pulse, in milliseconds
// },
// },
// -------------------------------------------------------------------
//
// Peripheral hardware setup. Pinscape Pico has support for numerous
// external peripheral chips, including accelerometers, plunger
// position sensors, GPIO expanders, shift registers, and PWM
// controllers. Pinscape lets you attach each chip in various ways,
// too, in order to accommodate many different combinations of chips.
// That flexibility does come with a cost, though, which is that you
// have to tell Pinscape how you're wiring things, because Pinscape
// doesn't have many hard-coded assumptions about the wiring setup.
//
// I2C1 is used for all of the on-board peripherals on the DIY
// Expansion Board, through GP6 (SDA) and GP7 (SCL). All of the
// peripherals in the Expansion Board design are compatible with a
// 400,000 Hz data clock rate.
//
// The Pico's internal pull-up resistors on the SDA/SCL GPIO ports
// must be disabled, because the peripheral power supply can be
// disabled when the Pico has power, through a separate power
// regulator dedicated to the peripherals. This allows the Pico
// to perform a hard reset on the peripherals under software control,
// so that peripherals can be reset to a working state in the event
// of any glitches without the need to unplug the whole board. It's
// potentially harmful to some devices to apply power to their I2C
// pins when the chip's main power supply is off, so we don't want
// the Pico to pull the I2C lines to 3.3V via its internal power.
// We can prevent that by disabling the internal pull-ups.
i2c1: {
sda: 26, // GPIO port of I2C0 SDA (serial data) connection
scl: 27, // GPIO port of I2C0 SCL (serial clock) connection
speed: 400000, // bus speed, bits per second
pullup: false, // disable internal pull-ups on the GPIO ports
},
i2c0: {
sda: 0,
scl: 1,
speed: 400000,
pullup: false, // disable internal pull-ups on the GPIO ports
// enable: "on-demand",
},
// 74HC165 input shift registers. The Expansion Board features
// four of these chips, arranged in a daisy chain, for 32 input
// ports.
"74hc165": {
nChips: 4,
data: 18,
shift: 19,
load: 20,
shiftClockFreq: 6000000,
},
// Pico PWMWorker - this is a Pico acting as a 24-channel I2C
// PWM output controller, similar to a dedicated LED driver chip
// like a TLC59116. The DIY expansion board set features three
// of these chips (one on the main board, two on the auxiliary
// power board) for 72 output channels.
//
// The three Picos must be programmed with the Pinscape PWMWorker
// firmware, which is included in the Pinscape Pico project.
// Load PWMWorker.uf2 onto each Pico using the standard Pico Boot
// Loader procedure. In addition, you must manually set the I2C
// addresses for the two Picos on the power board, because they
// all get the same default address (0x30) when you first install
// the PWMWorker firmware. The Pinscape project includes a tool
// for doing this as well, SetPWMWorkerAddr, which you run from
// a Windows command prompt while the target Pico is in Boot
// Loader mode. (To put a Pico in Boot Loader mode, unplug the
// Pico from all power and USB connections, then press and hold
// the BOOTSEL button on top of the Pico while plugging it into
// the USB port. Release the button. The Pico should now appear
// as a virtual USB thumb drive on the Windows desktop, which
// you can use for .UF2 firmware installation and for address
// updates via the SetPWMWorkerAddr program.)
workerPico: [
// main board auxiliary Pico
{ i2c: 1, addr: 0x30, pwmFreq: 20000 },
// power board Pico #1
{ i2c: 0, addr: 0x31, pwmFreq: 20000 },
// power board Pico #2
{ i2c: 1, addr: 0x32, pwmFreq: 20000 },
// power board Pico #3
{ i2c: 1, addr: 0x33, pwmFreq: 20000 },
// power board Pico #4
{ i2c: 1, addr: 0x34, pwmFreq: 20000 },
],
}