Jump to content
IGNORED

Generic Programming ideas for Homebrew pinball


Recommended Posts

This post has been nagging me ;)

 

 

This is the way I would approach it.

 

Use a max6818 for your input conditioning. When you need more than 8 input lines, Add another max6818 "module" to expand your inputs.

This will server as a long term protection mechanism for your processing io lines - limiting the need to replace the main IO because one or two lines are fried.

Note: The reason I'd choose HW debounce is because your pinball software is going to be complicated enough AND it physically protects your CPU unit.

 

Extra note: For a low number of inputs (ie.8,16 upto 32) I'd probably use the max6818.

If the number of inputs was pushing 64-128+ I'd probably look at other solutions.

 

https://www.onsemi.com/pub/Collateral/MC14490-D.PDF

 

http://www.ebay.com.au/itm/5Pcs-16Dip-Mc14490p-Eliminator-Bounce-Hex-Ic-New-S/352050717660?_trksid=p2047675.c100010.m2109&_trkparms=aid%3D555018%26algo%3DPL.SIM%26ao%3D1%26asc%3D20140122130056%26meid%3D419a1588d0804f74afb2267f6ff14926%26pid%3D100010%26rk%3D1%26rkt%3D6%26sd%3D282423806477

Link to comment
Share on other sites

 

 

I'm thinking....

 

Dual or Hex schmitt trigger Buffer or Inverter + resistor/cap if only working with <6 inputs.

 

And MC14490 and the like for 6+ inputs. A simple matter of fanning out the clock to multiple MC14490 ic's.

Link to comment
Share on other sites

Damn, I didn't realize the max6818 was so expensive.

I'd rather replace a socketed MC14490 at that cost.

 

Yes I call that part, "cost prohibitive".

 

A socketed MC14490 seems a fair cheaper alternative and should clean up 6 switch circuits quite well and the chip's clock input could run off the clock line of the processor as it does require a clock pulse to run the MC14490 or just make an external clock generator as the data suggests can be done.

 

It doesn't really matter where the chip gets the clock pulse from as long as it gets one or it simply won't work as it is this pulse it counts.

 

When the switch is closed, the chip input ignores further opening or closing of that switch for the set duration detirmined by the clock pulses it receives.

 

The chip input can also be a N.C. or N.O. switch, it makes no difference.

 

Just be aware this MC14490 can also be close to $10 a chip. You really need to shop around to get it cheap like the EBay site I linked to.

 

- - - Updated - - -

 

I'm thinking....

 

 

 

And MC14490 and the like for 6+ inputs. A simple matter of fanning out the clock to multiple MC14490 ic's.

 

Yep a single clock pulse line connected to an input on one gate and it's gate output to the remaining 5 circuits in the hex schmitt so the clock signal is strong enough to drive multiple other inputs on other Hex schmitt buffers or inverters.

 

Doing it this way provides a nice strong clock signal as you are using the first gate, ( the one that has the original clock signal connected to), as an amplifier to boost the signal.

 

That one gate working in this fashion should provide a fanout for over 20 CMOS inputs and if it starts to deteriorate, simply rerun it through another gate further down the line to amp it up again.

Link to comment
Share on other sites

Depending where you buy your parts from

this is cheap and used for switch denounce and timing

on the Lawman project.

[ATTACH=CONFIG]112789[/ATTACH]

 

I did notice times mentioned on this thread of 40 ms

that is an eternity in pinball, 1ms or less to pickup the switch contact on a stand-up target is required.

1603342591_oneshottimer.gif.52b63aced2540746394907250d3e5e50.gif

Link to comment
Share on other sites

I did notice times mentioned on this thread of 40 ms

that is an eternity in pinball, 1ms or less to pickup the switch contact on a stand-up target is required.

 

The 40 ms isn't the length of time the switch has to stay closed. Instead, it is the period during which multiple activations and deactivations are ignored. So, if we get, say, a 1 ms switch closure, the switch is reported as having been activated, and any further activity on that switch is ignored for 40 ms before paying attention to that same switch again.

 

Michi.

Link to comment
Share on other sites

  • 3 weeks later...

GAME BOARD

 

PICAXE 20M2

 

 

starts the game(1p or 2p depending on C5 status at start )

enables game power

will cycle a ball from the troff until ball in shooter lane

counts/displays the ball

has a bonus input wait

extraball input ( ball count bypass )

ball and game reset outs.

 

 

If anyone is interested further description can be given.

IMG_20170728_034019233.thumb.jpg.9aefcce7b482497eb49f1264ab383711.jpg

 

 

IMG_20170728_042443415_TOP.thumb.jpg.8db3cc20a6e84cded4101ec1c2bac20f.jpg

 

 

'C:\Documents and Settings\User\My Documents\PICAXE Editor\Documents\start program ball counter.xml

 

 

symbol varA = w0

 

main:

low B.0

low B.1

low B.2

do

do

pause 10

loop until pinC.7 = 0

;start video

high B.7

pause 300

low B.7

serout B.6, T2400, ( "game start " )

let varA = 0

do

