Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
learn:courses:unit-4-lab4d:start [2017/03/22 19:10] – [9. Questions] Marthalearn:courses:unit-4-lab4d:start [2022/10/04 11:38] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Lab 4d: Communications - I2C Serial Protocols ====== ====== Lab 4d: Communications - I2C Serial Protocols ======
 +[[{}/learn/courses/unit-4-1/start|Back to Unit 4 Part 1]]
 +[[{}/learn/courses/unit-4-2/start|Back to Unit 4 Part 2]]
 +[[{}/learn/courses/unit-4-lab4c/start|Back to Lab 4c]]
  
 === Download This Document === === Download This Document ===
-  * {{ :learn:courses:unit-4-lab4d:lab_4d.pdf |Lab 4d PDF}}+{{ :learn:courses:unit-4-lab4d:lab_4d.pdf |Lab 4d PDF}}
  
  
 ===== 1. Objectives ===== ===== 1. Objectives =====
-  * Develop a library of functions that manage the functionality and retrieve data from a three-axis accelerometer using I²C communications. +  - Develop a library of functions that manage the functionality and retrieve data from a three-axis accelerometer using I²C communications. 
-  * Display the accelerometer data on the Basys MX3 LCD. +  - Display the accelerometer data on the Basys MX3 LCD. 
-  * Display the accelerometer data on the workstation monitor using UART asynchronous communications.+  - Display the accelerometer data on the workstation monitor using UART asynchronous communications.
  
 ---- ----
  
 ===== 2. Basic Knowledge ===== ===== 2. Basic Knowledge =====
-  * How to exchange serial data with a computer terminal using the PIC32MX370 UART +  - How to exchange serial data with a computer terminal using the PIC32MX370 UART 
-  * How to use the PIC32MX3270 processor to display text on a character LCD +  - How to use the PIC32MX3270 processor to display text on a character LCD 
-  * How to implement code reuse that integrates previously developed processor code into new application projects. +  - How to implement code reuse that integrates previously developed processor code into new application projects. 
  
  
Line 22: Line 25:
 ===== 3. Equipment List ===== ===== 3. Equipment List =====
 ==== 3.1. Hardware ==== ==== 3.1. Hardware ====
