Tags:
view all tags
---+ Exercise 15: EEPROM and Driver Access ---++ Goal: The goal of this exercise is twofold: First we will learn about an EEPROM, a Electrically Erasable Read Only Memory. These devices are often used in instruments to store calibration values or configuration parameters. EEPROMs can usually be read byte by byte but can be erased and written only in blocks. The [[http://www.atmel.com/Images/doc0336.pdf][ at24c32 ]]is a 32kbit (4 kbyte) EEPROM with an I2C interface. This time however we will not use the I2C access functions in the pigpio library but access the i2c driver directly. You need to * <p>open the device (/dev/i2c-1)</p> * <p>find out which functions the drivers supports (ioctl I2C_FUNCS)</p> * <p>block read the data</p> * <p>close the device</p> The full description on how to access I2C devices through the driver directly is found [[https://www.mjmwired.net/kernel/Documentation/i2c/dev-interface][here.]] ---++ Exercise 1: Read the EEPROM This one is an exercise for detectives: There is a secret message hidden in the EEPROM and your job is to uncover the mystery. So… Sherlock Holmes and Dr. Watson: show your talents and find out the contents of the message. ---++ Exercise 2: Write the EEPROM Prepare a buffer with some data to be written to the EEPROM. Use your previous program to read these data back. Power down the Raspberry Pi, wait a minute and then switch it back on again. Verify that you can still read back the data. ---++ Exercise 3: Write an access library Separate out the open, close, read, write … functions into individual files. Rewrite your programs such that you call these generic functions, which can be re-used by other programs. These are the functions that should be available: * <p>at24c32Open</p> * <p>at24c32Close</p> * <p>at24c32Read</p> * <p>at24c32Write</p> * <p>at24c32Debug (switching debugging information on or off)</p> -- %USERSIG{UliRaich - 2017-08-21}% ---++ Comments %COMMENT%
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r6
|
r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r1 - 2017-08-21
-
uli
Home
Site map
AFNOG web
Embedded_Systems web
IoT_Course_English web
IoT_Course_French web
Main web
Sandbox web
TWiki web
Embedded_Systems Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
Edit
Attach
Copyright © 2008-2025 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback