Forum breadcrumbs - You are here:ForumGeneral: Report Bugs16f84 internal eeprom
You need to log in to create posts and topics.

16f84 internal eeprom

Can't figure out why writing on internal eeprom doesn't work, i found what i think is an error in the file p16f84_regs.xml

https://github.com/eeTools/SimulIDE-dev/blob/master/resources/data/PIC/p16F8x/p16F84_regs.xml#L1

here an excert:

<register name="TRISA" addr="0x85" bits="0-7" reset="11111111"/>
<register name="TRISB" addr="0x86" bits="0-7" reset="11111111"/>
<register name="EECON1" addr="0x85" bits="RD,WR,WREN,WRERR" />
<register name="EECON2" addr="0x86" bits="" />

Aren't EECON1 and EECON2 wrong???

will be enough to just correct the addr value?

Thankyou

Hi. Thank you for reporting.

will be enough to just correct the addr value?

Not sure if it will be enough, but those addresses should be corrected.
Try it and let me know if still not working.

Addresses should be 0x88 and 0x89, isn't it?

Yes, the addresses should be 0x88 and 0x89

Changed in the file, but the eeprom read/write still doesn't work.

Attached are the SIM file, the asm, and the hex, so you can test.

The program simply count keypresses and display it on RB0-7 in binary. The current value of the count is stored in EEprom address 0x00.

On the simulation the eeprom is unaffected , and the execution is stuck waiting the WR flag to be cleared.

; Wait for the write to complete
btfsc EECON1,WR    ; WR bit cleared                                    <--
goto $-1                      ; no, keep waiting                                 <--
bcf EECON1,WREN  ; Yes, clear write enable bit
bcf STATUS,5             ; Set Bank 0

SimulIDE -1.1.0-SR1 rev 250918

Uploaded files:

I saw that you fixed the 16f84 wrong EECON register. The same error is in the 16f83 file.

https://github.com/eeTools/SimulIDE-dev/blob/master/resources/data/PIC/p16F8x/p16F83_regs.xml

 

arcachofo has reacted to this post.
arcachofo

Sorry but I'm a little bit busy these days.
I will have a look at this problem as soon as possible.

Hi.

I found 2 more problems in configuration files:
EEIE ans EEIF bits not defined.

And more importantly, EEPROM is not defined in perif file.

With these changes your circuit is working for me: every button push, address 0 in EEPROM is incremented.

Attached corrected files.

Uploaded files:

Perfect. Tankyou