![]() |
Forum Index : Microcontroller and PC projects : Loading EEPROM via MPLAB 8.92
Author | Message | ||||
larny Guru ![]() Joined: 31/10/2011 Location: AustraliaPosts: 346 |
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. ![]() |
||||
trippyben![]() Regular Member ![]() Joined: 26/06/2011 Location: AustraliaPosts: 91 |
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: NetherlandsPosts: 5089 |
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: AustraliaPosts: 346 |
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: AustraliaPosts: 346 |
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. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |