Lesson 03 - I2C IIThe lectureThis is the second of two lectures about I2C and components on the I2C bus I2C (or wire) is a very common local network or fieldbus within robotics and controlsystems. Today is dedicated to
The lecture will be short because exercise will be of high priority today Preparation for the lecture
Exercise 2 - DS1807 - digital potentiometer
Exercise 2 - TC87 - temperature measurement
Exercise 3 - DS 1307 realtime clock - EXTRAAs exercises above Exercise 4 - you slave frameworkBased on exercises from previous lecture design a framework for a generic slave
It is an idea to have one command (read I assume) that can return status and ID from slave device
Litterature and slidesSlides
Litt and data sheetsRepetitionLitterature from previous lecture MoviesAfter today - you should (at least) be able to …
Tips3.3V versus 5VSome devices like Arduino UNO, Mega,… is powered by 5V. See more here (a practical viewpoint)
This might give problems when having a mix of 3.3V and 5V devices on the bus You might damage 3.3V devices by having a 5V device on the canbus. meaning you might be lucky or … not. citing from element14.com 2C devices have open-drain drivers, which only pull the SCL and SDA lines low to 0V.
A hack
3.3V TTL logic shares the 0.8V and 2V thresholds for logic 0 and logic 1 transitions with 5V TTL logic,
But I dont give any guarantee GroundWhen wiring up always start with ground so all devices has same reference I2C recoverIf your I2C locks up this code might help you lect03-i2c-recover Some Example Code |