#include <pic/p16f877a.h>
#define FOSC_HZ 20000000
#include <uart.h>
#include <delayms.h>
#include <inteeprom.h>

int main (void)
{
	unsigned char tmp,i;
	delayms(500);	
	uart_open(SET_9600_8N1);
	uart_putc('\n');
	uart_puts("Ultimos 4 Datos:");
	uart_putc(read_int_eeprom(0));
	uart_putc(read_int_eeprom(1));
	uart_putc(read_int_eeprom(2));
	uart_putc(read_int_eeprom(3));
	uart_putc('\n');
	i=0;
	while((i<4)&&(tmp!=13))
          {
		uart_putc('>');
		tmp = uart_getc();
		uart_putc(tmp);
		uart_putc('\n');
		write_int_eeprom(tmp,i);
		i++;
	  }
	uart_puts("FIN\n");
	return 0;
}
