Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 10:59 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Loading EEPROM via MPLAB 8.92

Author Message
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 11:09pm 06 Jun 2019
Copy link to clipboard 
Print this post

I have successfully written many PIC programmes in the past.
However, today for the first time, I tried to enter data into the EEPROM via MPLAB.
The result is rather puzzling & I can't see how to fix it.
See the attachment.

Obviously, I must be doing something wrong but can't see what.

Any advice will be appreciated.



Edited by larny 2019-06-08
 
trippyben

Regular Member

Joined: 26/06/2011
Location: Australia
Posts: 91
Posted: 08:41am 07 Jun 2019
Copy link to clipboard 
Print this post

Use de to define eeprom constants


org 0x2100
de 0x05,0x03,0x11

check the mplab help file for assembler directives
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 5089
Posted: 09:07am 07 Jun 2019
Copy link to clipboard 
Print this post

Dear Larny,

As mentioned by trippyben, EEPROM can be set during programming of the chip.


If you need to program the EEPROM from your own code, you must use a different method. EEPROM is not as fast as RAM.

There is an EEPROM address register EEADR, and eeprom data register EEDAT that must be filled with the correct address and data, and then a write cycle must be stated through setting a write bit in the eeprom command register. Then you must poll the ready bit in the status register to see if the writing is finished. Byte for byte....

Look at the datasheet of the actual chip you are using. Most cases the procedure and basic code is detailed out.

Regards,

Volhout
PicomiteVGA PETSCII ROBOTS
 
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 09:37am 07 Jun 2019
Copy link to clipboard 
Print this post

  trippyben said   Use de to define eeprom constants


org 0x2100
de 0x05,0x03,0x11

check the mplab help file for assembler directives


Thanks very much trippyben. That's exactly what I wanted to know.

In looked at the help file but could not see anything relevant. I'll have another look tomorrow.
 
larny
Guru

Joined: 31/10/2011
Location: Australia
Posts: 346
Posted: 09:40am 07 Jun 2019
Copy link to clipboard 
Print this post

  Volhout said   Dear Larny,

As mentioned by trippyben, EEPROM can be set during programming of the chip.


If you need to program the EEPROM from your own code, you must use a different method. EEPROM is not as fast as RAM.

There is an EEPROM address register EEADR, and eeprom data register EEDAT that must be filled with the correct address and data, and then a write cycle must be stated through setting a write bit in the eeprom command register. Then you must poll the ready bit in the status register to see if the writing is finished. Byte for byte....

Look at the datasheet of the actual chip you are using. Most cases the procedure and basic code is detailed out.

Regards,

Volhout


Thanks for the reply. I wanted to know how to programme the EEPROM in MPLAB. So trippyben's answer was exactly what I wanted. I know how to programme the EEPROM in code as you described.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025