For more course tutorials visit www.newtonhelp.com
ECET 365 Lab 1 Using the Serial Communication Interface in a Microcontroller
ECET 365 Lab 2 Temperature Measuring System using a
1. ECET 365 Entire Course (All Labs and Quizzes)
For more course tutorials visit
www.newtonhelp.com
ECET 365 Lab 1 Using the Serial Communication Interface in a
Microcontroller
ECET 365 Lab 2 Temperature Measuring System using a
Microcontroller
ECET 365 Lab 3 Traffic Light Control Using Finite State Machines
(FSM)
ECET 365 Lab 4 Servo Control Using Pulse Width Modulation (PWM)
ECET 365 Lab 5 Servo Motor Interfaces-Closed-Loop Motor Speed
Control
ECET 365 Lab 6 Servo Motor Interfaces-Closed-Loop Motor Speed
Control
ECET 365 Weeks 2-6 Quizzes
-------------------------------------------
ECET 365 Lab 1 Using the Serial Communication Interface
in a Microcontroller
For more course tutorials visit
2. www.newtonhelp.com
Lab 1 of 6: Using the Serial Communication Interface in a
Microcontroller
Submit your assignment to the Dropbox located on the silver tab at the
top of this page.
(See Syllabus section Due Dates for Assignments & Exams for due
dates.)
L A B O V E R V I E W
Scenario/Summary
1. To use the built-in COM port and understand how it sends and
receives serial data using the RS-232 communication standard
2. To learn how to program the HC12 Serial Communication Interface in
C language to transfer data between sender and receiver and display it
Deliverables
3. Answer all parts, and submit completed lab document.
L A B S T E P S
STEP 1: Download the lab
Download Lab 1 located in Doc Sharing, and save it to your PC.
STEP 2: Complete the lab instructions
Follow the directions and steps to complete the Week 1 Lab. Be sure to
complete each part.
STEP 3: Submit
4. Submit the completed lab document in a Word file.
-------------------------------------------
ECET 365 Lab 2 Temperature Measuring System using a
Microcontroller
For more course tutorials visit
www.newtonhelp.com
Lab 2 of 6: Temperature Measuring System using a Microcontroller
Submit your assignment to the Dropbox located under the silver tab at
the top of this page.
(See Syllabus section Due Dates for Assignments & Exams for due
dates.)
L A B O V E R V I E W
Scenario/Summary
1. To know how to design and use signal conditioners to interface analog
sensors or transducers to the HC12
2. To learn how to use A-to-D Converters to input and digitize signals
coming to the microprocessor from analog input devices
3. To learn how to write a C language program to sample, process, and
output the data from an analog device on an LCD
Deliverables
5. Answer all parts, and submit completed lab document.
L A B S T E P S
STEP 1: Download the lab
Download Lab 2 located in Doc Sharing, and save it to your PC.
STEP 2: Complete the lab instructions
Follow the directions and steps to complete the Week 2 Lab. Be sure to
complete each part.
STEP 3: Submit
Submit the completed lab document in a Word file
-------------------------------------------
ECET 365 Lab 3 Traffic Light Control Using Finite State
Machines (FSM)
For more course tutorials visit
www.newtonhelp.com
Lab 3 of 6: Traffic Light Control Using Finite State Machines (FSM)
Submit your assignment to the Dropbox located under the silver tab at
the top of this page.
See Syllabus section Due Dates for Assignments & Exams for due dates.
L A B O V E R V I E W
6. Scenario/Summary
1. To understand how a relatively simple finite state machine abstraction
can be used to implement a complex set of equivalent relay actions in
hardware
2. To analyze a familiar real-world problem in terms of how system
inputs and the present state determine the next output state using astate
diagram
3. To acquire proficiency in the use of statically allocated linked list data
structures to define a sequence of states involving multiple variables
Deliverables
Answer all parts, and submit completed lab document.
L A B S T E P S
STEP 1: Open lab document
Download Lab 3 located in Doc Sharing, and save it to your PC.
STEP 2: Complete the lab instructions
Follow the directions and steps to complete the Week 3 Lab. Be sure to
complete each part.
STEP 3: Submit
Submit the completed lab document in a Word file
-------------------------------------------
ECET 365 Lab 4 Servo Control Using Pulse Width
Modulation (PWM)
7. For more course tutorials visit
www.newtonhelp.com
Lab 4 of 6: Servo Control Using Pulse Width Modulation (PWM)
Submit your assignment to the Dropbox located under the silver tab at
the top of this page.
(See Syllabus section Due Dates for Assignments & Exams for due
dates.)
L A B O V E R V I E W
Scenario/Summary
1. To become familiar with the PWM interface using the Dragon 12 Plus
with serial monitor
2. To learn how to use input and output subroutines in C language
3. To learn how to compose projects containing several modules
Deliverables
Answer all parts and submit completed lab document.
L A B S T E P S
STEP 1: Download the lab
Download Lab 4 located in Doc Sharing, and save it to your PC.
STEP 2: Complete the lab instructions
8. Follow the directions and steps to complete the Week 4 Lab. Be sure to
complete each part.
STEP 3: Submit
Submit the completed lab document in a Word file.
-------------------------------------------
ECET 365 Lab 5 Servo Motor Interfaces-Closed-Loop
Motor Speed Control
For more course tutorials visit
www.newtonhelp.com
Lab 5 of 6: Servo Motor Interfaces-Closed-Loop Motor Speed Control
Submit your assignment to the Dropbox located under the silver tab at
the top of this page.
(See Syllabus section Due Dates for Assignments & Exams for due
dates.)
L A B O V E R V I E W
Scenario/Summary
1. To understand the operation of servo motors and optical interrupter
switches
2. To analyze the interface requirements for connecting an optical
interrupter to an HC12 and implementing the interface
9. 3. To learn how to write a C language program that controls the speed
and direction of a dc motor and displays motor speed in RPM to the PC
monitor
4. To learn how to program a continuous feedback control loop that
stabilizes the speed of a servo motor under varying load using the HC12
input capture timer.
Deliverables
Answer all parts and submit completed lab document.
L A B S T E P S
STEP 1: Download the lab
Download Lab 5 located in Doc Sharing, and save it to your PC.
STEP 2: Complete the lab instructions
Follow the directions and steps to complete the Week 5 Lab. Be sure to
complete each part.
STEP 3: Submit
Submit the completed lab document in a Word file.
-------------------------------------------
ECET 365 Lab 6 Servo Motor Interfaces-Closed-Loop
Motor Speed Control
For more course tutorials visit
www.newtonhelp.com
10. Lab 6 of 6: Servo Motor Interfaces-Closed-Loop Motor Speed Control
Submit your assignment to the Dropbox located under the silver tab at
the top of this page.
See Syllabus section Due Dates for Assignments & Exams for due dates.
L A B O V E R V I E W
Scenario/Summary
The course project involves the design, debugging, and building of
hardware and software for a wireless servo driven robot.
Deliverables
Report
A complete report detailing construction, test, and validation of the
project should be written. The report format should follow the format for
course labs in general.
Presentation
In addition to a written report, a complete PowerPoint presentation must
be written. A final presentation of the project using the presentation
must be given to your class peers and the instructor. It is considered
toward a part of your grade.
L A B S T E P S
STEP 1: Download the lab
Download Lab 6 located in Doc Sharing, and save it to your PC.
STEP 2: Complete the lab instructions
11. Follow the directions and steps to complete the Week 6 Lab. Be sure to
complete each part.
STEP 3: Submit
1. Submit the written report.
2. Give presentation.
1. Question : (TCO #5) Identify the step size for an 8-bit analog-to-
digital converter with Vref= 2.5 VDC?
Student Answer: 10 millivolts
25 millivolts
4.9 millivolts
5 volts
Comments:
2. Question : (TCO # 5) How many steps are available with a 10-bit
ADC?
Student Answer: 10
1024
512
12. 256
Comments:
3. Question : (TCO #5) What is the cutoff frequency for a low-pass
filter with a resistor R = 3000 and a capacitor C = .01 µf?
Student Answer: f = 5.3 KHz
f = 3300 Hz
f = 120 KHz
f = 6 KHz
Comments:
4. Question : (TCO #5)A band-stop filter is a filter that
frequencies below low-limit and above high-limit frequencies and
frequencies between the limits.
Student Answer: blocks; blocks
passes; blocks
13. blocks; passes
has; blocks
Comments:
5. Question : (TCO #5) A bridge with R1= 5.1 K, R2= 2 K, and R3= 15
K can be at null if R4is .
Student Answer: 10.5 K
5.88 K
588
1 K
Comments:
6. Question : (TCO #5) An instrumentation amplifier with two buffers
has a feedback resistor of 100 K. The two resistors from the buffer's
output to the input of the last stage OP-Amp are 1 K resistors. Voltage
levels to the non-inverting buffer inputs. Voltage levels to the non-
inverting buffer inputs are V1= .06 volt and V2= .02 volts. What is
Voutof the instrumentation amplifier?
14. Student Answer: 4 Volts
20.4 Volts
3.3 Volts
15.3 Volts
Comments:
7. Question : (TCO #5) An embedded system with an 8-bit analog-to-
digital converter is connected to a transducer with an output voltage of
10 millivolts. This signal is amplified by an amplifier with a gain of 25.
Assume that this signal level is appropriate for the ADC input. If the
reference voltage of the ADC converter is 5 volts, what will be the
output of the ADC in binary form?
Student Answer: 01100110
00110011
00001101
01111011
Comments:
15. 8. Question : (TCO #5) An 8-bit analog-to-digital converter has
maximum output voltage of 2.5 VDC. What is the reference voltage to
this ADC?
Student Answer: 2.5 VDC
5 VDC
1.25 VDC
None of the above
Comments:
9. Question : (TCO #5) A well-behaved analog signal with a frequency
of 20 kHz is being sampled. What is the sampling frequency if
frequency aliasing occurs?
Student Answer: 90 kHz
40 kHz
85 kHz
60 khz
16. Comments:
10. Question : (TCO #5) To model a nonlinear transducer, one can
.
Student Answer: use empirically determined nonlinear equation
use a piecewise linear system
use a lookup table located in memory
All of the above
-------------------------------------------
ECET 365 Week 1 Homework Problems 8.9, 8.10, D8.1,
D8.14 ,D8.15
For more course tutorials visit
www.newtonhelp.com
Page 454-455
17. Problems 8.9, 8.10, D8.13, D8.14, D8.15
8.9) A stepper motor has 24 north teeth and 24 south teeth. What angle
change occurs on each step?
If a full step is output every 1 ms (and assuming it doesn‟t slip), at what
speed does the motor spin?
8.10) Draw a figure similar to figure 8.80 showing how half stepping
works.
D8.13) Design an interface for a +24 V, 500 mA geared DC motor. The
time constant of the motor is
D8.14) Design an interface for a +12 V, 500 mA bipolar stepper motor.
There are 200 steps/revolution.Write the software to spin the motor at 1
rps.
D8.15 An alarm is powered by 120 VAC, and the on/off state of the
alarm is controlled by an EM relay. Design the interface between a
computer output port and the EM relay. The dropout voltage is 3.5 V,
and the coil current needs at least 100 mA. Limit the coil voltage to 6 V.
Write three software functions: Alarm_Init, Alarm_On, and Alarm_Off.
-------------------------------------------
18. ECET 365 Week 1 iLab Motor Control
For more course tutorials visit
www.newtonhelp.com
Objectives
A. Develop software routines that control Stepper Motors, small
permanent magnet DC motors, and Servos.
B. Understand how an H-bridge can be used to control DC motors and
Stepper Motors.
Questions for the DC Motor Procedures:
Questions for the Stepper Motor Procedures:
Questions for Servo Procedures:
-------------------------------------------
19. ECET 365 Week 1 Quiz
For more course tutorials visit
www.newtonhelp.com
Question 1. Question : (TCO 3) To allow a relay coil current of 150 mA
through an NPN transistor with a gain (beta) of 75, the current through
the base must be _ .
Question 2. Question : (TCO 3) A stepper motor requires 250 steps per
revolution. How many degrees does the motor rotate per step?
Question 3. Question : (TCO 3) A pulse train consists of a logic 1 pulse
that is 30 microseconds wide followed by a logic 0 pulse that is 70
microseconds wide. The duty cycle is .
Question 4. Question : (TCO 3) Compare the advantages and
disadvantages of using an optical isolator versus using a relay as an
interface to an alarm clock circuit.
-------------------------------------------
ECET 365 Week 2 Homework Problems 7.1, 7.4 ,7.9, 7.13
,D7.17 and 12.1, 12.5
20. For more course tutorials visit
www.newtonhelp.com
ECET 365 Week 2 Homework Problems
Pages 384 – 387, Problems 7.1, 7.4, 7.9, 7.13, D7.17.
Page 639, Problems 12.1 – 12.5.
Question: 7.1 For each term, give a definition in 32 words or less.
Question: 7.4 Look up in the 9S12 data sheet how the SCI checks for
noise. In particular, when is the noise flag set? How does software clear
the noise flag?
Question: 7.9 Consider a serial port operating with a baud rate of 1000
bits per second. Draw the waveform occurring at the PS3 output (voltage
levels are +5 and 0) when the ASCII „B‟ ($42) is transmitted on SCI1.
The protocol is one start, eight data, and one stop bit. SCI1 is initially
idle, and the software writes the $42 to SCI1DRL at time = 0. Show the
PS3 line before and after the frame, assuming the channel is idle before
and after the frame.
Question: 7.13 A slave device will be interfaced to the Master 9S12
using SPI. The timing is shown in Figure 7.62. There are three signals
21. that will be outputs of the 9S12 and inputs to the device (Enable, Clock,
and Data). The timing of the external device is shown below. What
CPHA, CPOL mode should you use?
Question: 12.1 For each term, give a definition in 32 words or less.
Question: 12.2 For each transducer parameter, give a definition in 32
words or less.
Question: 12.3 For each instrument parameter, give a definition in 32
words or less.
Question: 12.4 For each transducer, give its measurand.
Question: 12.5 For each concept, give a definition in 32 words or less.
-------------------------------------------
ECET 365 Week 2 iLab Interfacing to the Smart Car Video
Sensor
For more course tutorials visit
www.newtonhelp.com
22. Objectives:
Develop a hardware interface to the TSL1401 Video Sensor in the Smart
Car Kit.
Test the sensor with software and use data to control the steering servo.
(Mini Project) Use mini lab TTL pulser to simulate the sensor inputs and
control PWM output on/off so as to test your motors steering system. or
less.
-------------------------------------------
ECET 365 Week 2 Quiz
For more course tutorials visit
www.newtonhelp.com
1. Question : (TCO #5) Identify the step size for an 8-bit analog-to-
digital converter with Vref= 2.5 VDC?
Student Answer: 10 millivolts
25 millivolts
4.9 millivolts
23. 5 volts
Comments:
2. Question : (TCO # 5) How many steps are available with a 10-bit
ADC?
Student Answer: 10
1024
512
256
Comments:
3. Question : (TCO #5) What is the cutoff frequency for a low-pass
filter with a resistor R = 3000 and a capacitor C = .01 µf?
Student Answer: f = 5.3 KHz
f = 3300 Hz
24. f = 120 KHz
f = 6 KHz
Comments:
4. Question : (TCO #5)A band-stop filter is a filter that
frequencies below low-limit and above high-limit frequencies and
frequencies between the limits.
Student Answer: blocks; blocks
passes; blocks
blocks; passes
has; blocks
Comments:
5. Question : (TCO #5) A bridge with R1= 5.1 K, R2= 2 K, and
R3= 15 K can be at null if R4is .
Student Answer: 10.5 K
25. 5.88 K
588
1 K
Comments:
6. Question : (TCO #5) An instrumentation amplifier with two
buffers has a feedback resistor of 100 K. The two resistors from the
buffer's output to the input of the last stage OP-Amp are 1 K resistors.
Voltage levels to the non-inverting buffer inputs. Voltage levels to the
non-inverting buffer inputs are V1= .06 volt and V2= .02 volts. What is
Voutof the instrumentation amplifier?
Student Answer: 4 Volts
20.4 Volts
3.3 Volts
15.3 Volts
Comments:
26. 7. Question : (TCO #5) An embedded system with an 8-bit analog-
to-digital converter is connected to a transducer with an output voltage
of 10 millivolts. This signal is amplified by an amplifier with a gain of
25. Assume that this signal level is appropriate for the ADC input. If the
reference voltage of the ADC converter is 5 volts, what will be the
output of the ADC in binary form?
Student Answer: 01100110
00110011
00001101
01111011
Comments:
8. Question : (TCO #5) An 8-bit analog-to-digital converter has
maximum output voltage of 2.5 VDC. What is the reference voltage to
this ADC?
Student Answer: 2.5 VDC
5 VDC
1.25 VDC
None of the above
27. Comments:
9. Question : (TCO #5) A well-behaved analog signal with a
frequency of 20 kHz is being sampled. What is the sampling frequency
if frequency aliasing occurs?
Student Answer: 90 kHz
40 kHz
85 kHz
60 khz
Comments:
10. Question : (TCO #5) To model a nonlinear transducer, one can
.
Student Answer: use empirically determined nonlinear equation
use a piecewise linear system
use a lookup table located in memory
28. All of the above
-------------------------------------------
ECET 365 Week 3 Homework Problems 2.18 2.19 2.20 D2.23
D2.24
For more course tutorials visit
www.newtonhelp.com
ECET 365 Week 3 Homework
Pages 146 - 147, Problems 2.18, 2.19, 2.20, D2.23, D2.24
2.18 In 32 words or less, describe the meaning of each of the
following terms.
19. Give a quantitative measure of modularity (e.g., System A is
more modular than system B) if …
2.20 In 32 words or less, describe the meaning of each of the
following debugging terms.
29. D2.23 Write assembly or C software to implement the following Moore
FSM (Figure 2.41). Include the FSM state machine, port initialization,
timer initialization, and the FSM controller. The command sequence will
be output, wait the specified time in ms, input, then branch to next state.
The 2-bit input is on Port T (PT1 and PT0), and the 3-bit output is on
Port T (PT7, PT6, PT5). Assume the E clock is 8 MHz.
D2.24 Write assembly or C software to implement the following Mealy
FSM (Figure 2.42). Include the FSM state machine, port initialization,
timer initialization, and the FSM controller. The command sequence will
be input, output, wait 10 ms, input, then branch to next state. The 1-bit
input is on Port P (PP0), and the 3-bit output is on Port P (PP3, PP2,
PP1). Assume the E clock is 8 MHz.
-------------------------------------------
ECET 365 Week 3 iLab Converting Requirements to a
Work Schedule
For more course tutorials visit
www.newtonhelp.com
ECET 365 Week 3 iLab Converting Requirements to a Work Schedule
Objectives:
30. A. Develop a map showing which hardware subsystems from the kit
will be used to meet each requirement. Determine if additional parts are
required.
B. Determine which hardware subsystems will require software
support to control the subsystems or provide communications between
subsystems.
C. Produce a set of tasks needed to meet the requirements. Assign
tasks to team members.
D. Develop a work schedule for a presentation to the class. Include
serial and parallel scheduling of tasks to meet the time requirements.
Step 1: Procedure
A. Determine the project requirements.
B. Determine alternative subsystems to meet the requirements.
C. Determine the set of alternatives that you will use for the project.
D. Develop a Work Schedule for the project.
E clock is 8 MHz.
-------------------------------------------
31. ECET 365 Week 3 Quiz
For more course tutorials visit
www.newtonhelp.com
1. Question : (TCO #3) Which interrupt is non-maskable?
Student Answer: Software interrupt (SWI)
Interrupt from a device connected to IRQ pin of HCS12
microcontroller
Both A and B
Interrupt by multiple devices connected to IRQ pin of HCS12
microcontroller
Comments:
2. Question : (TCO #3) Which of the following interrupts has the
highest priority?
Student Answer: TCNT timer overflow
32. SCI0
ATD0
ATD1
Comments:
3. Question : (TCO #3) Which selection is connected to the reset
module in the HCS12 microcontroller?
Student Answer: Reset pin
ADC0
ADC1
None of the above
Comments:
4. Question : (TCO #3) Which bit can mask a maskable interrupt?
Student Answer: S bit
33. Z bit
N bit
None of the above
Comments:
5. Question : (TCO #3) In the HCS12 microcontroller, the address
range 0xFFFE – 0xFFFF in the interrupt vector table is assigned to
which of the following?
Student Answer: Clock monitor fail reset
ATD0
Reset
COP failure reset
Comments:
6. Question : (TCO #3) Freescale utilizes BDM to .
34. Student Answer: check each instruction of a program individually
reset CPU by setting IRQ pin to high-level logic
check changes in memory and CPU register for each instruction
execution
Both A and C
Comments:
7. Question : (TCO #3) Watch dog timer is a utility that .
Student Answer: can reset the microcontroller whenever a program
locks up.
can catch errors due to memory corruption
makes sure that a program does go to an unintentional infinite loop
sequence
Both A and B
Comments:
8. Question : (TCO #3) When an interrupt occurs, .
35. Student Answer: in one stage, the contents of the CPU move to
RAM memory
the CPU finishes executing its current instruction before it starts
running an interrupt thread
all interrrupts will be ignored if the I bit is zero
Both A and B
Comments:
9. Question : (TCO #3) Which combination is an appropriate way
of setting up the PORTJ interrupt to enabled?
Student Answer: Pin I of CCR = 0
Pin I of CCR = 1
Pin I of CCR = 1 and PIEJ7 = 1
Pin I of CCR = 0 and PIEJ6 = 0
Comments:
36. 10. Question : (TCO #3) Which of the following interrupts has the
highest priority immediately after a microcontroller reset?
Student Answer: Reset
XIRQ
COP
All have the same level of priority.
-------------------------------------------
ECET 365 Week 4 Homework Problems
For more course tutorials visit
www.newtonhelp.com
Answer Pages 242, Problem 4.10; page 586, problems 11.5c, g; and
page 589, problems D11.20, D11.21.
Page 242, Problem 4.10 – What purpose might there be to use the PLL
and slow down the 9S12?
37. Page 586, Problem 11.5 c) & g) – For each pair of terms, explain the
similarities and differences in 32 words or less.
Page 589, Problem D11.20 – The input, V in, is differential not single-
ended. Design an analog circuit with a transfer function of Vout = 50 ⋅
V in + 2.5 powered by a single +5 V supply. You may use any of the
analog chips in this chapter. For example, you may use the REF03 2.50
V reference chip. The input range is −0.05 V to +0.05 V, and the output
range is 0 to +5 V. Label all chips, resistors, and capacitors as needed. –
Note: “Analog” is synonymous with “continuous” (page 531).
Page 589, Problem D11.21 – The input, V in, is single-ended not
differential. Design an analog circuit with a transfer function of Vout =
50 ⋅ V in − 5 using one rail-to-rail op amp powered by a single +5 V
supply. You may use one REF03 2.50 V reference chip. The input range
is 0.1 to 0.2 V, and the output range is 0 to +5
-------------------------------------------
ECET 365 Week 4 iLab System and Subsystem Power
Supplies
For more course tutorials visit
www.newtonhelp.com
ECET 365 Week 4 iLab System and Subsystem Power Supplies
38. Objectives:
A. Test the main power supply of the Robotic Car or robotic system.
B. Test the subsystem power supplies and determine if a separate battery
system is required for the subsystems.
C. Explore the low voltage inhibit circuit to disable CPU when the
voltage drops below its operating minimum.
-------------------------------------------
ECET 365 Week 4 Quiz
For more course tutorials visit
www.newtonhelp.com
1. Question : (TCO #1, 2, and 7) Select the header file in
CodeWarrior for the Freescale MC9s12DG256.
Student Answer: mc9s12dg256.h
40. Student Answer: an embedded system
a computer with multiple processors
a processor with two accumulators
a computer with multiple hard disks
Comments:
4. Question : (TCO #1, 2, and 7) In layered software architecture,
the main module is usually found within .
Student Answer: the last (lowest) layer
the API
the first (top) layer
a module inside a thread
Comments:
5. Question : (TCO #1, 2, and 7) The user of a module may be
interested in .
41. Student Answer: passing values to the module
the output format of the module
who wrote the module
Both A and B
Comments:
6. Question : (TCO #1, 2, and 7) Identify the computer language
commonly used for embedded programming.
Student Answer: C
Assembly
Both A and B
Pascal
Comments:
42. 7. Question : (TCO #1, 2, and 7) Which of the following commands
loads hexadecimal number 44 to accumulator A?
Student Answer: LDAA #$44
LDAA #44
LDA #44
LDAA 44$
Comments:
8. Question : (TCO #1, 2, and 7) C ++ encapsulation is .
Student Answer: grouping functions and variables into one class
grouping only functions in one class
grouping only variables in one class
grouping functions and variables in multiple classes
Comments:
43. 9. Question : (TCO #1, 2, and 7) Information shared by multiple
program modules is known as .
Student Answer: a static int
a global variable
a local variable
a function
Comments:
10. Question : (TCO #1, 2, and 7) A multichannel digital storage
scope is known as .
Student Answer: an ICE
a logic analyzer
a spectrum analyzer
a network analyzer
-------------------------------------------
ECET 365 Week 5 Homework
44. For more course tutorials visit
www.newtonhelp.com
ECET 365 Week 5 Homework
Page 241, Problems 4.1–4.9
4.1 Syntactically, I/O ports are public globals. In order to separate
mechanisms from policies (i.e., improve the quality of the software
system), how should I/O be actually used?
4.2 Why do we add the volatile qualifier in all I/O port definitions? For
example,
#define TCNT *(unsigned short volatile*)(0 0044)
4.3 What happens if an interrupt service routine does not acknowledge or
disarm?
4.4 The main program synthesizes data and a periodic output-compare
interrupt will output the data separated by a fixed time. A FIFO queue is
used to buffer data between a main program (e.g., main program calls
Fifo_Put). An output-compare interrupt service routine calls Fifo_Get
and actually outputs. Experimental observations show this FIFO is
45. usually empty and has at most three elements. What does it mean?
Choose from the following.
4.6A key wake-up input is armed so that interrupts occur when new data
arrives into the 9S12. Consider the situation in which a FIFO queue is
used to buffer data between the key wake-up ISR and the main program.
The ISR inputs and saves the data by calling Fifo_Put. When the main
program wants input, it calls Fifo_Get. Experimental observations show
this FIFO is usually empty, and has at most three elements. What does it
mean? Choose from the following.
4.7Answer Exercise 4.6 under the condition that the FIFO often
becomes full.
4.8Consider the following interrupting system. The active-edge inputs
on PJ7 and PP7 can occur at any time, including at the same time. The
object is to count the number of each type of interrupt.
How would you best describe the usage of Count in this system?
4.9Consider the following interrupt service routine. The goal is to
measure the elapsed time from one interrupt call to the other. What
qualifier do you place in the XX position to make this measurement
operational?
-------------------------------------------
46. ECET 365 Week 5 iLab Timing and Interrupts
For more course tutorials visit
www.newtonhelp.com
Objectives:
A. Determine the timing requirements for data to and from subsystems.
B. Change a procedural subroutine to an interrupt-driven subroutine.
C. Compare the interrupt-driven system operation to the procedural
system.
Step 1: Procedure
Questions for this week‟s iLab: Observations/Measurements:
1. Compare the operation of the first program with the operation of
the second program.
2. Explain why the timing has changed.
47. 3. What changes could be made to the second program interrupt
routine to enhance the Robotic Smart Car?
-------------------------------------------
ECET 365 Week 5 Quiz
For more course tutorials visit
www.newtonhelp.com
1. Question : (TCO #5) In an asynchronous data transfer .
Student Answer: the transmitter and receiver clock must be exactly
the same all the time
the receiver clock must be exactly the same or multiple times the
transmitter clock
it is not necessary to have a clock in the receiver
None of the above
Comments:
2. Question : (TCO #5) Synchronization between data transmitter
and receiver data transfer.
48. Student Answer: is necessary in asynchronous
is necessary in synchronous
is necessary in both asynchronous and synchronous data transfer
is not necessary in both an asynchronous and synchronous
Comments:
3. Question : (TCO #5) Which register is utilized in setting the baud
rate in a SCI interface?
Student Answer: SCIBDH
SCI0CR2
SCI0BDL
Both A and C
Comments:
49. 4. Question : (TCO #5) To sample data at the falling edge of the
clock when using SPI, .
Student Answer: CPA in SPICR1 must be 0
MSTR in SPICR1 must be 0
CPA in SPICR1 must be 1
MSTR in SPICR1 must be 1
Comments:
5. Question : (TCO #5) A SPI master IC connects to slave IC with
.
Student Answer: five wires
one wire
four wires
wireless
Comments:
50. 6. Question : (TCO #5) Communication between two modems
through telephone lines is .
Student Answer: serial
parallel
digitalall the time
Both A and C
Comments:
7. Question : (TCO #5) SPI implements a/an protocol.
Student Answer: asynchronous
synchronous
parallel
TCP
Comments:
51. 8. Question : (TCO #5) In full-duplex data transfer, .
Student Answer: data transfer from the transmitter only
data bits transfer simultaneously in both directions
data bits transfer in both directions but not simultaneously
data bits transfer in a parallel bus
Comments:
9. Question : (TCO #5) High voltage level in a TTL chip is .
Student Answer: 12 volts
5 volts
-5 volts
-12 volts
Comments:
52. 10. Question : (TCO #5) USB utilizes .
Student Answer: a serial data transfer
a parallel data transfer
a mixed parallel/serial data transfer
a daisy chain to connect maximum of 10 devices
-------------------------------------------
ECET 365 Week 6 Homework Problems 14.1,14.4 ,14.8
,14.13
For more course tutorials visit
www.newtonhelp.com
ECET 365 Week 6 Homework
Page 710: Problems 14.1–14.4, 14.8–14.13
14.1 For each term, give a definition in 32 words or less.
a) Master-slave
53. b) Multi-drop
14.2 For each pair of terms, compare and contrast in 32 words or less.
14.4 Consider a telephone line with a channel bandwidth of 2 kHz and
SNR of 40 dB. What is the maximum data rate possible?
14.8 Consider how the ACK bit is used in a CAN network.
14.9 If the CAN channel is noisy, it is possible that some bits will be
transmitted in error. Assume there are four nodes: one is transmitting,
and three are receiving. What happens if a data bit is flipped in the
channel due to noise being added into the channel?
14.10 Consider a situation where two microcontrollers are connected
with a CAN network. Computer 1 generates 8-bit data packets that must
be sent to Computer 2, and Computer 2 generates 8-bit data packets that
must be sent to Computer 1. The packets are generated at random times,
and the goal is to minimize the latency between when a data packet is
generated on one computer to when it is received on the other. Describe
the CAN protocol you would use: 11-bit versus 29-bit ID, number of
bytes of data, and bandwidth. Clearly describe what is in the ID and how
the data is formatted.
54. 14.13 Consider a situation where four microcontrollers are connected
together using a CAN network. Assume for this question that each frame
contains 100 bits. Also assume the baud rate is 100,000 bits/sec;
therefore, it takes 1 ms to send a frame. Initially, the CAN controllers
are initialized (i.e., all computers have previously executed CAN_Open).
-------------------------------------------
ECET 365 Week 6 iLab Interfacing to Networks
For more course tutorials visit
www.newtonhelp.com
Objectives:
A. Compare characteristics of different wireless communications
modules.
B. Compare characteristics of different wireless Internet
communications modules.
C. Determine which modules are the most suitable for the Smart Car or
Robotics project.
55. D. Develop a preliminary design for connecting a wireless module to the
Smart Car or Robotics project.
Results:
1.The characteristics of Zigbee, Bluetooth LE 4, and WiFi were
compared.
2.The characteristics of WiFi, WiMax, and LTE were compared.
3.Preliminary designs were developed for implementing Bluetooth LE4
and WiFi technologies into the Smart Car project.
Conclusions:
1.In the area of wireless communications there are trade-offs between
range, data rates, power consumption, complexity of implementation,
and security.
2.The technologies that do not require an FCC license or clearance have
limited range.
3.There are drop in modules for most wireless technologies.
56. 4.A UART interface is available for modules for most wireless
technologies.
-------------------------------------------
ECET 365 Week 6 Quiz
For more course tutorials visit
www.newtonhelp.com
1. Question : (TCO #6) How many 16-bit PWM channels are
available in the Freescale 9S12DG256 microcontroller?
Student Answer: Two
Four
Seven
Eight
Comments:
57. 2. Question : (TCO #6) When concatenating the two 8-bit PWM
Channels 3 and 2 to get a 16-bit PWM channel, becomes the low-
order byte.
Student Answer: Channel 7
Channel 2
Channel 5
Channel 3
Comments:
3. Question : (TCO #6) To enable Channel 7 of the PWM to
9S12DG256, which of the following must be done?
Student Answer: Set PWME7 = 1
Set PWME7 = 0
Set CAE7 = 1
Set CAE7 = 0
Comments:
58. 4. Question : (TCO #6) What is Clock SA when PWMSCLA =
0x01 and Clock A = 4MHz?
Student Answer: 5MHz
4MHz
8MHz
2MHz
Comments:
5. Question : (TCO #6) What is Clock SA when PWMSCLA =
0x00 and Clock A = 8MHz?
Student Answer: 8MHz
15625Hz
8MHz
31250Hz
Comments:
59. 6. Question : (TCO #6) A bus clock is set to 4000 kHz. What is the
Clock A‟s value if PWMPRCLK = 0x02?
Student Answer: 1MHz
3MHz
2MHz
8MHz
Comments:
7. Question : (TCO #6) In case of center-aligned PWM, which
formula can be used for the duty cycle of the output waveform?
Student Answer: Duty Cycle = [(PWMPERx - PWMDTYx) /
PWMPERx] * 100%
Duty Cycle = [PWMDTYx / PWMPERx] * 100%
Duty Cycle = PWMDTYx 100%
Both A or B (depends on PPOLx)
60. Comments:
8. Question : (TCO #6) In case of center-aligned PWM, which
formula can be used for the PWM frequency?
Student Answer: PWMx frequency = Clock (A, B, SA, or SB) /
PWMPERx
PWMx frequency = Clock (A, B, SA, or SB) / (2 * PWMPERx)
PWMx frequency = Clock (A, B, SA, or SB) / (4 * PWMPERx)
PWMx frequency = Clock (A, B, SA, or SB) / (3 * PWMPERx)
Comments:
9. Question : (TCO #6) Current passing through a wire creates an
electromagnetic field that .
Student Answer: loops around the wire
is directly proportional to the amount of the current flowing inside the
wire
is strongest closer to the wire
61. satisfies all of the above answers
Comments:
10. Question : (TCO #6) PWM channels of a microcontroller are
designed for control of a .
Student Answer: servo motor
AC motor
stepper motor
None of the above
-------------------------------------------
ECET 365 Week 7 Homework Problems
For more course tutorials visit
www.newtonhelp.com
Pages 384–387, Problems 7.1, 7.4, 7.9, 7.13, D7.17
Page 639, Problems 12.1–12.5
62. Chapter 7
7.1.) For each term, give a definition in 32 words or less.
7.4.) Look up in the 9S12 data sheet how the SCI checks for noise. In
particular, when is the noise flag set? How does software clear the noise
flag?
7.9.) Consider a serial port operating with a baud rate of 1000 bits per
second. Draw the waveform occurring at the PS3 output (voltage levels
are +5 and 0) when the ASCII „B‟ ($42) is transmitted on SCI1. The
protocol is one start, eight data, and one stop bit. SCI1 is initially idle,
and the software writes the $42 to SCI1DRL at time = 0. Show the PS3
line before and after the frame, assuming the channel is idle before and
after the frame
7.13.) A slave device will be interfaced to the Master 9S12 using SPI.
The timing is shown in Figure 7.62. There are three signals that will be
outputs of the 9S12 and inputs to the device (Enable, Clock, and Data).
The timing of the external device is shown below. What CPHA, CPOL
mode should you use?
D7.17.) Interface an 8-bit serial device using SPI. The control pin is
interfaced to PT2, and the clock and data signals are connected to the
SPI. The control and clock signals are normally high. The SPI needs to
clock data out on the falling edge of the clock. The clock and data are
63. created by the real SPI, and the control signal is bit-banged. The
maximum clock frequency is 1 MHz.
Chapter 12
12.1.) For each term, give a definition in 32 words or less.
12.2 For each transducer parameter, give a definition in 32 words or less.
12.3 For each instrument parameter, give a definition in 32 words or
less.
12.4 For each transducer, give its measurand.
12.5 For each concept, give a definition in 32 words or less.
-------------------------------------------
ECET 365 Week 7 iLab Integration of Subsystems
For more course tutorials visit
www.newtonhelp.com
Objectives:
64. Complete the assembly of project subsystems.
Test the operation of the completed project.
Observations/Measurements:
A. Visual Subsystem
1. Test Method: (Briefly describe the test method used to
verify the correct operation of the visual subsystem.)
2. Test Results: (Record the measurements that indicate the
visual subsystem is operating correctly).
B. Steering Subsystem
1. Test Method: (Briefly describe the test method used to
verify the correct operation of the steering subsystem.)
2. Test Results: (Record the measurements that indicate the
steering subsystem is operating correctly.)
C. Visual sensor and steering operation interaction
1. Test Method: (Briefly describe the test method used to
verify that the visual sensor subsystem and the steering subsystem are
working correctly together.)
2. Test Results: (Record the measurements that indicate the
visual sensor and steering subsystems are working correctly together.)
D. Drive Motor Subsystem
1. Test Method: (Briefly describe the test method used to
verify that the drive motor subsystem is working correctly.)
2. Test Results: (Record the measurements that indicate the
drive motor subsystem is operating correctly).
65. E. System Operation
1. Test Method: (Briefly describe the test method used to
verify that the system operates correctly when all the subsystems are
operating.)
2. Test Results: (Record the measurements that indicate the
system is operating correctly.)
Questions
1. Have your problems been mostly hardware or software? Explain
your answer.
2. How does your estimate of energy required to do two laps compare
with your measurements?
3. What is the pulse frequency of the drive motor control signal?
4. (Optional) How many laps can the car perform?