Sie sind auf Seite 1von 13

MICRO COMPUTER HARDWARE AND

SOFTWARE
ROTARY DIALER PIC INTERFACE USING PIC 16F877

PRESENTION BY: AHMED BABANGIDA USMAN


AISHA IYA ABBAS
FATIMA SULE ALHASSAN
MAIMUNA KIGBU

13TH JAN. 2015

INTRODUCTION
PIC 16F877 is one of the most advanced
microcontroller from microchip. This controller is
widely used for experimental and modern applications
because of its low price, wide range of applications,
high quality, and ease of availability. It is ideal for
applications such as machine control applications,
measurement devices, study purpose, and so on. The
figure of the PIC 16F877 is shown below.

FEATURES OF PIC 16F877


The PIC 16F877 features the following:

8 Kbytes of FLASH program memory


368 bytes of Data Memory
33 input or output pins
High performance RISC CPU
Only 35 simple word instructions
20MHz operating speed (200 ns instruction cycle)

ROTARY DIALER
A rotary dial is a component of a telephone or a
telephone switchboard that implements a signaling
technology in telecommunications known as pulse
dialing.
On the rotary dial, the digits are arranged in a
circular layout so that a finger wheel may be
rotated with one finger from the position of each
digit to a fixed stop position, implemented by the
finger stop, which is a mechanical barrier to
prevent further rotation.

STEP 1: WHAT YOU WILL NEED


1 - Rotary phone, 3 - 220 Ohm resistors
2 - 0.1uF capacitors , 2 - 20K resistor (can
substitute anything between 10K and 47K)
2 LEDs, 1 - PIC development board
1 - 20 MHZ resonator or crystal, 1 - Breadboard
1 - 5V power source, 1 - A foot or so of hookup wire
1 Screwdriver, 1 - Wire stripper

STEP 2: DISSECT THE PHONE


Open up your rotary phone. On the inside you will notice
the few basic parts; the rotary dial, the ringer, two jacks,
the hook switch and the basic circuitry which is usually
encased in a metal junction-box-like thing.

There will be four wires running from the rotary dialer to


this junction-box-like thing. The wires should be held in
place by little more than tightened screws. Loosen the
screws and disconnect the wires.

After that, disconnect the rotary dialer from the phone


itself.

DISSECTING THE PHONE

STEP 3: DETERMINE WHAT THE


WIRES DO
Wire up two LEDs as shown in the diagram below.

The two white wires should be the pair that closes the
switch that lets you know when the dial is turned. The blue
and green wire should be the pair that lets you know what
number was dialed.

As such, when you turn the dial, the LED connected to the
white wires should turn on, and when you let go of the dial,
the LED connected to the blue and green wires should blink
on and off as many times as the number you dialed

STEP 4: CONNECT THE DIALER TO


THE PIC CHIP
Connect the rotary dialer to the PIC chip as seen in
the diagram. Notice that I am reading in the state
of the rotary dialer by using RC-timing. In other
words, the PIC chip is counting the number of
times it takes for a capacitor to discharge (which
changes when resistance is added).

That is where the 20K resistor comes in. Adding


this to the input allows for a clear differentiation
between the signal from a closed and open rotary
switch connection.

THE PIC CHIP

STEP 5: ASSEMBLE THE CODE


The code is essentially determining when someone
has turned the dial and then does edge-detection
on the signal (determining low-high transitions)
until the dial recoils to its initial state. After
tallying the number of times it measures a signal
transition, it then blinks the LED accordingly.

For instance, if you dial 3, the PIC will count three


low-high transitions and then blink an LED 3 times.

STEP 6: TESTING AND


CONCLUSION
If you read and follow every step correctly, it
should work!

If it doesn't work, make sure that you wired


everything correctly and that the code is copied
correctly. Also, be certain that your resonator (or
crystal) is 20 MHZ. If you wrote your own code
make sure there are no pauses in the routine that
checks for low-high transitions.

Das könnte Ihnen auch gefallen