Instructables

Atmel Microcontroller Plays the Tic-Tac-Toe Game

Picture of Atmel Microcontroller Plays the Tic-Tac-Toe Game
This is Tic-Tac-Toe game implemented with bare bone ATmega168 micro controller. It works at lowest possible for this controller frequency 1 MHz . That allowed to power it directly from two AAA rechargeable batteries.  You may find some additional details in this blog post: http://www.jumbleview.info/2013/07/atmel-microcontroller-plays-tic-tac-toe.html
 
Remove these adsRemove these ads by Signing Up

Step 1: Components

Picture of Components
All electronics is mounted on a RadioShack component PC Board 276-168.

Here is the list of other components:

 Central processor ATmega 168 
 Nine Bi-polar bi-color 5mm Green/Red LEDs. 
 RadioShack 2 AAA battery holder  270-398
 Nine resistors 51 Ohm 0.25 W (0.125 W is OK as well)
 Panasonic  EVQ-WTEF2515B Encoder 
 Ceramic capacitor 0.47 uF.
 RadioShack slide switch 275-409
 Male headers 2.54 mm to make six contacts ISP header. 
 RadioShack 2-pack 14-PIN IC socket (optional, just to have the possibility to reuse controller  on other projects).
 Hook-up 26 gauge wire  and 30 gauge wire  .

Step 2: Circut Diagram

Picture of Circut  Diagram
Here is the circuit diagram of this toy. 

Step 3: Mounting Components on the PC Board

Picture of Mounting Components on the PC Board
IMGP2852.jpg
I had to treat edges of the board with file to make it fit into the enclosure (a box from the Johnson&Johnson emergency kit.). All components were mounted on the PC Board and soldered to it. As you can see the density of project components on the boards is not high.  Soldering elements  to the board and connecting it with 26 gauge wire was not that hard. To find out how LED was oriented on the board follow the simple rule: top of any LED on my diagram corresponds to the longer LED leg.  Contacts of the encoder are very fragile  so I used 30 Gauge wire here.

Step 4: Mounting the ISP Header

Picture of Mounting the ISP Header
The PC board layout does not provide the proper place to solder an ISP header. So I had to separate  three contact plates with utility knife and had to solder wire directly to contact plates occupied by headers.

Step 5: Accessing the Device with Programming IDE

Picture of Accessing the Device with Programming IDE
Of course, the main part here is the program. To program I have used Atmel Sudio 6.1 and Atmel AVRISP MKII programming interface device.

Step 6: Controller Configuration

Picture of Controller Configuration
Default controller setting is OK for the project. You can check this setting  through the Atmel Studio 6.1 menu.

Step 7: Programming

Picture of Programming
Atmel Studio 6.1 is an excellent programming IDE.
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!