Lab9-Prelab

docx

School

Iowa State University *

*We aren’t endorsed by this school

Course

288

Subject

Mechanical Engineering

Date

Apr 3, 2024

Type

docx

Pages

3

Uploaded by MinisterGorillaMaster358

Report
Embedded Systems International Lab 9 Prelab Name : Lab Partner Name (if you worked together and are submitting the same document or mostly the same answers): Lab Section : 3c Submit your prelab document as a PDF file in Canvas under the corresponding prelab assignment. Every student submits their own prelab. Lab partners are allowed to work on the prelab together and submit the same document (if there is actual collaboration on the document). For full credit, the prelab must be submitted prior to the start of lab. Text responses should be typed or printed neatly. Complete the following preparation before doing this prelab and before the Tuesday class meeting: see preparation guide, reading-prep-TimerIC.pdf , under Readings (7) - Timers . Prep time is estimated as 30- 40 minutes. 1. System sketch Similar to system sketches in previous labs, sketch a diagram that shows how the PING))) ultrasonic sensor connects to the microcontroller. Refer to the file Cybot-Baseboard-LCD-Schematic.pdf, as needed. In the photo of the CyBot baseboard, shown at right, the jumper wires are connected to the sensors and servo motor. PING refers to the ultrasonic sensor. CPRE 288, ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT , IOWA STATE UNIVERSITY 1
Your diagram should show the port and the pin (or bit) number of the port that the ultrasonic sensor is connected to. Give the port name and pin number used in the microcontroller (e.g, Port A pin 0, PA0). 2. How do you know that the pin the PING))) sensor is connected to (question 1) corresponds to Timer 3B in the microcontroller? Be specific in your explanation. I know that the pin the PING sensor is connected to timer 3B since the baseboard schematic shows it’s attached to GPIO port B.It can be seen in table 23-5 of the data sheet that an alternate function of PB3 Is the CCP port. 3. Write 2-3 lines of code to configure the GPIOAFSEL and GPIOPCTL registers to select the Timer 3B (T3CCP1) peripheral signal as an alternate function for the GPIO pin it is connected to. What if you don’t configure the GPIOPCTL register properly, i.e., suppose you put an incorrect value in the register? Briefly explain why your code would not work. Think about the signal path from the GPIO port pin. //set bit(pin 3) to use alternate function GPIO_PORTB_AFSEL_R |= 0x8; //set bit field FPIO_PORTB_PCTL_R = 0x7000; If PCTL register is not setup in the proper manner then the multiplexer which determines what alternate function the port is attached to would be given the wrong signal. 4. Refer to the GPTM Timer register list, such as in the Tiva datasheet, Bai book chapter, and/or GPIO-GPTM-registers-tables.pdf. a. Which GPTM register configures the timer so that it detects a particular edge (positive, negative or both) on the CCP input pin? GPTM control (GPTMCTL) b. What is the memory address of this memory-mapped I/O register? 2
0x4003 300C (for Timer 3) c. Sketch the register as shown in the datasheet description. Circle the bit or bit fields that must be set up for this lab. 5. The PING))) sensor datasheet specifies the maximum echo pulse width in milliseconds. a. What is this value? Max echo pulse width : 18.5 ms b. Given the speed of sound is 343 meters per second, and the echo pulse width is round-trip distance to the object, what is the maximum distance range of the sensor in meters? Calculate the distance (don’t copy the value from the datasheet). 3.17275 meters c. Using a 16 MHz system clock, how many clock periods (or timer steps) are needed for the maximum echo pulse width? State your result in both decimal and hex. 296,000 clock periods Note: You can find more information about the PING))) sensor here, https://www.parallax.com/product/28015 , including projects and videos, such as https://learn.parallax.com/tutorials/robot/cyberbot/cyberbot-roaming-ping 3
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help