Probabil, ca si mine, sunt utilizatori de uC PIC12Fxx (inculpatul fiind 12F629) care s-au vazut pusi in situatia de a nu mai putea rescrie sau sterge microcontrolerul atunci cand se utilizeaza clasicele programatoare JDM serial (COM/RS232).
Ce am patit mai exact? Dupa ce am incarcat .hex-ul si nu am scris valoare OSCCAL in ultima locatie de adresa am avut o mare surpriza, nu mai puteam scrie sau sterge microcontrolerul. Programul rula corect dar nu il mai puteam accesa prin ISP.
Descrierea “problemei”: la programatorul JDM pe serial tensiunea de alimentare Vdd 5V este aplicata simultan la pinul 1 cu tensiunea de programare Vpp 13,2V la pinul 4 MCLR. In acest caz (in care foloseam oscilatorul intern) uC alimentat cu 5V incepe sa isi ruleze programul astfel fiind imposibil de programat chiar daca avem 13,2V la MCLR pinul 4.
Dupa ceva documentare am aflat ca tensiunea de programare Vpp 13,2V MCLR trebuie aplicata inaintea tensiunii Vdd 5V cu aproximativ 5us.
Cum nu aveam chef de modificari la programator am cautat o solutie cat mai simpla, poate nu cea mai eficienta, dar care a dat rezultate. Am indoit pinul 1 astfel incat sa nu mai intre in soclu, cu o mana pe mouse si una pe surubelnita am reusit sa sterg microcontrolerul. Mai exact: dupa ce ii dadeam ERASE ALL, strapam pinul 1 si contactul 1 al soclului asta intr-un timp cat mai scurt posibil (setasem baza de timp a maini la 5µs 😉 )
Surpriza ! dupa 5-6 incercari nereusite, si cand aprope renuntasem, operatia de stergere a fost executata si astfel am repus programul si valoarea OSCCAL.
Ulterior am aflat despre existenta acestui programator :
The JDM (or Ludipipo) seems to be among the most popular PIC programmers used – and rightly so: it is simple, cheap and easy to build, can be run with the free and excellent IC Prog software by Bonny Gijzen, and will program pretty much any PIC microcontroller on the market. However, an issue has arisen lately with some of the new PIC’s, eg PIC12F675, 12F629, and some others with an internal oscillator. When these chips are programmed the first time, everything goes fine. However, if you later try to read or re-write to them, they read as blank and cannot be written to. The problem only occurs when the PIC has been programmed for INTOSC and MCLR_OFF, but even in this situation sometimes it will re-program OK – there seems to be some other dependence on the program which has been loaded as well.