Problems with loading the EEPROM for real - PICF877A

Status
Not open for further replies.

si2030

Member
Hi All

I have included a simple file of the code that manages the loading of the EEPROM in the above microcontroller.

In a nutshell it works using MPLAB... that is, if you step through it, it loads the EEPROM correctly in the software with the EEPROM window showing the results. However when I load this code into the actual microcontroller and run it nothing is saved to the EEPROM.

There are two tests. Both are called one after the other. The first is very easy... it loads three numbers into the EEPROM.

The second test copies 7 numbers from one location to the other and also, using the FSR register, copies this to EEPROM.

The fact that it works via the debugger is one thing but I have no idea why it does not populate the EEPROM in the chip in real life???.

Incidentally I am using a PicKit2 interface. The microcontroller works well with the other interfaces including the LCD and KEYPAD.

Hoping you might throw me some ideas or maybe I have missed something...


Simon

View attachment EEPROM.asm
 
I don't see where you are clearing the IRP bit. It may be set on the actual chip.

Also, how do you know it isn't working? Do you read the EEPROM back into MPLAB?

You're also executing EEPROM_START_LOAD twice,
Code:
		btfsc	EEPROM_FLAG,0
		call	EEPROM_START_LOAD
		[COLOR="red"]return ; this needed here[/COLOR] 

EEPROM_START_LOAD

Edit2, it's also better if you stick to your original thread as starting a new one each time means others don't know the background.

Mike.
 
Last edited:
Hi Mike

I had no idea that existed. OK this works in EEPROM.asm now as I was reading the EEPROM back using the PK2 software and now the EEPROM is populated. However I am finding, with the same routines, that its not working in the larger program. I will now break it down and build it up again but making sure every time I add in a new routine I check that it still works...

Thanks heaps.

Simon
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…