Sunday, November 12, 2006
- failure to let the external 20 MHz clock crystal that I used with the 16F877A warm up adequately before beginning to try to use the microcontroller
- leaving a few ill-advised pins on PortB open for input that I shouldn't have
That done, I went back to integrating the Hamamatsu limits detector into the control programme. That was a little trickier than I first thought it would be. Once the pseudo stepper blunders into the limits zone and realises that it's there you have to programme a delay into it so that you don't get another interrupt the moment it leaves the limits zone.
For now I define the acceptable area for the positioning stage to operate in with a strip of white electrical tape.
One thing that has come obvious with the Hamamatsu chip is that it is very sensitive to IR radiation. I found that I could cause it to decide that it had hit a limit by taking a photo of it in operation with the flash option enabled. As well, having my work lamp on bright and aimed at that area of Tommelise caused false limits detections, too. I expect that I will have to put some sort of shading skirt around the detector to keep stray light out of it. There is enough 0.9 micron IR in ordinary light sources to trigger it without a lot of trouble. I recall that this was a problem when I developed the test board some months ago.
As for that crystal warm up issue, did not know that. Everything has it's quirk, doesn't it!
That's easy. The PIC chip generates an interrupt any time a pin input changes state. That means that if the pin is reading 0v and goes to 5v you get an interrupt. Similarly if the pin is reading 5v and goes back to 0v you get another interrupt. It's no big deal. You just have to allow for it in the firmware programming.
This all what they call "know how". Heretofore I'd been working with 16F628A chips that can take an external crystal but have an internal one rated at 4 MHz. The 16F877A has no internal crystal so being the sort of guy I am I got the fastest one that it could take, viz, a 20 MHz crystal. Turns out that the crystal I am using takes a few moments to warm up and stabilize. You just put it in a WaitMS state for a while till that happens and then you're good to go.
BTW, I'm using bits of RepRapish tech on my mining cart. I sliced up plastic cutting boards and am using them as bushings. Just a prototype.
BTW2 Sebastian pointed out Lee Valley as a source, they sell packages of multipurpose plastic under "3 lb Assortment of UHMW Pieces". Might be of use for RepRappers who want dimentionally stable parts that slide well.
Boy, I have to learn to stick to the topic at hand. :)
Links to this post: