Flashing PIC16F1847 with gateway firmware without original programmers

This Forum is about the Opentherm gateway (OTGW) from Schelte

Moderator: hvxl

Post Reply
mike7
Member
Member
Posts: 102
Joined: Mon Dec 02, 2013 8:45 am

Flashing PIC16F1847 with gateway firmware without original programmers

Post by mike7 »

May be it will useful for someone )

I decided to switch to PIC16F1847 from the old P16F88 and ordered it from Aliexpress. Unfortunately I don't have any Microchip programmer. I found open source project on github https://github.com/jaromir-sukuba/a-p-prog.

I flashed a chip with help of chine arduino, I've got an error at the end about config verification but decided to check. After swapping chips in gateway I've got all leds turned on and nothing on serial port ....

Then I tried to repeat with diagnostic firmware and received a response on serial interface. After I just reflash with otmonitor a gateway firmware and I've got working updated gateway.
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Flashing PIC16F1847 with gateway firmware without original programmers

Post by hvxl »

Interesting. Looking at the connections used in the linked article, it seems that this method is using low-voltage programming. At least I saw is no mention of a 8.5V reference voltage that would be needed for high-voltage programming.

With a PIC16F88, low-voltage programming (LVP) rendered port RB3 unavailable for use as a regular I/O port. This meant that LED A would not work. I didn't realize that this limitation doesn't apply to a PIC16F1847.

There are other limitations when using LVP on a PIC16F1847: RA5 will always function as MCLR. But that's how the OTGW uses it anyway. Secondly, it is not possible to clear the LVP bit in the configuration word when the chip is programmed in LVP mode. This is probably why you got a config verification error. These LVP limitations should have no impact on the functioning of the OTGW. So if everything else went fine when you programmed the gateway firmware, I think it should have worked.
Schelte
mike7
Member
Member
Posts: 102
Joined: Mon Dec 02, 2013 8:45 am

Re: Flashing PIC16F1847 with gateway firmware without original programmers

Post by mike7 »

hvxl wrote: Fri Jan 27, 2023 1:29 pm Secondly, it is not possible to clear the LVP bit in the configuration word when the chip is programmed in LVP mode.
Yes, that was the only issue. But only diagnostic firmware was able to run.
It is not possible to flash regular firmware with such method directly, I've got all leds on and nothing in serial interface.

Otmonitor somehow flashed regular firmware and it was enough for me )
hvxl
Senior Member
Senior Member
Posts: 1965
Joined: Sat Jun 05, 2010 11:59 am
Contact:

Re: Flashing PIC16F1847 with gateway firmware without original programmers

Post by hvxl »

There shouldn't be any difference between programming the gateway firmware and the diagnose firmware. Except that the gateway firmware is larger, so more chance for things to go wrong. Maybe you were just unlucky with the gateway firmware. (Or did you try multiple times?) Either that, or there's a bug in the pp firmware or pp3 program. In any case, you can get around it by loading the diagnose firmware.

Thanks for sharing.
Schelte
tjfs
Starting Member
Starting Member
Posts: 25
Joined: Fri Dec 18, 2020 11:50 am

Re: Flashing PIC16F1847 with gateway firmware without original programmers

Post by tjfs »

I don't think it would be cost effective for you but Nodo Shop now sell a PIC programmer which can program 16F88 and 16F1847 (also 16LF1847 with add on LV board)

https://www.nodo-shop.nl/en/electronic- ... s-kit.html

A better option is to buy a PIC ready programmed

https://www.nodo-shop.nl/en/our-product ... -otgw.html
Post Reply

Return to “Opentherm Gateway Forum”