PIC32MX: I2C EEPROM

From Mech
Jump to navigationJump to search

Original Assignment

Do not erase this section!

Your assignment is to interface to the I2C 24AA1025 EEPROM chip.

Overview

You can use the PIC32 to communicate with an EEPROM chip using I2C. The EEPROM chip can store data sent from the PIC and be retrieved at a later time (like an external hardrive).

To test that the code data was writing and reading correctly, the attached code sends data to the EEPROM through I2C, then from the EEPROM back to the PIC, and out to a LED display screen.

Circuit

Connection schematic for 24AA1025 Chip.

I2C.jpg

For visual feedback the PIC32 was connected to and LCD screen(1602A1 USB-A/Mini-B5-06):

LCD.jpg

Code

Where possible, make it a single piece of well-commented cut-and-pastable code, or at least make each function that way, so others can easily copy it. Most comments should be in the code itself; outside the code (on the wiki) should only be explanatory comments that are too cumbersome to include in the code.