Continue to Site

# why i cannot write to EEPROM?

Status
Not open for further replies.

#### belinda_sg

##### New Member
Code:
 movlw 008008h ;
movlw 46h ;
movwf EEDATA ; Data Memory Value to write
bcf EECON1, EEPGD ; Point to DATA memory
bsf EECON1, WREN ; Enable writes
bcf INTCON, GIE ; Disable Interrupts
movlw 55h ;
movwf EECON2 ; Write 55h
movlw 12h
movwf EECON2 ; Write AAh
bsf EECON1, WR ; Set WR bit to begin write
bsf INTCON, GIE ; Enable Interrupts
sleep ; Wait for interrupt to signal write complete
bcf EECON1, WREN ; Disable writes

after i compile and program this into my device, when i check the EEPROM value, why still not change?

and for "Data Memory Address to write" is it correct to move the address specified in my program?

#### Nigel Goodwin

##### Super Moderator
belinda_sg said:
and for "Data Memory Address to write" is it correct to move the address specified in my program?

The W register only accepts an 8 bit value, so you can't load it with anything higher than 0xFF. But as the data EEPROM is only 256 bytes long, this isn't a problem - where were you trying to store the data?.

#### belinda_sg

##### New Member
i am testing how to write to EEPROM, so actually any address can, suppose i want to write into address ox08 value 46h..

and how can i verify that i have already successfully write the data into the address?

#### Nigel Goodwin

##### Super Moderator
belinda_sg said:
i am testing how to write to EEPROM, so actually any address can, suppose i want to write into address ox08 value 46h..

and how can i verify that i have already successfully write the data into the address?

Easiest way is to simply put the chip back in the programmer and read it, presumably the programmer you use allows you to do this?.

#### lee_man_tbu

##### New Member
I had the same problem, not being able to read my internal EEPROM value's using the IDC for the 877., but if i pulled the value from the EEPROM and used it somewhere else the value's were correct. A bug in the Debugger i guess lol.

Lee

#### tom2000

##### New Member
belinda_sg said:
Code:
 	movlw 55h ;
movwf EECON2 ; Write 55h
movlw 12h <====== WHAT IS THAT ???? THAT IS SUPPOSED BE AAH not 12H
movwf EECON2 ; Write AAh

Status
Not open for further replies.

Replies
3
Views
718
Replies
2
Views
934
Replies
8
Views
1K
Replies
70
Views
6K
Replies
5
Views
546