Thank you jaromir, thank you Buriedcode!
@jaromir: I was considering looking for other solutions and comparing the programming to mine, so that is really helpful! I will have a look later as that will take some time
Only issue will be that I only bought HVP chips I think. PIC10F206, PICLF1709-I/P, PIC24FJ64GB002-ISP, all increasing in price, and I do not really feel like exposing the more expensive ones to my programmer yet ;-) Also they are 3.3 V based and I would like to build some voltage regulator/buck converter stuff around them first, I think. [Digressing...]
I now uploaded my rough-and-ready PIC10F206 programmer code now to github:
https://github.com/MrApplejuice/arduino-pic-programmer.
Notes- Even though the intention was to make a generic programmer, the current version of the programmer is hard-coded for the PIC10F206-I/P and a certain pin-configuration on my Arduino
- Used pins are 40-43
- I use an Arduino Mega 2560 board
- I invoke my commands using the Arduino-IDE serial terminal using a text-based communication protocol specified in
arduino-pic-programmer/pic_programmer_prototype.ino- The typical sequence of commands to read out the memory of the PIC is:
prog_mode on
read
// Checking the returned configuration word, example output:
// Word ffff: 0 0 0 1 1 1 1 1 1 1 1 1 0 1 1 0
inc
read
// Checking if the first word still read all zero. Example output:
// Word 0: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
// Now the next three commands are my weird workaround
write FFF
burn
read 10
// Check if I now can indeed read the memory for the next 10 positions, Example output:
// Word 0: 0 0 0 0 1 1 0 1 0 0 1 0 0 0 0 0
// Word 1: 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0
// Word 2: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word 3: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word 4: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word 5: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word 6: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word 7: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word 8: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word 9: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word a: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word b: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word c: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word d: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word e: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
// Word f: 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0
prog_mode off
- The actual communication protocol for the PIC is implemented in
arduino-pic-programmer/programmer.cpp.
- Textual commands can be matched relatively straight-forward to the programmer-functions
- The delays I use are all defined in
programmer.cpp and I roundend them all up or bunched a few together and used the maximum required delay time
I sort-of suspected that it is too much work for a random helper in the Forum to sift through the code that I wrote. However, if you want to, I would be very grateful. However, from visual inspections of the protocol (counting flashing LED cycles) I cannot spot an issue. I will certainly continue checking on my own...
If I find a solution, I will post it here! (Perhaps I should just buy a working real programmer and see how that thing does it
)