Ciao sto utilizzando MPLAB compilatore c18 pikit3 e pic 18f87k90.
Riesco a scrivere in eeprom interna perche se vado attraverso il ttol vedo che effettivamente è scritta ma ho problemi a leggera.
Ho scritto 05 nell indirizzo 0x00 dell EEprom.(VERIFICATO)!
VAdo a leggere wuesta è la routine
qui il codice
unsigned Eeprom_ReadByte(unsigned address)
{
// Set address registers
EEADRH = (unsigned )(address >> 8);
EEADR = (unsigned )address;
EECON1bits.EEPGD = 0; // Select EEPROM Data Memory
EECON1bits.CFGS = 0; // Access flash/EEPROM NOT config. registers
// A read should only take one cycle, and then the hardware will clear
// the RD bit
while(EECON1bits.RD == 1);
EECON1bits.RD = 1; // Start a read cycle
return EEDATA; // Return data
}
e la leggo in questo modo ma non riesco a trovare il valore corretto:
popR = Eeprom_ReadByte(0x00);
Delay_ms (20);
if (popR == 5 ){
break;
}
non lo legge