Homework 8 - Answers

docx

School

Coastal Alabama Community College - Bay Minette *

*We aren’t endorsed by this school

Course

103

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

docx

Pages

2

Uploaded by DeanBatMaster1032

Report
Homework Assignment 8 1. Consider the I 2 C standard and note chapter 9 of the “Designing Embedded Applications” book. a. What type of special output driver is needed for the clock and data line of an I 2 C bus? Open drain (aka open collector) b. To get the I 2 C clock and data lines to work correctly, what external component must be added to each? Pullup resistor c. How are START and STOP different from an ordinary logic-1 and logic-0 on the I 2 C bus? Data value changes while clock is low d. An I 2 C master wants to access a specific register inside a peripheral. How does the master indicate which register it wants to access? It writes out a separate “access address” e. Is I 2 C synchronous or asynchronous? Synchronous 2. Consider a FXOS8700 sensor (datasheet is in Canvas). a. Which device pin(s) select the I 2 C bus address of the sensor? SA0 and SA1 (Pins 7 and 10) b. What is the bus address of the sensor if both pins are wired low (logic 0)? 0b0011110. Read = 0x3D, Write = 0x3C. c. What is the 8-bit value sent to the FXOS8700 if both pins are wired low and the master is writing to it? Write address + R/W bit = 0b00111100 = 0x3C d. What is the access address (also known as “subaddress”) of M_DR_STATUS register? 0x32 e. Which pin (pin number) is used for SCL and which pin is used for SDA? SCL is pin 4 and SDA is pin 6 3. Consider a K22 Kinetis chip (K22P144M120 to be more specific…). A datasheet for the chip is available in Canvas. Consult the “Pinout” section (chapter 10). Alice wants to connect the K22 Kinetis to the FXOS8700 sensor using I2C1 (I2C port 1). Note that she also wants to use SPI port 1 (SPI1) so she must select pins that bring out I2C1 and not SPI1. a. Which pins are available? List both pin numbers and port and bits. Pins 115/PTC10 and 116/PTC11 b. Which “ALT” column contains the I2C1 option for these pins? ALT2 c. Which pin is SCL and which one is SDA? Pin 115/PTC10 = SCL. Pin 116/PTC11 = SDA. d. Consider the FXOS8700 device from question 2. Which pin is SCL and which pin is SDA? SCL is pin 4 and SDA is pin 6 e. Draw a schematic that shows how the pins of the Kinetis are connected to the FXOS8700 to get I2C working. The schematic should show the pin numbers of the FXOS8700 and clearly indicate which wire is SCL and which is SDA. Also consider what extra component has to be added to SCL and SDA, per the I2C standard, to enable the connected system to work correctly. Schematic should show pin 115 to pin 4 and pin 116 to pin 6, and pullup resistors on both. f. In the example in class, I showed how a data structure could be created to enable both open-drain and the correct “MuxAlt” setting. Which port and pin numbers
need to be programmed in this manner to enable I2C1 to work correctly? PTC10 and PTC11 g. In the example in class, there was a function provided named I2C_Write. Write one line of code to send one byte to CTRL_REG1 using all of the above settings. Assume that the data to be written to CTRL_REG1 is found in SendData[0]. I2C_Write(I2C1, 0x1E, 0x2A, 1, 1, SendData);
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