0% found this document useful (0 votes)
23 views

Microprocessors and Microcontrollers Design

The document describes the design of a digital tachometer system using a microcontroller. The key components are a photo transistor and LED to detect rotations of a disc, a comparator OPAMP to generate pulses from the detector output, and a microcontroller to count the pulses and display the revolutions per second on a 7-segment display. The microcontroller timers are used to count pulses from the comparator and measure time intervals to calculate revolutions per second, which is displayed.

Uploaded by

Bittu Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Microprocessors and Microcontrollers Design

The document describes the design of a digital tachometer system using a microcontroller. The key components are a photo transistor and LED to detect rotations of a disc, a comparator OPAMP to generate pulses from the detector output, and a microcontroller to count the pulses and display the revolutions per second on a 7-segment display. The microcontroller timers are used to count pulses from the comparator and measure time intervals to calculate revolutions per second, which is displayed.

Uploaded by

Bittu Verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 8

A custom microcontroller design doesn't need much additional circuitry to

come to life. All it needs is the following:


 some sort of power supply
 a hardware interface for connecting your flash or debug tools

 a clock

 a reset circuit

A minimal setup for a microcontroller

Power Supply
As with every electrical circuit, we need a reliable power supply. You must
create a power supply circuit that accepts the range of expected input
voltages and provides all supply voltages that the microcontroller needs.
Please don't forget to include a decoupling (aka bypass) capacitor for each
V pin—this applies to the microcontroller as well as all other integrated
CC

circuits on the board. The typical value is 100 nF, but always check the
device's datasheet just in case it provides specific decoupling
recommendations.
Clock
The clock is the heartbeat of the microcontroller. Without a heartbeat, a
microcontroller can't do anything. It simply won't run.
Many microcontrollers include an internal clock source, and this is usually
the best option if you don't need a highly stable or highly precise clock
frequency. When high stability or precision is needed, a common choice is a
crystal-based oscillator.
Consider the following factors as you carefully choose the right clock
source:
 the desired frequency
 the frequency tolerance from part to part

 jitter, i.e., cycle-to-cycle variation in the period of the oscillating signal

 stability of frequency over temperature

 package

 load capacitance (you generally need to include external load


capacitors when using a crystal)

Also, you have to check the microcontroller's datasheet regarding the


