A standalone PIC programmer based on a ESP8266. Upload a hex file over wifi to program newer PICs with LVP capabilities.
To make the experience fit your profile, pick a username and tell us what interests you.
We found and based on your interests.
Well, I now reached another milestone. I added a web interface to it, so now I can remotely upload and flash the PIC chip via the ESP.
After a day worth of document reading, hacking and debugging code I can now read/set the fuse bits and also flash and dump the code memory of the PIC. This with the PIC hex code hardcoded into a string array in the esppic software.
Even if I could flash and read back the code successfully my PIC test firmware did't work - the pic looked completely dead. I spend an hour debugging the esp code and focused on the fuse/config settings, but no joy. Then I realised that my pic test code was broken. I didn't use the LAT register for toggling the port for the flashing LED. Doh! I'm really too experienced to spend that long time on a beginners mistake like that. ^__^
So now I basically just have to patch in the webserver code so code can be uploaded over wifi instead of being hardcoded. Ans also make the code support more than just the 16F1705 of course.
I put the codes up at my github - https://github.com/SmallRoomLabs/esppic
I think that the RAM in the ESP8266 will be enough to handle up to 16KW devices, for bigger devices I might have to upgrade to the ESP32.... Or maybe I can upload the hex directly to a file onto the SPIFFS file system. Then I can handle hex files bigger than what the largest PIC requires.
But for the time being I'm happy with just hardcoded support for the 8Kword 16F1705 device.
I have hooked up the ESP and the PIC with a LED on a solderless breadboard. Time to start coding - this shouldn't be too hard. The Microchip LVP protocol is rather simple and have decent docs.
Create an account to leave a comment. Already have an account? Log In.
Hello matseng,
I use PIC18LF14K50 to program to PIC16F1619 (at LVP mode), I wanna use your LVP protocol, but I don't know how to modify your code:
Store(USERID+0, SWAP16(0x8031)); delay_ms(5);
Store(USERID+1, SWAP16(0x0228)); delay_ms(5);
Store(USERID+2, SWAP16(0x8731)); delay_ms(5);
Store(USERID+3, SWAP16(0xE12F)); delay_ms(5);
Store(CONFIG1, SWAP16(0xE4C9)); delay_ms(5);
Store(CONFIG2, SWAP16(0xFBFF)); delay_ms(5);
Where can I find these values: 0x8031, 0x0228, 0x8731, 0xE12F, 0xE4C9, 0xFBFF ?
Thank you.
This is cool.
It seems you are using a ESP dev board so I suppose it work as low voltage programming?
Yes. Currently I'm using a NodeMCU board since I had one with me in the bag, but really any esp8266 with 3 available gpio should work.
And yes. This project is only targeting the modern PICs that supports the LVP Low Voltage Programming method. I really don't care about ancient devices that costs as much as the modern but are less capable. ;-)
You are right. I only use high voltage when I'm forced to use reset pin as IO.
Mmm... That extra pin can be the reason for not getting a larger and more expensive package/device. So it's good to have that option when required. That's why I also have a pickit and a icd as well - but didn't bring either of them on the trip.
Might be worth checking out:
https://hackaday.io/project/8559-microchip-pic-arduino-based-programmer
and
http://hackaday.com/2012/05/02/arduino-can-program-pic-too/
It's possible they can programmed directly onto the ESP with the Arduino IDE, with minimal changes :)
Following this one, because I was totally going to do something similar in a few weeks. I have a board coming with the UART pins between PIC and ESP coming though, so I was going to write a bootloader.
ah... I knew I should have searched more before starting this project. :-) But it's always nice to do some coding and create something new.
The project by Jaromir is as you said very similar to mine and could probably rather easily be adapted even if it is using a client/server model with software on both the PC and the arduino.
The second project is using the high voltage mode, so it might have a completely different protocol - not really sure since I haven't looked into that mode at all. I'm happy with only support for modern PICs.
But Jamoirs project will be good to glean at for pointers if I get stuck....
Become a member to follow this project and never miss any updates
Enjoyed building the project, thank you! I have a little writeup on the experience at https://cmheong.blogspot.com/2021/05/wifi-ota-for-microchip-pics-i-love.html