Data logging with an EEPROM
Your task is to use the PIC to log data from an analog input and send the data back to a PC running matlab. Use an interrupt service routine to read an analog input and write the value to an external EEPROM using I2C. After reading in a fixed number of samples, perhaps 1,000 or 10,000, the program should send the data back to a matlab program via an RS-232 link. The logged data should then be plotted by matlab.
You should decrease the sample time until the ISR does not successfully complete. What is the fastest rate at which an analog input can be read and stored to the external EEPROM? Try this for an analog input configured for both 8-bit (1 byte of data stored on the EEPROM) and 10-bit (2 bytes of data stored on the EEPROM). How much data can be stored on the EEPROM?
As a test input, use a triangle wave signal from the function generator between 1 and 4 V, and plot the data in matlab.
See [Interfacing_to_External_EEPROM], [PIC_RS232], and [Serial_communication_with_Matlab].