default clock configuration. The microcontroller cannot boot up without an
acceptable clock for its initial configuration processes.
Reset
The microcontroller has a reset pin, and you need to be careful with the
circuitry attached to this pin. This might sound strange—maybe you're
thinking, "It's just a pull-up or pull-down resistor!"
But it's not always that simple. The reset pin allows you to restart your
microcontroller without cycling power or connecting your debug tools. The
reset pin could be driven by a pushbutton or another device on the board,
or it could even be connected through a cable to an external controller of
some kind. In any event, you need to make sure that the circuit driving the
reset pin provides an appropriate reset signal (usually active-low, and watch
out for switch bounce if you're using a pushbutton).
The other concern is spurious resets. These can occur if the reset pin is left
floating or if the pull-up resistor is very large (because this makes the reset
line more sensitive to noise). And even if your pull-up resistor is not too
large, you still have to consider the possibility of spurious resets caused by
noise coupling in from nearby traces or from sources of high-intensity EMI
(electromagnetic interference).
Hardware Interface for Flash or Debug Tools
You need a physical connector on your custom design in order to connect
your flash/debug hardware. This can often be a basic pin header to which
you connect your flash/debug hardware. The only things you'll need to
know are the interface standard (JTAG, SWD, ISP, DebugWire, etc.) and the
proper pinout for your programmer hardware. Actually, you may need to
know very little about the actual debug interface—often the best approach
is to simply duplicate the microcontroller-to-debug-header connections
shown in the schematic for a relevant evaluation board.
At this point we have covered the essential portions of a microcontroller
design. If you have all this circuitry in place, you should be able to load a
program into your microcontroller so that it can start doing something
rather than nothing.

An example of 10-pin and 6-pin pinouts for in-system programming (ISP) headers. Image courtesy of osiixy (own work) [CC BY
3.0]

Tools and Toolchain—What Do We Need?


The vast majority of modern evaluation boards (Arduinos, for example)
come with a fully integrated USB interface and a preinstalled bootloader.
Just plug the board into a USB port, install the proper driver for your OS,
maybe select a COM port, and press the programming button in your IDE.
It is that easy.
You may need a little more external hardware and a little more know-how
to get a custom microcontroller design up and running.
So let's assume the following: Your microcontroller doesn't have a
bootloader in its memory and your custom PCB doesn't include
flash/debug hardware.
Flash/Debug Interface Hardware (Including Drivers)
There are plenty of suppliers of flash/debug hardware tools, which range
from very cheap to very expensive.
Keep in mind that not all flash/debug hardware has drivers for all operating
systems. Also, not all drivers are easy to install. Take your time and make
sure that you are purchasing the right device for your microcontroller
design.

An example of a flash/debug interface device. Image courtesy of Segger.

Initial Firmware Testing


For initial testing of the microcontroller, you need some basic firmware. A
classic blinking-LED program is fine, or you can come up with any other
straightforward functionality that provides clear confirmation that your
microcontroller is actually executing the firmware. If your board does not
have an LED or any other indicator, you can generate a square wave on one
of the pins and confirm that the signal is present using an oscilloscope.

Integrated development environment (IDE) software allows you to create a program and load it into the microcontroller's flash
memory. Image courtesy of ARM Inc.

Programming Tool
You need a programming software tool in order to load your program file
into your microcontroller's flash memory. Usually you will use the
programming functionality that is incorporated into the integrated
development environment (IDE) that you use to write your firmware.
Microprocessors and microcontrollers can be used to design some tools or systems to perform some special tasks.
Using microcontrollers, we can make different types of modules or systems. Here is a list of some systems that can be
designed by using microcontrollers −

 Electronic Voting Machine


 RFID based Access Control System
 Heart Rate monitoring system
 Automatic Plant watering system
 Ultrasonic range finding system
 Water level controlling system
 Gas leakage detection system
 Frequency Meters
 Temperature measuring system
There are many such systems that can be made by using some microcontrollers.
To design a system, we have to follow some basic steps. We have to design the overview of the system, and some
functional block designs to construct the system easily. Then we have to design the circuit diagrams, and apply the
component values after doing some calculations. Then after checking the entire circuit diagrams, at last we should start
the work practically. In this phase we will implement the circuits by using required components.
In this article we will see how we can design a Digital Tachometer using microcontroller. Here we are using the Intel
8051 Microcontroller.
A Tachometer is basically a system that can measure the revolution/second of some rotating wheel, disc, shaft etc. Our
tachometer can measure up to 255 revolution/second at an accuracy of 1 revolution/second.
Now let us see how the circuit diagrams will be for this digital tachometer.

We can divide this circuit into some several parts. In the first part we will see how the circuit is taking information
physically. There are two components Q4 and D4. The Q4 is a photo transistor (2N5777), and D4 is one Red LED. If
light comes into this photo transistor, it collector current turns drops towards 0. At first we have to attach some rotating
disc on the shaft, and there will be one punch hole. When the disc is rotating, at the upper portion of the disc the LED is
attached, and at the lower portion the photo transistor is set. When the disc comes in the same line, the light hits the
photo transistor, and the collector current drops down to zero. This following figure is showing how it will be looking if
we see that using an oscilloscope.

In the next part we can see there is an OPAMP (Operational Amplifier) in the circuit. For the OPAMP, we have used
LM234 Chip. This chip is holding four OPAMPs, but here we have used one of them. In this circuit the OPAMP is
connected as a voltage comparator. Here the reference voltage is 3.5V. So if the output voltage of the photo transistor
is greater than 3.5V, then it will generate high pulse, otherwise it will generate 0 level signal. From this comparator we
will get the square wave pulses of the previous output.

From this falling edge we can understand that hole has come, so there is one revolution. This clock pulse is fed into the
microcontroller. This signal can be used to count the number of revolutions.
At the third part the microcontroller is working. This microcontroller is performing two tasks together. These two tasks
are −

 Counting the number of negative edges from the output of the comparator.
 Do necessary mathematics, and display the count on the seven segment display array.
To count the revolutions, we have used both the timers (Timer0 and Timer1) of 8085. Here Timer1 is configured as
auto-reload 8-bit counter, and for registering the number of incoming zeros are stored into Timer0. The Timer0 is set as
16-bit timer, and it generates the necessary one second time span for the Timer1 to count.

You might also like