-  * [[http://store.digilentinc.com/basys-mx3-pic32mx-trainer-board-recommended-for-embedded-systems-courses/|Basys MX3 trainer board]] +  - [[https://digilent.com/shop/basys-mx3-pic32mx-trainer-board-for-embedded-systems-courses/|Basys MX3 trainer board]] 
-  * Workstation computer running Windows 10 or higher, MAC OS, or Linux +  - Workstation computer running Windows 10 or higher, MAC OS, or Linux 
-  * 2 [[http://store.digilentinc.com/usb-a-to-micro-b-cable/|Standard USB A to micro-B cables]]+  - 2 [[https://digilent.com/shop/usb-a-to-micro-b-cable/|Standard USB A to micro-B cables]]
  
 In addition, we suggest the following instruments: In addition, we suggest the following instruments:
-  * [[http://store.digilentinc.com/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply/|Analog Discovery 2]]+  - [[https://digilent.com/shop/analog-discovery-2-100ms-s-usb-oscilloscope-logic-analyzer-and-variable-power-supply/|Analog Discovery 2]]
  
 ==== 3.2. Software ==== ==== 3.2. Software ====
 The following programs must be installed on your development work station: The following programs must be installed on your development work station:
  
-  * [[http://www.microchip.com/mplab/mplab-x-ide|Microchip MPLAB X® v3.35 or higher]] +  - [[http://www.microchip.com/mplab/mplab-x-ide|Microchip MPLAB X® v3.35 or higher]] 
-  * [[http://www.microchip.com/SWLibraryWeb/product.aspx?product=PIC32%20Peripheral%20Library|PLIB Peripheral Library]] +  - [[http://www.microchip.com/SWLibraryWeb/product.aspx?product=PIC32%20Peripheral%20Library|PLIB Peripheral Library]] 
-  * [[http://www.microchip.com/xcdemo/xcpluspromo.aspx|XC32 Cross Compiler]] +  - [[http://www.microchip.com/xcdemo/xcpluspromo.aspx|XC32 Cross Compiler]] 
-  * [[http://store.digilentinc.com/waveforms-2015-download-only/|WaveForms 2015]]  +  - [[https://digilent.com/shop/software/digilent-waveforms/|WaveForms]]  
-  * [[http://www.putty.org/|PuTTY Terminal Emulation]]+  - [[http://www.putty.org/|PuTTY Terminal Emulation]]
  
 ---- ----
  
 ===== 4. Project Takeaways ===== ===== 4. Project Takeaways =====
-  * Understanding of requirements and implementations of synchronous communications. +  - Understanding of requirements and implementations of synchronous communications. 
-  * Understanding of the I²C Protocol. +  - Understanding of the I²C Protocol. 
-  * Understand the advantages and disadvantages of I2C compared to UART and SPI.+  - Understand the advantages and disadvantages of I2C compared to UART and SPI.
  
  
Line 147: Line 150:
 //Figure 7.1. Picture of the MMA8652FC Accelerometer mounted on the Basys MX3 processor board.// //Figure 7.1. Picture of the MMA8652FC Accelerometer mounted on the Basys MX3 processor board.//
  
-{{ :learn:courses:unit-4-lab4d:lab4d-fig-7-2.png?nolink&600 |Figure 7.2. Schematic diagram of MMA8652FC accelerator on the Basys MX3 processor board.}}+{{ :learn:courses:unit-4-lab4d:lab_4d_fig_7_2.jpg?nolink&700 |Figure 7.2. Schematic diagram of MMA8652FC accelerator on the Basys MX3 processor board.}}
 //Figure 7.2. Schematic diagram of MMA8652FC accelerator on the Basys MX3 processor board.// //Figure 7.2. Schematic diagram of MMA8652FC accelerator on the Basys MX3 processor board.//
 +
 +
  
 ==== 7.1. The MMZ8652FC 3-Axis Accelerometer Software ==== ==== 7.1. The MMZ8652FC 3-Axis Accelerometer Software ====
 The communications with the accelerometer requires two global functions that are made up of calls to the four hardware interface functions shown in Listings B.6 through B.9. The control flow diagrams for writing and reading a succession of accelerometer registers are shown in Fig. 7.3 and Fig. 7.4.  These two functions can only be called after the accelerometer has been initialized using the code in Listing B.5. The shaded blocks in Fig. 7.3 and Fig. 7.4 refer to coded functions provided in Listings B.2 through B.6. With the aid of the control flow diagrams shown in Fig. 7.3 and Fig. 7.4, the user is expected to develop their one i2cWriteBlk and i2cReradBlk functions. The communications with the accelerometer requires two global functions that are made up of calls to the four hardware interface functions shown in Listings B.6 through B.9. The control flow diagrams for writing and reading a succession of accelerometer registers are shown in Fig. 7.3 and Fig. 7.4.  These two functions can only be called after the accelerometer has been initialized using the code in Listing B.5. The shaded blocks in Fig. 7.3 and Fig. 7.4 refer to coded functions provided in Listings B.2 through B.6. With the aid of the control flow diagrams shown in Fig. 7.3 and Fig. 7.4, the user is expected to develop their one i2cWriteBlk and i2cReradBlk functions.
  
-{{ :learn:courses:unit-4-lab4d:lab4d-fig-7-3.png?nolink&200 |Figure 7.3. Control Flow Diagram for writing a block of data to the MMA8652FC Accelerometer.}}+{{ :learn:courses:unit-4-lab4d:lab_4d_fig_7_3.jpg?nolink&200 |Figure 7.3. Control Flow Diagram for writing a block of data to the MMA8652FC Accelerometer.}}
 //Figure 7.3. Control Flow Diagram for writing a block of data to the MMA8652FC Accelerometer.// //Figure 7.3. Control Flow Diagram for writing a block of data to the MMA8652FC Accelerometer.//
  
-{{ :learn:courses:unit-4-lab4d:lab4d-fig-7-4.png?nolink&500 |Figure 7.4. Control Flow Diagram for reading a block of data from the MMA8652FC Accelerometer.}}+{{ :learn:courses:unit-4-lab4d:lab_4d_fig_7_4.jpg?nolink&500 |Figure 7.4. Control Flow Diagram for reading a block of data from the MMA8652FC Accelerometer.}}
 //Figure 7.4. Control Flow Diagram for reading a block of data from the MMA8652FC Accelerometer.// //Figure 7.4. Control Flow Diagram for reading a block of data from the MMA8652FC Accelerometer.//
  
Line 202: Line 207:
 ===== 9. Questions ===== ===== 9. Questions =====
 1. Using the waveform captured in step 5 of the testing section, identify all portions of the I2C SDA and SCL signals starting with the START sequence and ending with the STOP sequence.\\ 1. Using the waveform captured in step 5 of the testing section, identify all portions of the I2C SDA and SCL signals starting with the START sequence and ending with the STOP sequence.\\
- 
-{{ :learn:courses:unit-4-lab4d:lab4d-fig-9-1.png?nolink&800 |Figure 9.1. Screen capture showing the I2C timing for a 2-byte read operation.}} 
-//Figure 9.1. Screen capture showing the I2C timing for a 2-byte read operation.// 
- 
 2. Compute the effective data rate in bits per second.\\  2. Compute the effective data rate in bits per second.\\ 
 3. What effect, if any, would a change in the pull up resistors value for the SDA and SCL have on the I²C bus? \\ 3. What effect, if any, would a change in the pull up resistors value for the SDA and SCL have on the I²C bus? \\
Line 230: Line 231:
  
 ===== Appendix A: Unit 4 Parts Configuration ===== ===== Appendix A: Unit 4 Parts Configuration =====
-{{ :learn:courses:unit-4-lab4d:unit_4_-_photo_6.jpg?nolink&400 |Figure A.1. Unit 4 hardware and instrumentation configuration.}}+{{ :learn:courses:unit-4-lab4d:unit_4_-_photo_6.jpg?nolink&500 |Figure A.1. Unit 4 hardware and instrumentation configuration.}}
 //Figure A.1. Unit 4 hardware and instrumentation configuration.// //Figure A.1. Unit 4 hardware and instrumentation configuration.//
  
-{{ :learn:courses:unit-4-lab4d:lab4d-fig-a-2.png?nolink&400 |Figure A.2. PIC32MX I²C hardware block diagram.}}+{{ :learn:courses:unit-4-lab4d:lab4d-fig-a-2.png?nolink&600 |Figure A.2. PIC32MX I²C hardware block diagram.}}
 //Figure A.2. PIC32MX I²C hardware block diagram.// //Figure A.2. PIC32MX I²C hardware block diagram.//
  
Line 357: Line 358:
 } /* End of i2cReceiveOneByte */ } /* End of i2cReceiveOneByte */
 </code> </code>
 +
 +----
 +
 +[[{}/learn/courses/unit-4-1/start|Back to Unit 4 Part 1]]
 +[[{}/learn/courses/unit-4-2/start|Back to Unit 4 Part 2]]
 +[[{}/learn/courses/unit-4-lab4c/start|Back to Lab 4c]]
 +[[{}/learn/courses/unit-5/start|Go to Unit 5]]