Académique Documents
Professionnel Documents
Culture Documents
Chapter 1
CHAPTER 1
INTRODUCTION
The measurement of a quantity plays very important role not only in science but
in all branches of engineering, medicine and in almost all the human day to day
activities. The technology of measurement is the base of advancement of science. The
role of science and engineering is to discover the new phenomena, new relationships,
the laws of nature and to apply these discoveries to human as well as other scientific
needs. The science and engineering is also responsible for the design of new
equipments. The operation, control and the maintenance of such equipments and the
processes is also one of the important functions of the science and engineering
branches. All these activities are based on the proper measurement and recording of
physical, chemical, mechanical, optical and many other of types of parameters.
The major problem with any measuring instrument is the error. Hence, it is
necessary to select the appropriate measuring instrument and measurement procedure
which minimizes the error. The measuring instrument should not affect the quality to be
measured. The measuring instrument may be defined as a device for determining the
value of magnitude of a quantity of variable. An electronic instrument is the one which is
based on electronic or electrical principles for its measurement function. The
measurement of any electronic or electrical quantity or variable is termed as and
electronic measurement. Function generators are one of the stalwarts of electronics
testing equipment. In fact, function generators are used throughout the life cycle of an
electronic component in its development, testing, and repair. Typically, a modern
digital function generator creates electrical waveforms either in a continuous loop or a
single-shot, across a variety of frequencies.
Proposed work
Chapter 2
CHAPTER 2
PROPOSED WORK
The proposed work in the project is to design a function generator and see the
corresponding wave which is been generated in the CRO. We are designed to produce
4 different kind of waves namely sine wave, square wave, ramp wave and saw tooth
wave. The different kind of wave can be produced depending on the switch which is
been pressed. On pressing the switch, the required wave gets generated in the CRO.
Proposed work
Chapter 2
Hardware description
Chapter 3
CHAPTER 3
HARDWARE DESCRIPTION
Components required to perform the functionality of a function generator are:
1.
2.
3.
4.
Hardware description
Chapter 3
The LPC2148 microcontrollers are based on a 32/16 bit ARM7TDMI-S CPU with
real-time emulation and embedded trace support, that combines the microcontroller with
embedded high speed flash memory ranging from 32 kB to 512 kB. A 128-bit wide
memory interface and a unique accelerator architecture enable 32-bit code execution at
the maximum clock rate. For critical code size applications, the alternative 16-bit Thumb
mode reduces code by more than 30% with minimal performance penalty. Due to their
tiny size and low power consumption, LPC2148 are ideal for applications where
miniaturization is a key requirement, such as access control and point-of-sale.
operation.
In-System/In-Application
Programming
(ISP/IAP)
via
on-chip
boot-loader
software. Single flash sector or full chip erase in 400 ms and programming of 256
bytes in 1 ms.
Embedded ICE RT and Embedded Trace interfaces offer real-time debugging
with the on-chip Real Monitor software and high speed tracing of instruction
execution.
USB 2.0 Full Speed Compliant Device Controller with 2 kB of endpoint RAM. In
6/14 analog inputs, with conversion times as low as 2.44 Ps per channel.
Single 10-bit D/A converter provides variable analog output.
Two 32-bit timers/external event counters (with four capture and four compare
channels each), PWM unit (six outputs) and watchdog.
5
Hardware description
Chapter 3
Hardware description
Chapter 3
Peripherals used
Chapter 4
CHAPTER 4
PERIPHERALS USED
4.1 DIGITAL TO ANALOG CONVERTER
DACs and their inverse, ADCs, are part of an enabling technology that has
contributed greatly to the digital revolution. To illustrate, consider a typical long-distance
telephone call. The caller's voice is converted into an analog electrical signal by a
microphone, then the analog signal is converted to a digital stream by an ADC. The
digital stream is then divided into packets where it may be sent along with other digital
data, not necessarily audio. The digital packets are then received at the destination, but
each packet may take a completely different route and may not even arrive at the
destination in the correct time order. The digital voice data is then extracted from the
packets and assembled into a digital data stream. A DAC converts this into an analog
electrical signal, which drives an audio amplifier, which in turn drives a loudspeaker,
which finally produces sound.
Peripherals used
Chapter 4
Peripherals used
Chapter 4
The slide and rocker types, which are very common, are arrays of simple single
pole, single throw (SPST) contacts, which can be either on or off. This allows each
switch to select a one-bit binary value. The values of all switches in the package can
also be interpreted as one number. For example, seven switches offer 128
combinations, allowing them to select a standard ASCII character. Eight switches offer
256 combinations, which is equivalent to one byte.
DIP switches were used extensively in ISA architecture of PC expansion cards to
select IRQs and memory addresses. They were also often used on arcade games in the
1980s and early 1990s to store settings before the advent of cheaper, battery-backed
RAM, and were very commonly used to set security codes on garage door openers as
well as on some early phones. These types of switches were used on early video
cards for early computers to facilitate compatibility with other video standards. For
example, CGA cards allowed for MDA compatibility. DIP switches have become less
common in consumer electronics. Reasons include the trend toward smaller products,
the demand for easier configuration through software menus, and the falling price of
non-volatile memory. However, DIP switches are still widely used in industrial
equipment because they are inexpensive and easy to incorporate into circuit designs,
and because they allow settings to be checked at a glance without powering the system
on.
DIP switches are still used in some remote controls to prevent interference; for example,
to control a ceiling fan that was retrofitted to a single-circuit junction box. The DIP
switches set
multiple units can be installed in different rooms of the same house, or different units of
the same apartment building, without unintentionally controlling each other. Rotary
switches are also used in X10 home automation to select house and unit numbers.
Rotary switches are also used in some radio transmitters (particularly VHF and FM
broadcast) to select the DC bias used to set the voltage-controlled oscillator, which
determines the center frequency of the carrier wave output.
10
Implementation
chapter5
and
results
CHAPTER 5
IMPLEMENTATION AND RESULTS
The below picture gives a detailed description of the project results. When the DIP
switch 1 is pressed sine waveform is generated and can be seen in the CRO.similarly,
when switch 2 is pressed a square waveform is generated and ramp and saw-tooth
waveform gets displayed when switch 3 and 4 are pressed accordingly.
Fig 5.1 DIP switch been pressed for required wave form.
11
Implementation
chapter5
and
12
results
Implementation
chapter5
and
13
results
conclusion
chapter 6
CHAPTER 6
CONCLUSION
The working of function generator using LPC2148 has been implemented in the
microcontroller and different types of waveform are generated and output results are
seen in the CRO.By using LPC2148 microcontroller and various other peripherals, it is
being done. But our project does not contain this comfortability of changing the values
of various parameters such as frequency and amplitude .
14
Bibliography
BIBLIOGRAPHY
1.
2.
3.
4.
www.digitalfieldsolutions.com/functiongenerator
www.nskelectronics.com
techhugger.blogspot.in/2014/12/functiongenerator.html
en.wikipedia.org/wiki/function generator
15
Appendix
APPENDIX
CODE
#include<lpc214x.h>
#include<math.h>
unsigned int a,i,d;
float b,c;
void sin_wave()
{
for(i=0;i<5000;i++)
{
16
Appendix
b=2.0*3.14*50;
c=500.0*sin(b*(i*0.0001));
// 100sin(wnT)where T=1/Fs
a=(int)c;
//typecasting to integer
a=a+512;
a=a<<6;
DACR=a;
}
}
void sqr_wave()
wave
{
for(i=0; i<1023; i++)
{
d=1000;
d=d<<6;
DACR=d;
}
for(i=1024; i>=1; i--)
{
d=0;
d=d<<6;
DACR=d;
}
}
void ramp_wave()
17
Appendix
{
for(; i<1023; i++)
{
d=i;
d=d<<6;
DACR=d;
}
for(; i>=1; i--)
{
d=i;
d=d<<6;
DACR=d;
}
}
void swtooth_wave()
{
for(i=0; i<=1023; i++)
{
//x=t for upslope
d=i;
d=d<<6;
DACR=d;
}
}
int main()
{
int a, b;
IO1DIR=0xffffffff;
18
Appendix
IO0DIR=0xff007fff;
IO0CLR=0XFFFFFFFF;
//cleared initially
PINSEL0=0x00000000;
//DAC fn chosen
PINSEL1=0X00080000;
PINSEL2=0x00000000;
while(1)
{
a=IO0PIN&0x00ff0000;
b=a>>16;
switch(b)
{
case 1:
{
sin_wave();
break;
}
case 2:
{
sqr_wave();
break;
}
case 4:
{
ramp_wave();
19
Appendix
break;
}
case 8:
{
swtooth_wave();
break;
}
default :break;
}
}
}
20