Starting from:
$35

$29

Lab 0 Solution




Objectives




The student should become familiar with the functions and capability of the Tektronix MDO3014 Mixed Domain Oscilloscope and the Tiva C Series TM4C123GH6PM Microcontroller Data Sheet.







Overview




This lab serves as an introduction to logic analyzers (used for debugging and verification) and provides practice in reading datasheets (the main way engineers become familiar with device components). Proficiency in reading datasheets/technical literature and utilizing the information provided therein is an essential skill for an engineer to possess.







Preparation




 
Download the TM4C123GH6PM data sheet from the course wiki.

 
Download MDO3000 Series Mixed Domain Oscilloscopes User Manual from the course wiki.

 
Review the 'XYZs of Oscilloscopes' primer available on the course wiki.

 
Purchase a lab kit from the ECE store.







Procedure







About the TM4C123GH6PM Microcontroller




Using the TM4C123GH6PM data sheet, answer the following questions (answers will be posted at the end of the week). TIP: To efficiently move through the data sheet, have the table of contents open on the left or right hand side of the PDF viewer.




 
A memory map is a convenient way to depict the memory addresses of registers and descriptions of registers.

 
Which section describes Cortex-M4’s memory map?

 
What table number indicates the memory map of Cortex-M4 processor?


 
Each Peripheral has a specific memory address, what is the base memory address of GPIO_A (general input/output port A)?

 
Each peripheral has a number of registers that control its functionality. For a given peripheral, it’s often easier to use the offset of a register with respect to the peripheral base address rather than the absolute address of the register. A peripheral’s registers and their associated offsets are usually summarized in a register map.




 
Which section describes the General-Purpose Input / Output (GPIO) register map?

 
What is the table number for the GPIO register map?

 
The register map table in the TI documentation contains the name, offset, and description of a register. Which register corresponds to the direction of a GPIO port? Write down the name of this register, its memory offset, and the absolute address for port A of this register.

 
Click the page number of the GPIODIR register on the register map table.

 
What binary value corresponds to an output?

 
If pins 0, 4, and 7 were inputs, but the rest were outputs, what would the state of this register (in binary values)?

 
What would be the state of this register using hexadecimal values?


 
Which timer is located at memory address 0x4003.2000?

 
Find the register map for General Purpose Timers. Which register is located at offset 0x068? Provide a brief description of this register.

 
On this board, a few pins are wired together. Record the pins that are wired together. (Hint: look in the Tiva™ C Series TM4C123G LaunchPad Evaluation Board User's Guide Schematic found on the Lab Supplements page)




Introduction to the MDO3014 Mixed Domain Oscilloscope




Read through the following sections of the MDO3000 Series Mixed Domain Oscilloscopes User Manual:




 
Get Acquainted with the Instrument (pages 36—53)

 
Appendix C: P6316 General-Purpose Logic Probe Information (pages 203–207)

 
Setting Up Digital Channels to Using MagniVu (pages 79—82)

 
Trigger Setup (pages 87—93)

 
Analyze Waveform or Trace Data (pages 122—130)

 
Save and Recall Information (p160—166)




Answer the following questions:




 
Name three potential uses for the logic analyzer.

 
A properly configured trigger will remove guesswork and chance from capturing the output behavior of a signal.

 
Write down how you would configure the trigger to capture on a falling edge.

 
Write down how you would configure the trigger to capture on a rising edge.


 
How do you change the sample period of the logic analyzer?

 
Change the sample period to 200ns.




Set Up the Board




 
Open Keil uVision.

 
Download the lab0 zip file, unzip, and open SP.uvprojx under the 'blinky' directory.




 
Build the project. Project - Build.




 
Plug in the microcontroller (use the debug port). There is a switch near the top left which will turn it on.




 
Flash the project to the board. Flash - Download.




 
Press the RESET button located on the microcontroller.

 
The program is now running.

 
Now the board is ready to use. What is the program doing? Press SW1 and observe the behavior of the microcontroller. Now press SW2 and observe. Estimate the rate at which the lights are flashing.




Use the logic analyzer and triggers to measure the rate of the flashing light. DO NOT connect the logic analyzer without talking with the TA first. Your board will burn out. Hint: The light power line is connected to pin F1.




 
In order to connect the logic analyzer to your board, the Logic Probe must be connected.

 
Change the logic analyzer settings (Hint, refer to the 'Setting Up Digital Channels' section of the scope user manual).

o Change the format so the analyzer only looks at pin 0 of the probe o Trigger on 5ms




 
When you press either button, the light should flicker then move to a steady state. Use the logic analyzer to obtain the flicker waveform for SW1. (Hint: use falling edge trigger)

o Obtain screenshot of the logic analyzer timing verification. o Draw the waveform.




o Record the amount of time between flicker states (Hint: try both an automatic




measurement and the cursors [section 'Taking Manual Measurements with Cursors' pages 132–136])




 
Use the logic analyzer to obtain the timing for SW2. (Hint: use rising edge trigger) o Obtain screenshot of the logic analyzer timing verification.




Using the Analog Comparator of the TM4C123GH6PM Microcontroller




The analog comparator will convert a voltage to a digital value. Read about these in chapter 19 of the datasheet.




 
Open the project in the 'comparator' folder.

 
The project contains code which will turn on a light when the voltage on analog comparator C1-(found in Table 19-1) rises above a certain level. What are the pin assignments for this configuration?

 
Chapter 19 gives information about the configuration of this peripheral. Which register stores the information about internal reference?




 
Use the system viewer to Select Peripherals - System Viewer - COMP to show the analog comparator registers. Run the program and observe the configuration of the register found in step 3.




 
Using the information from the above register, determine the RNG value and the VREF value. Finally, determine the actual internal voltage reference which will activate the light.




 
Test your answer with a voltage source. To avoid damage to your board, start the voltage at 0.







About Lab Reports




Lab reports are used for two purposes. One is to show your employer/grader what you have done. The other purpose of a lab report is to serve as a reference manual in your future.




 
Write down what steps were needed to perform a task.

 
Take screenshots or pictures of procedures or results.

 
Describe issues and solutions to them.

 
Any other necessary knowledge – this is not an all-inclusive list of required items. You should fill the lab report as full as necessary to show design decisions and procedures.




Read the “Guidelines for Lab Reports” page on the wiki for more pointers.

More products