Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

writing to onboard eeprom from outside main program

Status
Not open for further replies.

ghostman11

Well-Known Member
hi chaps,
i am aware of how to read and write to the pic onboard eeprom. but is there a way to write say a serial number or dataset to an eeprom at the time of flashing the chip with the program? if so how is this done?
 
With pickit2 you can (with the stand alone program) write any value to the eeprom... With MPLAB ide I use the MCH scripts to pre-load the eeprom values... What program do you use?
 
Last edited:
The following is a section of source code to preset the onboard EEPROM for a 16F876, should work for most.
;################ Initialize PIC EEPROM Data Memory################
ORG H'2100' ; INIT EEPROM Data
DE LOW D'600' ; Setpoint Init value of 20DegC (K Units) EEADDRESS 0x00
DE HIGH D'600' ; EEADDRESS 0x01
DE LOW D'600' ; Alarm Init value of 20DegC (K Units) EEADDRESS 0x02
DE HIGH D'600' ; EEADDRESS 0x03
 
hi
sorry for the vagueness i couldnt think how to word it without making a hash of it.
i use PK2 software and mplab, i wanted to avoide writing it in the source code. i didnt know you could just write to eeprom from PK2 standalone software so i will have a play with that. all i am after is a unique serial number and a address wich is also unique
 
i did also come up with a over complicated fancy way of doing it. but isnt realy needed and is overcomplicated. i had thought i know get another pic that keeps all the unique codes then when i add another program that chips eeprom via usart with a code checked against those already used etc etc. then i sat down had a cup of tea and thought ...........NAHHHHHHHHhhhhhh keep it simple :D
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top