Main > Project Announcements

Space Base - A homebrew ICB/ZP

Pages: << < (45/51) > >>

ids:

Some details on the electrical side.... (if you spot anything that looks out of place, please advise, I've never studied this stuff)

First, driving things that light up.  Behind each of the 10 holes you can score on is an RGB LED - that's 30 lines to switch on and off.  The use of 4 TLC5916 constant current drivers handles this nicely.  They are very much like a standard shift register with the added bonus of the constant current part.  Then there is the segmented display; 9 units, 16 segments, you do the math.  For this, we're driving one column at a time and rapidly switching.  So that means only 32 segments have to be dealt with at a time.  Oddly, the LED driver circuit needed for the RGB's supports exactly 32 outputs.  So we need two of these:


The "Display Controller Addition" part is only needed for driving the segmented displays.  Transistors are MPSA56.  All resistors are 1k.  Caps are .1uF (optional)

All CLK and LE lines are connected together.  SDI from first chip is fed from the KL25z.  SDO of one chip connects to SDI of the next chip.  Resistor values are around 950 - 1k should be fine. (see spec sheet for the formula to use for your LEDs)
Vcc connects to your 5V supply - note that it will have to be beefy enough to drive everything.
The KL25Z pins shown in brownish on the left of diagram (PTD0/1/2)
Outputs I've wired to a 34-line ribbon cable to make things easy.
The game does software PWM, allowing for 255 intensity levels for each line/colour.

For the RGB driver, output 0 is red for first hole, output 1 is greed, 2 is blue.  Then hole 2 red, green, blue, etc.
The software has a "test mode" which, among other things, lets you cycle through turning on one line at a time, so you can verify all your connections are good.

For the segmented display driver, all lines are used, 16 for row one, 16 for row two.  The mapping of the SDI/CLK/LE lines to the KL25z pins is not as shown (will use PTE2/3, PTB11).  Segmented display driver also needs a column driver - the 74HC595 is a good fit for this, and add 5 transistors to source current for each column.  This means we can shift out an extra 8 bits and latch it all in one go.
Outputs are wired in sequence to the segments as per this table (hex codes refer to which line to light up, and can be ignored):

J   0X01
A1  0x02
K   0X04
H   0X08
A2  0x10
F   0X20
B   0x40
G2  0X80
G1  0X100
E   0X200
C   0x400
D1  0X800
L   0X1000
N   0X2000
D2  0X4000
M   0X8000

This should make wiring easy, sort of follows pins, top to bottom, left to right.  Pin 1 of the seg-disp unit is not connected, so first in the list is the top right pin (pin 24, the J segment), then second from top on right (A1), second from top on left (K), etc.  I've coded a table mapping characters to appropriate segments to  light up, so it's easy to ask for any text to be displayed.  The code also takes care of flipping through the columns.
You can refer to pinout here https://www.sparkfun.com/datasheets/Components/LED/7-Segment/yetda%20green%20alphanumeric%20S-10012RGU11.pdf


Quick note on "test mode" - if you hold both start buttons during power up, it goes into a test mode.  Since P1 start is used to move to the next phase of this mode, it's probably best to release P1 start then P2 start as you enter this mode.
It begins by turning all lights to white.  If something is wrong, it should show up quickly at this point.
Use left stick down to flip red-green-blue from hole light 1 all the way up to 10.  Right down to reset back to light 1 red.
P1 start to go to next mode - test hole switches.  Place something metallic by each mag switch and it will turn on the light behind it when detected (display also shows which hole is detected).
P1 start to go to next mode - motor test - just moves motors according to joysticks; simple.
P1 start to exit test mode
I found it handy for testing that wiring is all good, things are powered, etc.  More options can be added as needed.

Boot sequence is as such:
initialize hardware
put "power/on" on display
test mode, if start buttons pressed
quick colour cycle of led's
if gate switch not closed, display "No/ball"
wait a few seconds (for r-pi) -- load config and hi-scores if found
initialize game loop with attract mode....

ids:

I created a trivial motor board for convenience.  It has no components on it, just wire.  But using 3-pin headers provided an easy spot to connect the motors to power them, and their control lines.

kl25Z pins are shown here as well.


There are 10 hole switches, which is a lot of mcu pins.  To bring down the count from 10 lines to 4 we use a CD40147.  Note that each switch line needs to be pulled up or the pins are floating, resulting in a random output.  Vcc here will connect to the 3.3V line, as it's outputs connect to the micro, which cannot tolerate 5V.


To know when the ball is waiting at the bottom, I went with the QRB1134, tied to an analog line.  (When the bar comes down and releases the ball, the code waits a half-second-ish before allowing the bar to move up, to avoid trapping the ball back in the hole.)  I used this rather than another mag-switch, as the  latter requires rather close proximity and I wasn't sure I could have things lined up just right.
 

I've also created a board to sit on top of the KL25z to break things out in a simpler way (and because a year from now I'll forget everything, something will get disconnected, and that'll be the end of it).  There was room, so I stuck the CD40147 on here.  Using stackable headers here and on the kl25z makes for an easy connection, and leaves all pins available.  You can see here the R-Pi is connected to a serial line, not USB as stated earlier.  I found the usb to be very finicky and unstable at times, whereas using serial at 115200 has been rock solid.  So there is the breakout for the R-Pi, including power.


eds1275:

I'm glad this is going on! Although I haven't done any work on it I am crazy organized and have all my audio files still. I recently got the verdict that there's just nothing left to save of my left eye and it's just a blurry mess that can't be fixed. I have started work writing another game of my own, another trackball game. I have some of the assets done and am going to leave it where it is until the game plays how I want it to before I start adding all the polish. I'm dirt poor since after I got sick it really gave my employment opportunities a beating but I have recently applied for more jobs in my area and hopefully someone will give me something better than what I have currently. At least where I work now I have extra time in the day to work on my own projects!

ids:

Eds, sorry to hear about your troubles.  I hope things pick up for you.  The audio you did for this is amazing.  If you're interested in getting a SpaceBase going, I can contribute the electrical side to the cause, and I'm sure we can find a way to complete the rest.  Let me know.

Le Chuck:


--- Quote from: ids on March 06, 2019, 10:29:23 am ---Eds, sorry to hear about your troubles.  I hope things pick up for you.  The audio you did for this is amazing.  If you're interested in getting a SpaceBase going, I can contribute the electrical side to the cause, and I'm sure we can find a way to complete the rest.  Let me know.

--- End quote ---

Absolutely, I’m down as well for hardware and fabricated items.

Pages: << < (45/51) > >>

Go to full version