ece 4510 introduction to final review - homepages at wmubazuinb/ece4510/review_final.pdf · ece...

17
Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006. ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor Department of Electrical and Computer Engineering College of Engineering and Applied Sciences

Upload: others

Post on 05-Jun-2020

11 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

ECE 4510 Introduction to Microprocessors

Final Review

Dr. Bradley J. BazuinAssociate Professor

Department of Electrical and Computer EngineeringCollege of Engineering and Applied Sciences

Page 2: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Final Exam (1 of 2)

• The Final Exam will be given 12:30 - 2:30, on Wednesday, 24 April.

• It will be an open books, open notes test.• Students can use any printed, publicly available material

(that includes the Text, Motorola/Freescale Manuals and Data Sheets) as well as their OWN homework assignments, prelabs, and copies of their lab reports.

• No laptop or cellphone use allowed.• No Bluebooks are required, please do the exam on the

pages provided.

ECE 4510 2

Page 3: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Final Exam (2 of 2)

• The exam will be problem oriented (no essay questions). • Students are responsible for topics covered in class, in the

lab, in the lab project, in the homework assignments and in lecture notes posted on the Class Web Page.

• Immediately after the test students should return the Motorola Manuals they have borrowed for this term.

• Please return PING sensors and any other lab supplies loaned or borrowed. Next years class needs anything and everything you can leave them.

ECE 4510 3

Page 4: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

What makes a good final ?

• 3 to 6 Questions of 20, 30 or 40 minutes duration• Questions with multiple parts that:

– Involves one element that is “new”• Has a hardware build that has not been done in a lab yet.• Requires some type of timing relationship between output or input signals that

must be accomplished to operate.• Will require the construction of a main software program and possibly one or

two functions to operate the new hardware.– Involves multiple element that are “familiar”

• Incorporate peripheral elements involving hardware and software that have been accomplished in a lab or project.

• Existing software initialization and operational function calls can be readily copied and used in the code.

– Have some part where students say, “I knew he was going to ask that.”– Has identifiable levels of operational success so that scoring can be

directly related to what has been accomplished.ECE 4510 4

Page 5: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Lab Final Review: Monday

Objectives:1. Generate the appropriate parallel data output sequence, defined below, to drive a stepping

motor.2. Demonstrate driving the motor to perform the following sequence: first step the motor clock-

wise 90 degrees, then counter-clock-wise 180 degrees, and finally clock-wise 90 degrees returning to the initial starting point.

3. Use the keypad to direct the stepping motor. One key should reset the code and start the execution (F), another key should provide the direction to step (A: clock-wise or B: counter clock-wise), the number keys should define the number of steps to take (min step 1 to max steps 99), after entering a direction and number of steps a final key should execute the input (E). Additional keypad function may be defined as needed (C and D).

4. ECE5530 Only: Log the programming information to the terminal. Include a time stamp, the direction, the number of steps, and a running total of the step position from the beginning of the program execution (Clock-wise represents positive integers and counter clock-wise represents negative integers meaning that by accumulating the movements the absolute step angle of the motor is known after each set of steps has been completed.)

ECE 4510 5

Page 6: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Lab Final Review: Monday

ECE 4510 6

Table 1. Stepping Motor Cable Colors, Coils and Driving Phases Pin Out Motor Coil Stepping Phase

Black (Common) +12 V Common to all coils Red Coil 1 Phase 1

Brown Coil 3 Phase 3 Green Coil 2 Phase 2 White Coil 4 Phase 4

A and B had different

waveforms

Page 7: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Lab Final Review: Thursday

Objectives:1. Electrically connect, drive and display numbers on three common-anode 7-segment displays.

You must time multiplex each of the segments source in a similar fashion to time multiplexing the sinking of 5x7 matrix columns.

2. Demonstrate the display is working by repeating Lab 10 task 3 where the PING devices is used to measures distances that are displayed on the 7-segment display. You are not required to perform temperature compensation. The distance values should be sent to the display module in tenths of inches. Remember to drive the decimal points for the appropriate digit!

3. ECE5530 Only: Use the keypad to provide a distance offset Output distance = PING distance +/- offset

and the temperature (in degress C) for the distance measurement. The temperature should be entered by typing a two digit integer followed by the A key. The offset distance from should be entered assuming a one digit decimal place (XX.X) as 1 to 3 integers followed by C if the offset is positive or a D if the offset is negative.

ECE 4510 7

Page 8: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Lab Final Review: Thursday

ECE 4510 8

Table 2. Decimal to Seven Segment Decoder Display a b c d e f g dp,a‐g dp,g‐a

