Microcontroller Lab Assignment: Schematics, C Programs for DAC, ADC, and Signal Generation, Lab Reports of Microcomputers

Instructions and requirements for lab seven of the ece 4510/5530 microcontroller applications course, including schematic diagrams and c program development for interfacing a dac, performing adc conversions, and generating a sinusoidal signal. Students must make decisions regarding microcontroller port usage, clock rate, time delays, and register settings.

Typology: Lab Reports

Pre 2010

Uploaded on 07/22/2009

koofers-user-lwe
koofers-user-lwe 🇺🇸

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ECE 4510/5530 MICROCONTROLLER APPLICATIONS
Fall 2008
Prelab Assignment for Lab Seven
Task One
PORT H and PORT P are assigned for this task. You should make your own
decisions on using them in a particular way to interface the DAC0832 to the
9S12DP512 microcontroller. The CPU clock rate must be set to 24MHz.
Time delay T is specified as approx. 20µs.
Draw a detailed schematic diagram for Task One. It should include an IC part
number, IC pin numbers and H1 Connector pin numbers, respectively. All signal
lines should be labeled.
Develop a C program module for Task One.
Task Two
The designated ATD0 input channel is AN05. The conversion length should be 8
bits. The conversion sequence should be four conversions per each conversion
command. Your program should calculate the average of the four values. You
should make your own decisions on setting up the ATD clock prescaler and sample
time values, respectively. The ATD conversion synchronization method should be
based upon ATD0 interrupts.
For setting up the relevant registers please refer to the document S12ATD10B8CV2,
the register definition file, and the Instructor's Notes. Please verify that the addresses
given in the header file comply with the memory map published in the User Guide.
In order to protect the microcontroller's analog input, you may consider inserting an
op amp in voltage-follower mode (gain = 1) between the analog signal source and
input AN05 but you are not required to do that. Refer to the Op Amp Application
Guide posted on the Web Page should you decide to employ an op amp. The
potential backlash of doing so is that the op amp may adversely affect the ATD's
precision through its output impedance and capacitance. Draw a detailed schematic
diagram for Task Two. It should include an IC part number, IC pin numbers (if any)
and H1 Connector pin numbers, respectively. All signal lines should be labeled.
pf2

Partial preview of the text

Download Microcontroller Lab Assignment: Schematics, C Programs for DAC, ADC, and Signal Generation and more Lab Reports Microcomputers in PDF only on Docsity!

ECE 4510/5530 MICROCONTROLLER APPLICATIONS

Fall 2008 Prelab Assignment for Lab Seven

Task One

PORT H and PORT P are assigned for this task. You should make your own decisions on using them in a particular way to interface the DAC0832 to the 9S12DP512 microcontroller. The CPU clock rate must be set to 24MHz.

Time delay T is specified as approx. 20 μ s.

Draw a detailed schematic diagram for Task One. It should include an IC part number, IC pin numbers and H1 Connector pin numbers, respectively. All signal lines should be labeled.

Develop a C program module for Task One.

Task Two

The designated ATD0 input channel is AN05. The conversion length should be 8 bits. The conversion sequence should be four conversions per each conversion command. Your program should calculate the average of the four values. You should make your own decisions on setting up the ATD clock prescaler and sample time values, respectively. The ATD conversion synchronization method should be based upon ATD0 interrupts.

For setting up the relevant registers please refer to the document S12ATD10B8CV2 , the register definition file, and the Instructor's Notes. Please verify that the addresses given in the header file comply with the memory map published in the User Guide.

In order to protect the microcontroller's analog input, you may consider inserting an op amp in voltage-follower mode ( gain = 1 ) between the analog signal source and input AN05 but you are not required to do that. Refer to the Op Amp Application Guide posted on the Web Page should you decide to employ an op amp. The potential backlash of doing so is that the op amp may adversely affect the ATD's precision through its output impedance and capacitance. Draw a detailed schematic diagram for Task Two. It should include an IC part number, IC pin numbers (if any) and H1 Connector pin numbers, respectively. All signal lines should be labeled.

Develop a C program for Task Two.

Task Three

The initial frequency of the sinusoidal signal should be set to 0.4KHz. The formula for calculating the value of y that is to be sent to the DAC is as follows:

y = ax + b

where x is the result of the analog-to-digital conversion, and a and b are constants. Let a be equal to 0.42 and you are to decide the value of b in order to add an approx. +1.8 V offset to the analog output signal. The values of a and b may also be given by your Lab TA.

Draw a detailed schematic diagram for Task Three. The ATD setup should be the same as the one for Task Two.

Develop a C program for Task Three.