Seminar Topics & Project Ideas On Computer Science Electronics Electrical Mechanical Engineering Civil MBA Medicine Nursing Science Physics Mathematics Chemistry ppt pdf doc presentation downloads and Abstract

Full Version: Tic-Tac-Toe with mTouch
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Tic-Tac-Toe with mTouch

[attachment=50290]

OVERVIEW

This document describes the development of Cytron
Technologies DIY (Do It Yourself) Project PR28. This
project demonstrates hobbyist on how to build a simple
Microchip’s mTouch where no extra components are
needed excluding the sensing pads on PCB. In this
project, capacitive sensing module (CSM) is used. Tic
Tac Toe game is one of the simple applications of
mTouch. This DIY project will be using PIC 16F727
microcontroller, 74HC595 shift registers, piezo, mTouch,
RGB LEDs and 2 x 16 characters LCD.

GENERAL DESCRIPTION

PR28 is an open-sourced microcontroller Do It Yourself
kit. This PIC microcontroller based project is designed to
develop a Tic-Tac-Toe game using mTouch. mTouch,
also known as capacitive touch sensor, can replace
mechanical buttons with capacitive alternative. In
addition, it helps in cost reduction. mTouch has become
more prevalent and in demand for commercial
applications such as mobile devices and mp3 players.
Thus, this project will show users how to work with
mTouch. For information, PR28 uses internal oscillator
to run the program.

PIC16F727

This powerful (200 nanosecond instruction execution)
yet easy-to-program (only 35 single word instructions)
CMOS FLASH-based 8-bit microcontroller with nano-
Watt XLP Technology packs Microchip's powerful PIC®
architecture into a 28- or 40- or 44-pin package and is
upwards compatible with the 28- or 40- pin PIC16CXX
and PIC16FXXX Microcontrollers. Features of the
device:
· Interrupt capability
· 8-Level Deep Hardware Stack
· Direct, Indirect or Relative Addressing modes
· Processor Read Access to Program Memory
· Precision Internal Oscillator
a. 16MHz or 500kHz operation
b. Factory calibrated to ±1%, typical
c. Software tunable
d. Software selectable +1, +2, +4 or +8
divider
· Multiplexed Master Clear with Pull-up or Input
Pin
· 14 channels of 8-bit Analog-to-Digital (A/D)
converter where conversion is also available
during sleep mode

Capacitive Touch Sensor (mTouch™)

The construction of mTouch™ only consists of copper
pads on PCB board. There is no extra components
needed to make the mTouch™ functions. The detailed
explanation on how to work with mTouch™ will be
discussed in later section.

Frequency Measurement

Since CSM is a frequency-based method, timer method is
used. Basically, Timer 2 is used as the timer resource
instead of using Timer 0 due to it has greater flexibility
in defining time base. On the other hand, Timer 1 gate is
used as a counter. It will increment at every rising edge
of capacitive sensing module output frequency. The
value on the Timer 1 will be a measure for CSM
oscillator frequency. The completion of Timer 1 gate
event, triggered by Timer 2 overflow, will generate a
Timer 1 gate interrupt. When servicing the interrupt, the
value from the Timer 1 can be read to determine the
oscillator frequency.
In detailed, capacitance of the pad alone results in a
corresponding square wave frequency. When the PR2
value is matched, the current count value in Timer 1 will
be read and stored as reference. Once the finger is
touched, the RC time constant of the oscillator increases
and thus results in a decrease of frequency of the square
wave output. Therefore, on the next interrupt, the Timer
1 value will be smaller. Using a software algorithm to
compare the difference between these values, the sensor
can be identified as pressed or not pressed. Below
explains the frequency changes graphically.