Wednesday, August 30, 2006


Step 1: Create a flash programmer

So I got a few Z8's yesterday. First step was to create a mess of wires and plug it into the computer to see if I could get it to work. A little bit of prototyping board, a LED to actually test if it was programmed (I created a short blinking Z8 program), and whoosh.. It worked. Well, okay, this was the second attempt. In the first attempt, I had a bit of a problem getting the voltage right. These chips are 3.6V max. It took me a bit to get the voltage regulator working, and in the process, I burned out one of the LED's. It is now putting out 3.3V solid from a 10V wall wart.

I think next step is to solder a board with DIP socket (I only have a 40pin socket, but oh well, it will just use a bit more real estate), and include some pins for the debug port (Only requires an extra 10K resistor, and 4 pins to plug into the Z8 smart cable.)

After that will probably be getting comms up. Probably a ways off though.


Okay, I decided to go ahead and get the soldering iron out. You can see the result here. Yeah, I did end up using the 40PIN dip socket, it actually doesn't look too bad. On the top left side of the board in this picture, you can see the pins to which the in circuit debugger/flash programmer attaches (It's easier to see in the full picture version). I decided to not add any LED's, since I plan on actually using this board to attach to try and get my serial link up. I've still got to do a little more research. I may want to add a buffer chip between the Z8 and the host computer. The dev board uses a MAX3222 chip between the serial inputs and the UART pins on the Z8.

Here what everything looks like when the Z8 smart cable in-circuit debugger/flash loader is attached. I went ahead and loaded the LED flash program, and checked to make sure it was running with a multi-meter. Tick-tock. Tick-tock went the multi-meter indicator. It appears to work. I am a bit concerned about the voltage. The resister tolerances on my protoboard put the voltage a bit lower than the resisters I used here. I measure the voltage going into the Z8 at 3.5V; the chip has an absolute max at 3.6V. I guess it should be okay. If not, ah well. I can probably add another 10K ohm resistor to reduce it just a little more if I blow this chip.

How much did the Z8's set you back?
I bought 25 for $2.47 each from . The Z8 SmartCable is $19.95 (Not sure if this includes the compiler/dev tools though). I decided to go ahead and just buy the whole dev kit for $40, which includes little Z8 prototype board (a few LED's and switchs), and also included the smart cable. I'll probably want to get a USB smartcable eventually.

If I decide to move up, there is a 40 pin Z8 with 64K instruction space, and 4K RAM ($6.80/unit though). I don't think I need that much horsepower though. I think the 8K instruction + 1K ram should get me by for now.
Sweet! That's a good price! I'm really looking forward to hearing about your progress with that technology.
NOTE: If I were to do it again, I'd probably start with the 20PIN DIP version. It should be capable enough to run 2 or 3 motors itself, though, the 23 I/O lines with 8 configurable as ADC channels might come in handy on the 28 pin version. If I ever run out of the 28PIN Z8's, I'll probably order a batch of these to play with.
DAYUM! That's a hell of a microprocessor for $2.47~

And it comes with it's own free C compiler? Wowzie! Adrian! Take a LOOK at this bad boy! This chip is hotter than the 16F877A that I'm using at nearly on-third the price and you don't pay for development software.
Fiddling with microcontrollers is almost as much fun as playing with kittens or incontinent puppies. :-s
Wow Beagle! Nice to see someone trying a different MCU, looks really good. :) I'm just too mired in ongoing stuff to build right now, so I'm focusing on reading up on things. Ugh, that and 3D modeling...
Yeah, I only see one drawback to that Z8 you're using. It has two 16 bit timers, but if I read the data sheet correctly each one operates off of its own timer. I wish that the 877A chip had that.

The downside is that if you use both of 'em for PWM you don't have a timer left for a timed interrupt like if you wanted to, say, monitor where you were in the xy plane every 50 milliseconds.
Plaas, how are you doing things with your 877? Do you mean that it only has one timer, and both PWM outputs use it?

Me confused. ;)
16F877A has three timers a long period one and two short period ones. Both PWM channels take their rate from Timer2. You can, of course, set their duty cycles independently... least that's my current understanding of how it all works.
I'm not planning on using hardware PWM initially. If I can't get software heuristics to position the motor accurately, then things get a lot more difficult.

I think I've got my pinout architecture now. I guess I'm glad that I got the 28 pin chips; I will be using every pin to drive a 2 axis, 2 extruder head device, with a penup/pendown control line and hardware flow control serial line.

Each motor would use 1 limit detection input, 2 position sense inputs, and 2 H-Bridge outputs. The two extruder heads will share the limit detection (head out of material sensor.)

The Z-Axis controller will only need to control one motor, so it will be more simple.
Post a Comment

Links to this post:

Create a Link

<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to
Posts [Atom]