if pinC.5 = 1 then

if pinC.6 = 0 then

if pinC.6 = 0 then

pause 500

endif

if pinC.6 = 0 then

pause 500

endif

high C.0

;player 1

high B.3

if varA > 0 then

serout B.6, T2400, ( "end of ball bonus " )

endif

do

pause 10

loop until pinC.1 = 1

if pinC.4 = 0 then

let varA = varA - 1

serout B.6, T2400, ( "shoot again " )

endif

pause 500

if varA > 2 then

low B.0

low B.1

low B.2

low B.3

low B.4

low C.0

serout B.6, T2400, ( "match " )

;end of ball video

high B.5

pause 500

low B.5

pause 6000

serout B.6, T2400, ( "game over " )

;end of game video

high B.5

pause 500

low B.5

reset

endif

do

if pinC.0 = 1 then

toggle C.3

pause 200

toggle C.3

pause 1500

endif

loop until pinC.2 = 0

let varA = varA + 1

if varA = 1 then

serout B.6, T2400, ( "player 1 ball 1 " )

high B.0

low B.1

low B.2

if pinC.0 = 1 then

;end of ball video

high B.5

pause 500

low B.5

endif

endif

if varA = 2 then

serout B.6, T2400, ( "player 1 ball 2 " )

low B.0

high B.1

low B.2

if pinC.0 = 1 then

;end of ball video

high B.5

pause 500

low B.5

endif

endif

if varA = 3 then

serout B.6, T2400, ( "player 1 ball 3 " )

high B.0

high B.1

low B.2

if pinC.0 = 1 then

;end of ball video

high B.5

pause 500

low B.5

endif

endif

endif

else

if pinC.6 = 0 then

if pinC.6 = 0 then

pause 500

endif

if pinC.6 = 0 then

pause 500

endif

high C.0

if varA > 0 then

serout B.6, T2400, ( "end of ball bonus " )

endif

do

pause 10

loop until pinC.1 = 1

if pinC.4 = 0 then

let varA = varA - 1

serout B.6, T2400, ( "shoot again " )

endif

if varA > 5 then

low B.0

low B.1

low B.2

low B.3

low B.4

low C.0

serout B.6, T2400, ( "match " )

;end of ball video

high B.5

pause 500

low B.5

pause 6000

serout B.6, T2400, ( "game over " )

;end of game video

high B.5

pause 500

low B.5

reset

endif

do

if pinC.0 = 1 then

toggle C.3

pause 200

toggle C.3

pause 1500

endif

loop until pinC.2 = 0

let varA = varA + 1

if varA = 1 then

serout B.6, T2400, ( "player 1 ball 1 " )

high B.0

low B.1

low B.2

high B.3

low B.4

if pinC.0 = 1 then

high B.5

pause 500

low B.5

endif

endif

if varA = 2 then

serout B.6, T2400, ( "player 2 ball 1 " )

high B.0

low B.1

low B.2

low B.3

high B.4

if pinC.0 = 1 then

high B.5

pause 500

low B.5

endif

endif

if varA = 3 then

serout B.6, T2400, ( "player 1 ball 2 " )

low B.0

high B.1

low B.2

high B.3

low B.4

if pinC.0 = 1 then

high B.5

pause 500

low B.5

endif

endif

if varA = 4 then

serout B.6, T2400, ( "player 2 ball 2 " )

low B.0

high B.1

low B.2

low B.3

high B.4

if pinC.0 = 1 then

high B.5

pause 500

low B.5

endif

endif

if varA = 5 then

serout B.6, T2400, ( "player 1 ball 3 " )

high B.0

high B.1

low B.2

high B.3

low B.4

if pinC.0 = 1 then

high B.5

pause 500

low B.5

endif

endif

if varA = 6 then

serout B.6, T2400, ( "player 2 ball 3 " )

high B.0

high B.1

low B.2

low B.3

high B.4

if pinC.0 = 1 then

high B.5

pause 500

low B.5

endif

endif

endif

endif

loop

loop

stop

Edited by kress
Link to comment
Share on other sites

  • 2 weeks later...

Planning my home brew pinball and the thought came to me about multiball so has anybody got any ideas of how to programme an Arduino to handle 4 ball multiball ?

Interested to see if anyone else has done this or thought about this, maybe someone can help with the code and pointers where to start.

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

I have written a program in C for a picaxe for 4 balls.

It has an 8 bit address and enable in 1,2,3,4, ball save timers( multiball start ) a multiball hold and restart sequence.

This is this easy part of Multiball.

 

What starts multiball how many different multiball are there and how do you reset /activate them( multiball end ,player 1,2,3,4,).

What shots are active how are they lit what happens when you shoot them( lighting sound animation scoring).

When you collect all the shots what happens(....).

Jackpots, supa jackpots and supa double jackpots (....).

How do you inhibit standard play ,modes and multiball from interacting.

Edited by kress
Link to comment
Share on other sites

I have written a program in C for a picaxe for 4 balls.

It has an 8 bit address and enable in 1,2,3,4, ball save timers( multiball start ) a multiball hold and restart sequence.

