Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Exercise 15: EEPROM and Driver AccessGoal: | ||||||||
Line: 7 to 7 | ||||||||
The at24c32 EEPROM is mounted together with the DS1307 RTC on the Tiny RTC module (chip on the right). The Tiny RTC module therefore responds to 2 I2C addresses. You find these 2 addresses with the i2cdetect command and you can figure out from the data sheets which of the addresses corresponds to which chip. | ||||||||
Added: | ||||||||
> > | The data sheet for the at24c32 can be found here: http://www.atmel.com/Images/doc0336.pdf | |||||||
Added: | ||||||||
> > | Examination exercisesFor the examination please solve exercise 1-3 of this exercise list. Exercise 4 is not part of the examination! For all three exercises, write
| |||||||
Exercise 1: Read the EEPROMThe at24c32 is a 32 kBit device and can therefore store a total of 4096 bytes (4096 * 8 = 32 kBit). Like the DAC it is an I2C device. To make things easier for you, again a library is supplied. | ||||||||
Line: 17 to 30 | ||||||||
https://dcsit.twiki.ucc.edu.gh/html/libDoc/at24c32 | ||||||||
Changed: | ||||||||
< < | 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 | |||||||
> > | 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. Write a program called readEnigma reading the EEPROM and printing its content in hex (%x) and as characters (%c).
Exercise 2: Re-write the program without using the librarySince there are only very few library calls it is also possible to access the EEPROM through pigpio calls avoiding my library all together. Make sure you get the same result as in the first exercise.Exercise 3: 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. | ||||||||
Changed: | ||||||||
< < | Exercise 3: Write an access library | |||||||
> > |
It is possible to access the I2C driver directly and it was my intention to show you how to do this. Unfortunately we did not make it up a level where we can understand how a device driver works. The following exercises it there not part of the examination exercises!
Exercise 4: Write an access library | |||||||
The full description on how to access I2C devices through the driver directly is found here. | ||||||||
Line: 40 to 58 | ||||||||
| ||||||||
Added: | ||||||||
> > |
|