neoaspilet11
Full Member level 5
- Joined
- Sep 29, 2005
- Messages
- 277
- Helped
- 29
- Reputation
- 56
- Reaction score
- 8
- Trophy points
- 1,298
- Location
- Cebu, Philippines
- Activity points
- 4,048
mplab eeprom
Hello Everybody,
I am having troubles in simulating writing and reading EEPROM using the MPSIM of MPLAB.
I have some questions please help. (I used PIC16f877A)
1.) After I put data on EEADR and EEDATA, then EECON1, EEPGD is CLEAR and EECON1, WREN is SET, then the wite sequence 55h and AAh to EECON2 then I turn SET EECON1, WR to initiate writing.
The DATA does not reflect on the EEPROM address after initiating writing. Is the simulation works this way? Is the eeprom writing simulation being mimic in the actual writing which will take 4 to 8 ms?
2.) My EEPROM write suborutine is preceded by instruction like this
btfsc EECON1, WR
goto $-1
movlw ....
I used a loop in writing an array of data to EEPROM but it seems after one pass of calling my subroutine, the EECON1, WR will never get CLEAR thus the program is stuck in the code above.
How do I force EECON1, WR to CLEAR? (Note in actual operation, EECON1, WR is CLEARed by hardware which means writing to EEPROM is finished. It can only be SET but not CLEARed in software.)
3.) I am having the same problems with reading EEPROM too. it seems the EECON1, RD will not get CLEARed after one pass and worse it will not return any data.
Hoping for you smart ideas.
Jack
Hello Everybody,
I am having troubles in simulating writing and reading EEPROM using the MPSIM of MPLAB.
I have some questions please help. (I used PIC16f877A)
1.) After I put data on EEADR and EEDATA, then EECON1, EEPGD is CLEAR and EECON1, WREN is SET, then the wite sequence 55h and AAh to EECON2 then I turn SET EECON1, WR to initiate writing.
The DATA does not reflect on the EEPROM address after initiating writing. Is the simulation works this way? Is the eeprom writing simulation being mimic in the actual writing which will take 4 to 8 ms?
2.) My EEPROM write suborutine is preceded by instruction like this
btfsc EECON1, WR
goto $-1
movlw ....
I used a loop in writing an array of data to EEPROM but it seems after one pass of calling my subroutine, the EECON1, WR will never get CLEAR thus the program is stuck in the code above.
How do I force EECON1, WR to CLEAR? (Note in actual operation, EECON1, WR is CLEARed by hardware which means writing to EEPROM is finished. It can only be SET but not CLEARed in software.)
3.) I am having the same problems with reading EEPROM too. it seems the EECON1, RD will not get CLEARed after one pass and worse it will not return any data.
Hoping for you smart ideas.
Jack