// External Eprom Access. Jamie Balfour. Dec 2002.
// Tested with 24LC256 Memory from Microchip and PIC16F877 running at 20MHz.
// No Liability Accepted.
#include "Eprom Functions.h"
// To write to memory: ByteWrite( Chip ID, Upper Address Byte, Lower Address Byte, Data Byte);
// To read from memory: RetrieveData( Chip ID, Upper Address Byte, Lower Address Byte );
main()
{
TRISB=0; /* Port B all outputs - used to display data */
ByteWrite( 0x50, 0, 1, 53 ); /* Writes 53 to the Address Location 1 */
PORTB=RetrieveData( 0x50, 0 , 0 ); /* Reads back and presents it on PORTB */
while(1); /* Infinite Loop */
}