About this Blog

This blog is an engineering log book; for me to record the progress on my many projects and hopefully to inspire you.

Some projects do not get off the ground, they remain as interesting thoughts, a select few get some work done on them, even fewer get close to completion, and none get completed because unfortunately I subscribe to the theory: "If something ain't broke then it doesn't have enough features". If you'd like to collaborate on some work to get something to a useable state then send me some communications.

Being a blog, posts are listed in chronological order. However I usually have multiple projects on the go and will try to post some of my earlier work. With this in mind I'll try to add labels to each post so all posts relevant to one project can be easily extracted.

Enjoy and happy hacking.

Friday, August 29, 2008

Programming Successfull!

So I spent a morning trying to get the programmer to connect to the PIC and remove the code protection.
After trying a few different default devices, the programmer (MPLAB ICD 2) successfully read the device identifier word. The PIC is a 12F675, datasheet and info. So now it knows what it is dealing with.

The remainder of the time was spent trying to get the damned programmer to erase the chip. An erasure would apparently work but a blank-check failed. So how about changing the configuration word (which has bits for code protection), can't do that either. So after much googling I found the problem, detailed here and here. In short, I think that the program already on the PIC was beginning to execute and messing with the programmer clock input. The output drivers of the ICD2 programmer arn't strong enough to over power the PIC and get it to program. So you have to get it into programming mode before it starts up and set pin 6 to an output. I achieved this by powering the PIC from the programmer (at 5V) instead of externally powered though the 3.3V regulator. Another option would be to disconnect the external oscillator, thus preventing the program from running.

So after that I managed to successfully erase the PIC. Yay! And I can reprogram the configuration byte. Note: I got a warning that the ICD2 programmer doesn't support programming with an internal oscillator and the MCLR pin set to a digital input. Probably to avoid the same situation as above.

No comments: