Sunday, March 12, 2006

First Microchip PIC16F628 programmed...

This ought to keep everyone laughing at my expense for a week. Have fun and welcome to it! :-D

I built the JDM PIC chip programming board more than a month ago, but just got around to trying to program a 16F628 chip on it this weekend. This is an important thing to be able to do because the 16F628 is the core of all the controller boards for the Godzilla prototyping machine. Simon, Vik and Adrian have been moving towards a final design for all the boards for the past month and it is looking like I'll be able to start building them in a week or two.

Anyway, the first bit of drama was finding the proper software to drive the board and program the 16F628's. As usual it was right in front of my nose and Simon kindly showed me the link. He then told me the settings to use to get it to work.

I plugged the board into my PC, fired up IC-Prog and had a go... nothing. For the next several hours I played chimpanzee on a keyboard trying things to see if I could get it rolling... nothing.

Simon began to suspect that my ancient skills with soldering iron and PC board had maybe slipped a bit. Given that it had been 25 years since I'd last personally built one it sounded reasonable but annoying all the same. I considered just buying a premade, cheap programmer board.

Simon finally ran me through the troubleshooting protocol on the wiki site. The voltage numbers that I got made absolutely no sense whatsoever. I was going blind with fatigue when I finally crawled under my desk and had another look at the back of my PC. 25 pin cannon female connector for Com1, 9 pin cannon male connector for Com2... I'd rigged mine to use the 25 pin connector, just like the old days.

Wait a minute. Where was the printer connector? In the old days we used a Centronics connector, but those had fallen by the wayside some years back and NOW we used a... 25 pin cannon connector... female. It was still confusing because when I checked mode I had 2 serial ports. If that 25 pin cannon female connector was a printer cable where the hell was the other serial coms port? I've been using USB ports for peripherals for some years now so this was all remembering how to read ancient Egyptian for me.

I finally decided that I didn't know where the other coms port was but that the one I had had to be a 9 pin male cannon connector. This morning I went down to Radio Shack and bought a 9 pin female connector. I hooked it up ran IC-prog with the settings Simon talked about yesterday.

It wrote to the 16F628 and verified perfectly the first time out. I read it back into buffer 2 and compared buffer 1 and buffer 2 and it gave me a thumbs up.

Anyway, have a laugh. I deserve it. :-p

2 comments:

Anonymous said...

Just read through all of your stuff about extruding. This is what I thought I would be interested in starting, but I see you have vast experience. Just wondering if you ever progressed any further. Any final findings or future plans? Oh, and I understand your pain about not being able to get things right the first time or three. I can't figure out how to post to reprappers, Adrian said that only the developers could post to reprap and pointed me to reprappers. But I can't for the life of me figure out how to do it. Buzz seemed to be able to figure it out.

plaasjaapie said...

bart: You just have to ask Adrian if you can join the RepRap builders blog. He's been pretty good about letting just about anybody interested getting posting rights there. He's a little more finicky about the membership of the RepRap blog which has come to be intended for what are ideologically pure RepRap Developers defined as, into Linux, SDCC compiling for PIC firmware, stepper motors, metric standards and a few other shibboleths.

The RepRappers was pretty much set up for me when it became impossible to ignore that I was not only talking heresy but living it as well. After some bad experiences with the doctrinally pure developers' route I opted for Windows, Visual Studio .NET, Oshonsoft PIC IDE BASIC for firmware and a vary catholic view about American vs metric measurements. :-D

RepRappers began as sort of a way of keeping me in RepRap without having me confusing matters in what Adrian considers the main thrust of the RepRap work. When I do some work that meets RepRap standards I publish there, otherwise I publish in RepRappers. IMO, the most interesting things happen in RepRappers. :-D

RepRappers since then has become loosely defined as where people who want to build a RepRap or something like a RepRap hang out. I suspect that that is where you want and ought to be.

If he acts flaky, though and doesn't want to let you into RepRappers (not that I think that that is likely) let me know and I'll make a place for you over at www.3DReplicators.com, a website I started for my Tommelise project last month. You can write me directly at.

fshiggs@3DReplicators.com

Keep well.