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: