Most PIC datasheets include short examples in assembler of how to read & write to onboard EEPROM.

You can also open the PBP library file PBPIC14.LIB, and scroll down to line 6018 to see how PBP WRITEs to EEPROM in assembler for the 14-bit core PIC.

However, I doubt this is the root of your WRITE problem.

You're using assembler interrupts with timer0 interrupting everything at 819uS (at 20MHz) or 4mS (at 4MHz) intervals.

You're using BASIC commands within your assembler interrupt without proper context saving or restoring of PBP system variables, and you're using BASIC commands that take much longer than your interrupt timing allows for your BASIC commands to operate properly, etc, etc,.

> count porta.3,1000,pulsos

At 20MHz, you will have around 1,221 timer0 interrupts in the time period it takes for this single BASIC line to perform its function.

Is this really what you want/need..?

TIP: To verify PBP commands like read, write, count, etc,, do it "without assembler interrupts". At least until you know a certain command is working as expected, at the oscillator speed you're using.

Once you're comfortable with, and know how (or if) a PBP command works, then move on to using these commands in larger more complex programs.

Example;
Code:
@ DEVICE HS_OSC, WDT_OFF
DEFINE OSC 20
EADD VAR BYTE ' EEPROM address
EDAT VAR BYTE ' EEPROM Data
X       VAR BYTE ' GP Var

PORTB = 0
TRISB = 0

MAIN:
      FOR EADD = 0 TO 25
        EDAT = EADD 
        WRITE EADD,EDAT
        GOSUB SHOW
     NEXT EADD

DONE:
    GOTO DONE

SHOW:
     READ EADD,X
     PORTB = X
     PAUSE 250
     RETURN
5 LED's on portb will show you if the READ & WRITE commands are working properly at 20MHz. If it is working at 4MHz, but not working at 20MHz, then I would suspect a timing issue.

This could be caused by using a 20MHz oscillator, and programming the config fuse for XT. At 20MHz be sure it's set for HS before programming your PIC. You may also want to verify your 20MHz crystal and load caps with a simple blink LED program if all else fails.

TIP #2: If you're going to use primarily BASIC commands, and you have to use interrupts, then look into using the PBP ON INTERRUPT option for BASIC interrupts. This gives your BASIC commands time to complete execution, and return what you really expect.

If you prefer to use assembler interrupts, then you really do need to get familiar with assembler, how to save/restore PBP system variables, and which system variables need attention based on the PBP commands used.

Hope this helps.