0 1 1 1 1 1 1 0 7E 3F1 0 1 1 0 0 0 0 30 062 1 1 0 1 1 0 1 6D 5B3 1 1 1 1 0 0 1 79 4F4 0 1 1 0 0 1 1 33 665 1 0 1 1 0 1 1 5B 6D6 1 0 1 1 1 1 1 5F 7D7 1 1 1 0 0 0 0 70 078 1 1 1 1 1 1 1 7F 7F9 1 1 1 1 0 1 1 7B 6FA 1 1 1 0 1 1 1 77 77B 0 0 1 1 1 1 1 1F 7CC 1 0 0 1 1 1 0 4E 39D 0 1 1 1 1 0 1 3D 5EE 1 0 0 1 1 1 1 4F 79F 1 0 0 0 1 1 1 47 71

Page 9: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Topics Review

• 9S12DP512 Architecture, Special Function Registers, and Memory Map

• 9S12DP512 Programmer’s Model– Data Formats– Addressing Modes– CCR Register– Instructions, Instruction Fetch, and Execution Times– Assembler Directives– Special Syntax for C Programs, #Pragmas

• Programming the Flash Memory (in Tutorial, not a test problem)• uC/OS-II RT Kernel (in Tutorial and on the Class Web Page,

(not a test problem)

ECE 4510 9

Page 10: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Topics Review

• Interfacing to the 9S12DP512 Parallel Ports– Input and Output Ports– Polling Signals, Generating Delays by Program– Signal Buffers

• Non-TTL Signal Interfacing– Relays, motor driving and audio output

• Glue Logic for I/O Interface Design

• 9S12DP512 Interrupts– Interrupt Vector Address Table– External Interrupts (IRQ*)– Enabling the Interrupt System– Skeleton Structure of a Main Program Segment along with an Interrupt Service

Routine in C

ECE 4510 10

Page 11: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Topics Review

• 9S12DP512 CRG Module– PLL Initialization– Real-time Interrupt (RTI)– E-Clock Selection

• 9S12DP512 Timer Module– Main Timer, Timer Overflow Interrupts– Modulus Down Counter– Output Compare, Generating Output Waveforms– Output Compare Interrupts– Input Capture– Pulse Width and Signal Frequency Measurement– Input Capture Interrupts

• 9S12DP512 Pulse Width Modulation Module– Programming the PWM Module

ECE 4510 11

Page 12: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Topics Review

• Asynchronous Serial Communications– Programming the Serial Communications Module (SCI)– SCI Interrupts

• Synchronous Peripheral Interface (SPI)– Programming the SPI Module– SPI Interrupts

• Interfacing a DAC Converter to the 9S12DP512– Waveform outputs

• Interfacing an ADC Converter to the 9S12DP512– Device accuracy DAC vs ADC– Temperature measurement with an LM35

• Inter-Integrated Circuit Interface (IIC or I2C)– Real-time Clock Calendar– Day, date and time tracking

ECE 4510 12

Page 13: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Topics Review

• Controller Area Network (CAN)– Programming the MSCAN Module– MSCAN Interrupts

• Motors– DC motor control with an H-bridge– Stepper motor control and step sequencing

• Static Memory System Design (on the Class Web Page)– EEPROM and SRAM Interfacing– Address Decoder Design– 9S12DP512 Extended Bus (not a test topic)– Read and Write Memory Cycle Critical Timing Analysis (not a test topic)

ECE 4510 13

Page 14: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Lab Topics Review

• See Lab Objectives 2013 document1) Introduction to the 9S12DP256: Program Development Environment2) Parallel Input/Output and Software Delay Loops3) Advanced Input and Output Devices4) Polled I/O Interface, Non-TTL Output Interface and Generating Periodic Outputs5) ECT Input Capture, PWM and SCI Messaging6) μC/OS-II, a real-time operating system7) Serial Peripheral Interface (SPI) and Digital-to-Analog Converter (DAC).8) Serial Peripheral Interface (SPI), Digital-to-Analog Converter (DAC), Analog-to-

Digital Converter (ADC), and Temperature.9) Inter-Integrated Circuit (I2C) Interface and Real-Time Clock/Calendar.10) Distance Measurement Using Ultrasound.11) Control Area Network (CAN) Interface.

ECE 4510 14

Page 15: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Project Review

1) One Dimensional Ping Pong2) A Microcontroller Calculator with LCD Display3) Moving an Object on a Conveyor Belt

ECE 4510 15

Page 16: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

End of Semester Time Table

• Project 3– Due today, 19 April, by 5pm

• Final day to submit lab reports– Monday, 22 April, by 5 pm

• Finals Exam– Wednesday, 24 April, at 12:30

• Final Grades Posted 30 April by noon

ECE 4510 16

Page 17: ECE 4510 Introduction to Final Review - Homepages at WMUbazuinb/ECE4510/Review_Final.pdf · ECE 4510 Introduction to Microprocessors Final Review Dr. Bradley J. Bazuin Associate Professor

Material from or based on: The HCS12/9S12: An Introduction to Software & Hardware Interfacing, Thomson Delmar Learning, 2006.

Thanks for all the hard work.

I hope your preparation is great and you Do well!And making grading really easy……

ECE 4510 17