This is this easy part of Multiball.

 

What starts multiball how many different multiball are there and how do you reset /activate them( multiball end ,player 1,2,3,4,).

What shots are active how are they lit what happens when you shoot them( lighting sound animation scoring).

When you collect all the shots what happens(....).

Jackpots, supa jackpots and supa double jackpots (....).

How do you inhibit standard play ,modes and multiball from interacting.

 

A single software stack - Not bit's of code in various devices around the cab.

Link to comment
Share on other sites

I have only just found this thread, so am a tad late to the party.

 

In my designs, I use a simple R/C filter on switch inputs to tame any spurious RF on the wire. The software takes care of deciding what's a valid input transition.

 

As for firing solenoids, etc I have a software timer associated with each that gets checked / decremented in a ticker interrupt (usually each 1ms or 10ms).

 

That way I only have to fire the solenoid and not worry about the release. Sometimes each output will be a structure with variables for current state, desired duration, tick count, lockout time, etc.

Link to comment
Share on other sites

I'd certainly be interested in obtaining this? how can I get a copy and can it be modified to do 5 ,7 or more multiball

 

I think you might need something more powerful than an arduino to do it all ...its a bit too stupid to handle everything.

Even Stern have had multiball issues with their last three games ( I assume they have some experience programming multiball ).

Edited by kress
Link to comment
Share on other sites

The processor on most Arduino boards is actually pretty good. Even the ATMEGA328 used on the Nano (and Uno ?) had 32K of FLASH and 2K of RAM.

 

What limits the processing speed a lot of the time is the many layers of the Arduino functions.

 

You can program in C to speed things up and still use the boot loader, or you can switch to Atmel Studio and burn the chip directly.

 

Of course you will need to learn how to talk to the registers directly, but there are plenty of examples out there.

Link to comment
Share on other sites

I'd certainly be interested in obtaining this? how can I get a copy and can it be modified to do 5 ,7 or more multiball

 

Well the way I would approach it would be to have one Main CPU - Be it x86 or Arm (PC or Pi etc).

 

If you still wanted Arduino in the mix as sub systems, Then the Main CPU initiates the modes and either handles it internally or sends a signal to a device eg multiball controller thus enabling it's operation as needed within the framework of the gameplay.

 

Something like MP would be your main CPU software.

http://missionpinball.org/

Link to comment
Share on other sites

I give in.

 

It depends on what type of Pinball your trying to make.

 

Your either making something that operates in a similar fashion to a EM pinball.

 

----> Sitting in-between would be using smart devices with no main cpu to bring it all together

(As long as your aware of the limitations/difficulties this is a perfectly acceptable solution)

 

Or your making something like a modern pinball with all the flexibility & complexity of software.

Link to comment
Share on other sites

Thanks guys certainly gave me something to think about, but I don't want to use a pc or mission pinball in this project, I have used pc's before in Virtual pinball cabs

I was going to use an Arduino or a few of them to handle different operations ,but I have been experimenting with the chipkit Max32 and that seems the way to go since it offers more outputs, either way I would be programming in C code,

and it's going to be like Firepower but with a modern ball trough installed and 5 ball multiball, and not 4 as originally planned, so lock 3 balls just like Firepower does now, then eject two balls one after the other from the trough and release the 3 locked balls one after the other, does that seem possible ? So two issues how to code the ball trough and how to code multiball ?

Link to comment
Share on other sites

Thanks guys certainly gave me something to think about, but I don't want to use a pc or mission pinball in this project, I have used pc's before in Virtual pinball cabs

I was going to use an Arduino or a few of them to handle different operations ,but I have been experimenting with the chipkit Max32 and that seems the way to go since it offers more outputs, either way I would be programming in C code,

and it's going to be like Firepower but with a modern ball trough installed and 5 ball multiball, and not 4 as originally planned, so lock 3 balls just like Firepower does now, then eject two balls one after the other from the trough and release the 3 locked balls one after the other, does that seem possible ? So two issues how to code the ball trough and how to code multiball ?

 

Why not go for a Williams system 6...FirePower original board set...Or a system 7 board set?.

 

That way you know it will work and replacements are easy to come buy.

 

Either has 3 ball multi ball in some games and then you can concentrate on actually building the machine rather than having to do all the board programming and board design work as well.

 

This way, if variations to the original game software don't allow exactly what you want your game to do, you can alter them using "external boards" much like Williams did on system 9-11 board sets when they found there original board sets didn't have enough inputs and drives or like Bally did with there soloniod and lighting expansion boards.

 

If you actually enjoy the programming side of homebrew, disregard what I have written.

 

I for one find software very frustrating and it is all about making something unique playfield and game play wise but I understand some may like to build every aspect of the homebrew.

Link to comment
Share on other sites

I'm Starting to think about what hardware to use and what software as well.

Currently in planning stages of what would be best to use.

So this thread is helpful.

As for coding, for now I'm still just using vp to make sure it all works how I want.

Then transfer to real machine.

 

 

 

Sent from my iPhone using Tapatalk

Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...