04/11/2017 – Houston, we can read a switch matrix

There are a lot of different things that need to come together to get this retheme done by Pintastic.  Many of them are on my shoulders, but some of them are on Joe’s shoulders.  Joe, I apologize for badgering you, but the schedule is so tight for this project, that everything has to happen perfectly to get this thing in some semblance of finished.  Today, I literally bothered Joe during his lunch hour.  It is his theme, his art, basically his baby, and today, all I did was nag him about things that I need because we are less than 3 months from showing this machine off at Pintastic.  Joe, I’m sorry.

Yes, there are plenty of pinball companies out there that get a new product out in 3 or 4 months.  (Well, actually there is really only Stern, and all the other companies seem to fall late by quite a bit.)  Joe and I are out to prove that a bunch of fools (well, at least I’m a fool) will try to go from a Dolly machine to a completely new machine with new rules in about four or five months.  (We literally didn’t start this project until the beginning of February if I remember properly).  It’s not like we have a whole company behind us, it’s not like we work on pinball during the day, this is simply after hours, during weekends, etc.  A truly audacious goal.  At this point, I literally have no idea if the machine is going to be completed…but we will try our best.

This also proves that anybody can really do this stuff and at a reasonable price.  My budget is about as low as it can go to make a machine, because to me, pinball is simply a hobby.  It is a heck of a fun hobby.  I would say in many ways building pinball is more interesting to me than playing the machine itself.  (I guess I have to say that because I dropped out of league to try and get this machine finished.)  I can guarantee this won’t be an $8K machine.  I can also guarantee that doing these updates to the machine will breathe life back into a trashed machine.

Enough of that crap.  Last Friday, I finished the code for reading a switch matrix.  I checked it into the repository yesterday, but since it wasn’t tested, I didn’t bother putting a new version that can easily be used by upgrade.  Today, I got around to dragging the laptop, the piece of plywood with the OPP boards, and the Bally interface board, and plugged it into the cabinet.  (Bally’s have a switch matrix in the cabinet, and on the playfield.  The playfield is torn down, so I had to go with the cabinet).  Ran Gen2Test which now continuously reads the inputs from both direct switches and a switch matrix if it is configured, and it worked immediately.  Bits were showing up as I tripped them, and there was no bleed from one column to another column in the matrix.  Super sweet!

What does this leave on the firmware?  Well, the only thing left is using a switch matrix input to trigger a solenoid, and being able to change the solenoid configuration.  I’ve already figured out the best data structure to trigger the solenoid automatically, so all the design is really done.  That means I’m just down to the coding which should be pretty easy.  Reading a switch matrix is one big worry out of the way.

If interested in the details, it works like this.  During the main loop, it reads a single input byte.  It then switches to the next column, so if a capacitor needs to be charged it has the time to do it.  It then walks through the data byte looking for changes from the last time it read that column.  If it changes, it clears a counter for each input byte to zero.  If it hasn’t changed, it increments the counter and checks to see if the count has crossed the threshold.  If so, it declares the bit as active, and holds the bit active until the data goes low and crosses the threshold count again.  This makes sure that glitches aren’t caught and automatically debounces the signal.  Next time it moves to the next column, and repeats the process.  This happens thousands of times a second, so for a human it will be instantaneous.  It should detect changes in less than a ms.  Nice!

I wish I had a snazzy video that I could show, but let’s be serious.  It would simply be a picture of the computer screen with one of the 64 ‘0’s changing to a ‘1’ when toggle the coin or tilt switch.  Certainly not worthy of a video.  Maybe this weekend I can make a video, but more than likely, that would be on SS3.


4 responses to “04/11/2017 – Houston, we can read a switch matrix

  1. Cool, I see a 8 x 5 switch matrix, a 42 cpu controlled playfield lamps, and a mixture of automated and cpu controlled solenoids. Assuming no backglass 7 segment connections or backglass lamps required.

    Question, are you going to use a relay to disable all play field power to solenoids and cpu controlled lamps in the event of a tilt or a timer event for end of game?

    Good progress on the machine. Enjoy reading the updates as they come available.

  2. All correct in the first paragraph. There is going to be an LCD monitor to provide score and such, with general lighting to illuminate the backglass where the monitor isn’t. (Same as SharpeShooter 3). I actually put too many lights in SS3 and it is a little blinding in a dark room.

    I’m not disabling power to the solenoids on tilt, I’m simply disabling the switch input for the solenoid. That means that the solenoid and flippers and such just can’t be operated. The voltage is 43V which is below the 50V safety requirement for low power products so that is also OK. Since I’m not adding in a power filter board on this machine, I don’t have the option of enabling and disabling the power using a FET. The original schematic had a relay to enable/disable flipper voltage, and high voltage through the flipper buttons. That has all been rerouted through the Bally Interface board so the flipper buttons will only have a low voltage to trigger the flipper solenoids.

  3. I noticed the spinner is on the switch matrix along with drop target switch and some roll over switches.
    The debounce interval for a spinner vs a drop target differs. When you poll the entire switch matrix you might find that you need to experiment with the spinner interval.
    Automated switches on say a bumper and kicker are usually triggered from a switch that will automatically fire a solenoid as opposed to a cpu control solenoid switch. Essentially no lag. Dolly doesn’t seem to have too many cpu controlled solenoids to fire (kick out hole, saucer, coin lockout, etc).

    Are you going to use automated switch flippers or sticking with your ss3 flipper switching method?

    Are you sticking with the traditional incandesent playfield lamps or moving to led ?

    • You are 100% correct that pretty much everything in Dolly comes on one of the two switch matrices. I’m not sure if I think that the debounce needs to be different depending on the input. Bally actually added a capacitor there to get rid of any fast transitions such as when the switch is first closed. (So they really have both hardware and software debounce). At this point, I haven’t added a way to configure the number of samples needed to declare a switch valid. (It is hard coded to 4 samples).

      I have added the firmware for automatic firing of solenoids from switch inputs. With each solenoid configuration you can set a bit to say it uses a matrix input to trigger it. That should make all the solenoid kicks happen “instantaneously”. I did not want the rules processor to need to be involved at all.

      With the flippers, it was easy to convert the way that the original hardware did it, to be the same way that SS3 deals with them. Basically, it is a dedicated input to the processor, and the button grounds the input which triggers the solenoid. The only real change from SS3 is that I configure the solenoid as an on/off solenoid with no PWM since the Bally flipper mech breaks the high power solenoid connection as the flipper moves.

      At this point, I’m planning on using incandescent bulbs for all the playfield lamps. It is mostly because I’m trying to minimize the cost on this build because I have a secondary goal for the machine that needs it to be as inexpensive as possible.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s