Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

why i cannot write to EEPROM?

Status
Not open for further replies.

belinda_sg

New Member
Code:
 movlw 008008h ;
    movwf EEADR ; Data Memory Address to write
    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?

thx for your help
 
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?.
 
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?
 
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?.
 
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
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top