Full Version : BlackJack to Go Game (AVR)
avr >>GAME & VIDEO PROJECTS >>BlackJack to Go Game (AVR)


AVR_Admin- 04-25-2006

For our project, we aimed to build a game system which would be both entertaining and portable. We decided to create a blackjack game that would accurately simulate the experience of playing at a casino. Our game supports almost all facets of casino blackjack, including doubling down, splitting a hand, multiple decks, and of course betting your hard earned money.

Game Rules

Our blackjack game follows the basic rules that you would follow if you were to play blackjack in a casino. The rules are as follows:

1. The dealer hits on 16 and below and stays on 17 and above.
2. The player with the highest hand not exceeding twenty-one wins.
3. In the event of a push, the dealer wins.
4. Aces may count as eleven or one.
5. You may double down your bet after the initial deal, but then may only receive one additional card.
6. You may split your hand if the two cards dealt to you are the same. If you split your hand, you must double your bet, and play each hand individually.
In order to enable the portability of our blackjack game, we needed to design and build our own prototype board to support the Atmel 90S8515 and the other necessary hardware. In our design, we utilized both push buttons and a liquid crystal display to interface with the user.

LCD

Initially, we wanted to use a larger LCD that would support not only text, but graphics as well. However, because the code used to control this LCD was written completely in assembly, we had a hard time integrating this into our code. As a result, we decided to use the MDLS16264 LCD that we have been using throughout the semester. This display while not as elegant as the larger display, proved to be more than adequate for our needs. Due to the characteristics of both the 8515 and the LCD, we were able to drive the LCD directly from the port C pins of the MCU.

Push Buttons

Using eight generic push buttons, we created simple way for the user to enter input to the game. The push buttons were wired to ground and pulled up through a 10K resistor. This creates a zero volt input to the 8515 when there is no push, and a five volt input when there is a button push. A software debouncing scheme, removed noise from the button pushes, and provided us with clean, usable inputs. The push buttons are connected directly to the port A pins of the 8515.

Board Development

In creating our own prototype board, we hardwired the above hardware as described, and added several components to support the Atmel chip. Pins 18 and 19 of the 8515 were wired to an 8MHz crystal to provide a clock to the system. Both pins of the crystal needed to be grounded through 27 pf capacitors. Additionally, pin 20 of the MCU was connected to ground and pin 40 was connected to VCC. To power the circuit board we decided to use 4 AA batteries. We needed to connect two diodes in series to drop the voltage down to five volts so that the game would operate correctly. A toggle switch was used to turn the power to the circuit on and off.

Hurdles

The one hurdle we had to overcome came when we converted from the power supply power to battery power. Unexpectedly, the increase in voltage supplied to the MCU by the batteries caused the game to reset when a player chose to 'hit'. This error while still unexplained was fixed when two diodes were put in series, lowering the supplied voltage to the board to five volts.

Parts List

(1) Atmel 90S8515 Microcontroller
(1) 40 pin Socket
(1) 40 pin Zif socket
(1) 8MHz Crystal
(2) 27pf Capacitors
(1) MDLS16264 LCD
(1) 10K Trimpot
(1) 4AA Battery holder
(2) Diodes
(1) Toggle switch
(8) Push buttons
(8) 10K Resistors


Link: http://instruct1.cit.cornell.edu/courses/e...dtl22/index.htm


Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.