Difference between revisions of "Embedded System I2C Tutorial"
From Embedded Systems Learning Academy
Proj user10 (talk | contribs) (→Assignment Outline) |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
+ | Socialledge is moving to two portals. | ||
+ | * The Wiki will remain here for general references about the SJ-One board, and to document student reports. | ||
+ | * The bookstack will now be used for SJSU assignments | ||
+ | |||
+ | [http://books.socialledge.com/books/embedded-drivers-real-time-operating-systems/chapter/lesson-i2c This article has been moved here] | ||
+ | |||
+ | <!-- | ||
== Theory of Operation == | == Theory of Operation == | ||
I2C is prounced "eye-squared see". It is also known as "TWI" because of the intial patent issues of this BUS. This is a popular, low throughput (100-1000Khz), half-duplix BUS that only uses two wires regardless of how many devices are on this BUS. Many sensors use this BUS because of its ease of adding to a system. | I2C is prounced "eye-squared see". It is also known as "TWI" because of the intial patent issues of this BUS. This is a popular, low throughput (100-1000Khz), half-duplix BUS that only uses two wires regardless of how many devices are on this BUS. Many sensors use this BUS because of its ease of adding to a system. | ||
Line 131: | Line 138: | ||
== Assignment == | == Assignment == | ||
− | === I2C State Machine === | + | === I2C State Machine Assignment === |
Design your I2C state machine. Look at the "Master Write" and "Master Read", and do the following: | Design your I2C state machine. Look at the "Master Write" and "Master Read", and do the following: | ||
Line 138: | Line 145: | ||
*You can design your own state machine, or augment the existing one, whichever method can yield the maximum clarify for your I2C slave state. | *You can design your own state machine, or augment the existing one, whichever method can yield the maximum clarify for your I2C slave state. | ||
− | === I2C === | + | === I2C Code Assignment === |
==== Assignment Outline ==== | ==== Assignment Outline ==== | ||
− | <b>This is a group assignment; submit one copy of code per team and put down the names of your group members as part of the source code you turn in. Only turn in the new code you added, not the entire file.</b> | + | <b>This is a group of two assignment; submit one copy of code per team and put down the names of your group members as part of the source code you turn in. Only turn in the new code you added, not the entire file.</b> |
* The I2C#2 driver is already implemented and used for on-board sensors. | * The I2C#2 driver is already implemented and used for on-board sensors. | ||
* Study the existing I2C code: i2c_base.cpp. Please ask any questions if you have any, but the driver was implemented using the state machine diagrams given at the below wikipedia page. | * Study the existing I2C code: i2c_base.cpp. Please ask any questions if you have any, but the driver was implemented using the state machine diagrams given at the below wikipedia page. | ||
Line 204: | Line 211: | ||
* Follow your diagram and figure out how to make the I2C slave state machine walk through to read and write registers | * Follow your diagram and figure out how to make the I2C slave state machine walk through to read and write registers | ||
<BR/> | <BR/> | ||
+ | --> |
Latest revision as of 20:06, 25 January 2019
Socialledge is moving to two portals.
- The Wiki will remain here for general references about the SJ-One board, and to document student reports.
- The bookstack will now be used for SJSU assignments
This article has been moved here