How to R/W PIC16F886 in circuit? - Page 1
Forum section: electronics / general

author: Chriss
author_rank: Frequent Contributor
timestamp: May 12, 2019, 02:58:32 pm
content: Hi!I'm not familiar with PIC uC and I have a task to do where the PIC16F886 is on the board.What I have to do:I need to change an instrument cluster in a car because the original one is broken, and I have to save the km from theold cluster to the new cluster so the new instrument cluster should much the km of the car as before.My questions are:- can I R/W somehow this uC even if it is in the circuit? Like the AVR uC's through ISP?- if I read only the eep section of this PIC and write it to the new cluster where the firmware is also in there,can I somehow kill the firmware in the new instrument cluster?- is it safe to read out the eep from this PIC or could it maybe kill the firmware in the PIC during the reading process?- is it possible to read out only the eep content if the PIC is locked through the fuses?Thanks for any advice.My best regards.

author: ucanel
author_rank: Regular Contributor
timestamp: May 12, 2019, 06:28:10 pm
content: It is possible to read program and or eeprom memory of a Pic mcu if it is not protected.Program memory could be protected while eeprom memory was not protected soin this case you can read just the eeprom memory.You need and programmer Pickit2 or Pickit3 will do the job,or if you have universal programmer that supports this particular mcu may do the job also.ICSP in circuit programming that is called,of course you can read from and write to the mcuwhile it is in the circuit.I do not remember clearly but i thinkit is possible to just program the eeprom memory and not touch the program memory of a pic.You need to be sure about this i will check and write again.I can clearly say that it is possible to just write to eeprom section of a pic buti am not sure about does pickit supports that or not.And you may have another problemeven if you can do the eeprom thingthere is no guarantee that the values you are searching for are at the eeprom of the pic,it is very unlikely but it is possible.

author: Chriss
author_rank: Frequent Contributor
timestamp: May 12, 2019, 06:51:04 pm
content: Thanks for the explanation. It really helped me.The complete instrument cluster is controlled through that PIC uC.No external eeprom devices fitted on. Most of time there is an external eeprom where these values are stored.Some time it is stored in the uC itself in the eeprom section.I never saw this kind of instrument cluster before, especially not one with a PIC solved.Many of them are made with some Motorola, NEC etc. cpu's and fitted with an outstanding serial eeprom.Where could be stored the km value if not in some eeprom section of the uC?It could not be stored in the program memory section because the data would be lost after a reset or power off.The eeprom memory should be the place where to store data which are needed long term.Maybe I missing something...

author: MarkF
author_rank: Super Contributor
timestamp: May 12, 2019, 07:09:54 pm
content: Whether you will be able to R/W to the PIC16F886 depends on:What is connected to the programming pins: 1=MCLR, 27=ICSPCLK, 28=ICSPDATThe "CP" fuse setting can protect the "program memory" from reading and writingThe "CPD" fuse setting can protect the EEPROM from reading and writingIf the PIC memory area you want is protected, you are out of luck.If the PIC is not protected, you might have to remove it from the PCB to read it.It is possible to read/write either memory or both memories. (Program and/or EEPROM.)

author: cv007
author_rank: Frequent Contributor
timestamp: May 12, 2019, 11:35:00 pm
content: You could remove the pic from the bad cluster, power it up to see what you have- if it acts like its working, just replace the pic on the new cluster with the old one. If it has no signs of life, then you are out of luck in any case.

author: amyk
author_rank: Super Contributor
timestamp: May 12, 2019, 11:49:26 pm
content: If it's just the odometer value you need to restore, it might be easier to hook up a circuit to pulse the inputs on the new one to increment it until you get to the right value. (The equivalent of "put the speedometer cable in a drill" in the pre-digital days.)

author: ucanel
author_rank: Regular Contributor
timestamp: May 13, 2019, 06:01:10 pm
content: Quote from: Chriss on May 12, 2019, 06:51:04 pmPic memory has 3 fundamental sections,program memoryeeprom memoryRam memoryonly ram is lost when there is no power.Also pic can runtime read write its own program memory soit is possible to store values to program memorybut it is very unlikely.

author: Chriss
author_rank: Frequent Contributor
timestamp: May 13, 2019, 09:15:21 pm
content: Quote from: amyk on May 12, 2019, 11:49:26 pmThat's not possible, because the big value difference and also because the algo which is implemented in the system.The max speed what I could input through a lets say cheating signal would be around 200km/h and then the odometer would always reset etc... but I have to change the km from 29000km to almost 69500km or so...However, thanks for the suggestion.