Microcontroller Synthesized Function Generator: Visa M. Ibrahim .Oni Taiwo .Uyoata E. Uyoata
Microcontroller Synthesized Function Generator: Visa M. Ibrahim .Oni Taiwo .Uyoata E. Uyoata
Department of Electrical and Electronic Engineering, School of Engineering and Engineering Technology, Modibbo Adamma University of Technology Yola, Adamawa State. Nigeria
AbstractThe need to ascertain the reliability and performance of electronic systems under test and in operation using electronic instruments such as the function generator cannot be over emphasized. The output responses of most electronic systems under test operation is the waveforms they generate on a scope; in consonant with the function generator waveform responses which could be in the standardized or non-standardized format. The continuous clamour for an easily re-programmable, simplified hardware, decreased power consumption, and high in performance function generation is the major set out goal of this paper. Practical results obtained show an appreciable degree of accuracy and repeatability of the system moreover, the microcontroller makes the system user-friendly. KeywordsMicrocontroller, DAC, Synthesized Function Generator
I.
INTRODUCTION
The performance of most electronic systems under test and in operation using the function generator are basically to extract vital information based on the generated signals displayed on a scope, and in some other case be used to initiate control for systems and as such there is need to inhabit special signals for such operation [1] Various approaches have been adopted in the past, but with the ever increasing need for flexibility and userfriendliness evolves the digital synthesis approach based on the use of microcontrollers [2, 3]. The microcontroller approach; are easily re-programmable, a simplified hardware design, allow user selectivity by a matrix keypad [4]. Time varying signals in digital format are generated from the microcontroller, as it is converted into the corresponding analogue format at a high processing speed. It is worth mentioning here that the system performance is enhanced by using a faster microcontroller and the digital to analogue converter which is the 12 or 16 bit categories [5, 6]. Practical result shows the high in performance, integrating more functions such as to generate square, ramp, sine, and triangular wave signals in the micro-controlled synthesized function generator [7]. In addition, problem on stability, accuracy, reproducibility, and the need to change external components when certain desirable parameters are to be obtained have been achieved.
II.
4*4 Matrix keypad Microcontroller
SYSTEM DESCRIPTION
DAC Current -voltage converter Output to scope
Figure 1: system block diagram The block diagram shown in figure 1 describes the overall system. The system comprises of a 4 * 4 matrix keypad which allows user selectivity of the various waveforms at desired frequencies. The user-friendly matrix keypad sends signals in the digital format to microcontroller. The microcontroller which is the brain and control circuit behind the entire design circuitry is controlled with a written program stored into its read only memory (ROM). The co-ordination of the systems operation are with the direction of the written program, allowing: i. Conversion ofnumerical value of zeros and ones to their corresponding time varying current value.
19
In this paper, the design utilized a circuit assembly of a digital-analogue converter, current-voltage converter and a few other basic electronic components to achieve the final generation of the waveform in the analogue format to be displayed on a scope. The power supply provides the voltage and current requirement for effective performance of the system. The uniqueness of this power supply is the generation for a negative rail for compensation on the digital-analogue converter.
III.
1.1 1.1.1
DESIGN FRAMEWORK
The design process is divided into two viz., the hardware and the software designs. Hardware Design The Microcontroller Unit The system is designed around the Intels AT89s52 microcontroller. The Intel AT89s52 microcontroller is a complete computer on a single chip. This is because it has read only memory (ROM), Random Access Memory (RAM) and central processing unit (CPU) embedded in it.The AT89s52 is a low-power, high performance CMOS 8-bit microcomputer with 8k bytes of memory [8]. The device is manufactured using Atmels high-density non-volatile memory technology and is compatible with the industry standard 80c51 and 80c52 instruction set and pin out. The on-chip flash allows the program memory to be reprogrammed in-system or by a conventional non-volatile memory programmer. It also provides programmable timer, programmable I/O ports together with 256x8-bit RAM for use as scratch book and also for stack purposes [8,9]. Voltage regulation was achieved through the use of LM 7805, LM 7815 and LM 7915 regulators. 1.1.2 Interfacing Microcontroller to Coordinate the Entire System Numerical value of zeros and ones selected from the 4 * 4 matrix keypad are sent to the microcontroller through port one bit zero through port one bit seven (p1.0-p1.7). The digital format generated from the selectively on the matrix keypad is sent to the combined digital-analogue converter circuitry (DAC) which allows it to be represented in the analogue format on the scope through port two bit zero through port two bit seven (p2.0-p2.7). Figure 2 gives clearer view of this hardware.
R14
R13
R12
R11
R4 C3 U1
19
U3
P0.0/AD0 P0.1/AD1 P0.2/AD2 P0.3/AD3 P0.4/AD4 P0.5/AD5 P0.6/AD6 P0.7/AD7 P2.0/A8 P2.1/A9 P2.2/A10 P2.3/A11 P2.4/A12 P2.5/A13 P2.6/A14 P2.7/A15 P3.0/RXD P3.1/T XD P3.2/INT0 P3.3/INT1 P3.4/T0 P3.5/T1 P3.6/WR P3.7/RD 39 38 37 36 35 34 33 32 21 22 23 24 25 26 27 28 10 11 12 13 14 15 16 17 2 6 3
R2 C4 R7
X1
18
XT AL1
XT AL2
7 1
4 5
OPA637AU
RST
C5 R8
29 30 31
PSEN ALE EA
8 7 6 5 4 3 2
R9
0R1
80C52
R1
9 10 11 12 13 14 15 16
1 2 3 4 5 6 7 8
U5
DAC0807
R3
C2
R5
R10
C1
20
C1 0.1uF
TR1
D1 BRIDGE
R1 1M
C4 6800uF
U2 7815
VIN OUT GND
TRAN-2P39
GND
C3 0.1uF
GND
Figure 3: Circuit diagram for regulated power supply 1.2 Software Design 1.2.1 Software Development The program was written in assembly language using the 8051 instruction set. Calculated parameters were carried out in other to achieve the program software development for the various waveforms generated. These and the flowchart are discussed in this paper as: i. Development of square wave program The square wave signal is generated by a suitable digital logic of Ton and Toff and is equivalent to the analogue output.
V ref
Tc
Figure 4: Square Waveform Tp = Ton + Toff = T c Where Tp = is the time period between Ton and Toff F And F = desired frequency Ton = Toff Tp = 2 Ton Tc Ton = 2 The program time delay equivalent to theTon of the square wave generated is: Tc Tpdsq = Ton = 2 ii. Development of saw tooth program:
1
21
V ref
0 T
Figure 3.2: Saw tooth Waveform Step Size = 255 Vref
Where Vref = reference voltage 1 And Tp = Ta = F Ta = time for an ascending level to achieve a step size F = desired frequency Ta T pdsq = the program time delay for a generated saw tooth (Ramp) signal
step size
255
Ta
Td
Figure 5: Triangular Waveform Tp = Ta + Td Where Tp = time period Ta = time for ascending level Td = time for descending level But Tp = 2Tp Ta =
Tp 2 255
But also step size = Vref The program time delay to generate a triangular waveform is Ta TaVref TpdTR = orTpdTR =
step size 255
Development of sine wave program: The technique used for the generation of sine wave as presented in this paper is the use of a look-up table where predetermined values of the sine function are calculated and loaded on a separate memory bank.
iv.
22
Vref
Figure 6: Sine Waveform Vout = 2.5v + (2.5 sin ) 255 The value sent to DAC (decimal)= Vout But t = 4 Where T = periodic time 1 Also T =
f T Vref
Where f = desired frequency; t = The required program time delay for sine wave generation is given by Where So is the total number of samples from the look-up table.
1 4f
T pds =
t So
Angle()
sin
Hex value
23
Initialize
Prompt
Square
No
Calculate No
DAC
Saw
End
No Cycle
Sine
No
Calculate d
DAC
24
IV.
Practical tests were carried out on the system performance during and after the construction. From the experimental results show a stair case appearance of the square and at a more fast processing speed for the sine wave generated.
V.
CONCLUSION
The use of the microcontroller to actualize the ever needed flexibility thereby eliminating the need of changing the hardware whenever certain desirable functions are needed have been achieved by the evolution of this design. However, with little modifications on the hardware especially with regards to the use of a 16 bit microcontroller and 16 bit on chip digital-analogue converter (DAC), the frequency are varied adequately with the waveform from the keypad.
BIBLIOGRAPHY
[1]. [2]. [3]. [4]. [5]. [6]. [7]. [8]. MT Abuelmatti A. RAL-Ali (1995) Fourth Saudi Engineering conference Department of Electrical Engineering King Fahd University of Petroleum and Minerals. Eva Murphy (2000) DDS Control Waveforms in Test, Measurement and Communications Analog devices co-operation htt//www.analog.com M.M.S Ananad (2006) Electrical Instruments and Instrumentation Technology. Dag Stranneby (1996) Digital Signal Processing and Applications Muhammed Ali Mazidi (2nd edition) The 8051 Microcontroller and Embedded System Using Assembly and C Thomas C. Hayes (2002) The Art of Electronics Student Manuals, Cambridge University press. Hall F. and Lister P.F (1980), Microprocessor Fundamentals, Pitman, London. Horowitz P. and Hill W. (1989), The Art of Electronics, 2nd Edition, Cambridge University press.
25