McMaster University
MECHTRON 3TA4
Introduction This lab will help you to understand how the I2C serial communication protocol works. You will interface the STM32L476G Discovery board and STM32L476 MCU with an external FT24C64A EEPROM chip that communicates over I2C, and create the corresponding I2C bus circuit on your breadboard. You will also use the internal real-time clo
...[Show More]
Introduction This lab will help you to understand how the I2C serial communication protocol works. You will interface the STM32L476G Discovery board and STM32L476 MCU with an external FT24C64A EEPROM chip that communicates over I2C, and create the corresponding I2C bus circuit on your breadboard. You will also use the internal real-time clock (RTC) of the STM32L476. Prelab [5 pts] 1. This lab assumes you are familiar with the material required for Lab1 and Lab2. In particular, you should feel comfortable structuring your programs using Finite State Machines. 2. Read Zhu, Embedded Systems with ARM Cortex-M Microcontrollers in Assembly Language and C, Chapter 18 Real-Time Clock (RTC) and Chapter 22 Serial Communication Protocols. The following slides provide an overview but are missing useful information Chapter 18 RTC Chapter 22 I2C 3. Review the datasheet of the FT24C64A datasheet for the I2C EEPROM chip. Focus on p.1-7 paying particular attention to the addressing info at the bottom of page 4. 4. Review the material in Chapter 39 of the MCU’s Reference Manual and Chapter 30 of the HAL library user manual to learn about I2C. Some of these details are low level and you will not deal directly with them, but you must have an understanding of the subject matter. 5. Review the material in Chapter 38 of the MCU’s Reference Manual, Chapter 48 of the HAL library user manual and the RTC Application Note to learn about the RTC in the STM32L476. 6. Read about BCD encoding. This will be needed for the RTC. 7. Draw a FSM that implements the behavior described in the Requirements section below and upload it to your folder on Avenue before the beginning of your (lab) session in the second week of Lab 3! (One per group) Procedure 1. On your breadboard, create the ciruit shown below. • The Vcc power sources may be connected to the 3.3V output pin of the STM32L476G Discovery board. This is sufficient to power everything. • The GPIO pins of the STM32L476G Discovery board can be configured as internally pulled up or pulled down. In the library file provided in the starter project (i2c at32c64.c), when the I2C is initiated, the SCL and SDA pins have been configured to be internally pulled up. Therefore the two external pull-up lines (the two wires connecting the SCL and SDA lines to
[Show Less]