Introduction

In this project, a pair of Renesas GreenPAK SLG46537’s is used to create the electronic
components for a simple basketball arcade machine. These machines tally baskets scored within a
certain amount of time. They can often be found in arcades like Chuck E. Cheese’s or Dave &
Buster’s.
Basketball arcade machines exist in both free-to-play and pay-to-play varieties, and may or may not
dispense tickets based on the number of baskets scored. We will ignore these extra options, and
focus on the main elements that the machine should have.

Below we described steps needed to configure the GreenPAK SLG46537  to create the electronic
components for a simple basketball arcade machine . However, if you just want to get straight to the results, download GreenPAK software to view the already completed GreenPAK Design File. Plug the GreenPAK Development Kit to your computer and hit "program" to design the device.

Core Hardware

The core function of the system is sensing the ball going through the basket, so we need a proximity
sensor well suited for small distances. A good pick for this job is the GP2Y0A60SZLF analog
distance sensor, which has low power consumption and has been used with other GreenPAK app
notes.
We are also going to need a display. Knowing that the intended use is for entertainment, and having
a budget in mind, we selected two 7-segment displays of 6.5 inches in size. These parts are a couple
of YSD-1100AR7B-15 units from SparkFun electronics.
The YSD-1100AR7B-15 parts need a minimum voltage of 12 V to work, so driving them directly with
a GreenPAK is not a good idea. Instead, we are going to drive the displays using two CD4026 ICs,
which are used for driving 7-segment LED displays with voltages up to 18 V.
We are also going to need a buzzer to emit the sounds of the game. Luckily, a simple 5 V buzzer is
sufficient for this application, as most of them have decent volume.
Finally, to help the TTL signals from the GreenPAK drive the CMOS inputs of the CD4026 ICs, we
need to drive the 12 V supply of the ICs.
An excellent way to shift the voltage levels is using a MOSFET and a Pull UP resistor like in the
Schematic 1. (A PDF of it is included).

State Transitions

The arcade machine should be able to adhere to the following routine:
● State 0 - The arcade is powered on and the score display shows the last game’s score.
● State 1 - The start button is pressed, the score display is cleared, and beeping signals the start of
the game.
● State 2 - This is the main game stage. It should last 60 seconds, receiving the signals that a ball
has fallen inside the basket.
● State 3 - A loud beep signals game over and the score flashes before settling in a continuous
fashion.
● State 0 - Repeat.
This main routine has the core functionalities of a basketball arcade machine focused on personal
use. 

Main Routine

In this section we are going to specify what kind of processes are going on in each of the stages.
Stage 0
The asynchronous state machine (ASM) is in state 0 waiting for the start button to be pressed, after
which it will move onto stage 1.
Stage 1

The start button was pressed and now the system is in stage 1. The system is going to emit a beep 3
times, signaling the start of the game and moving the system into stage 2. Also, it’s going to reset the
score shown on the display.
Stage 2
Stage 2 is going to be activated for exactly 60 seconds. During these 60 seconds, the output of the
system will be signaling a CD4026 with the quantity of times the ball passed through the basket.
Stage 3
After the 60 seconds have passed, the system moves onto stage 3. A loud beep and the flashing
lights of the display are going to signal game over, after which we reset into stage 0. 

GreenPAK Main Routine

The functionality in this section relies heavily on the GreenPAK’s ASM block. It only uses 4 states,
but it does use all 8 of the ASM’s outputs. Since the ASM has 4 unused states, we...

Read more »