View Full Version : controlling a UCN 5804B Chip with a BS2

02-07-2005, 12:41 PM
I am successfully(and happily I might add)·running a stepper motor using the UCN 5804B·stepper driver chip via the debug screen using the bs2.· I am able to prompt the user for steps for motor rotation using Debugin.· Direction control is easy as long as you include the neccessary high or low signal depending on the direction you want. But only if including the high or low direction signals in the code blocks prior to running the program.

· I am going to guess that phase control, meaning full step, half step, are as easy as direction.· But what I want to do is use·Debugin to prompt the user outside the program at the debug screen for phase state·prior to running the program·. Phase is controlled by pins 9 and 10 on the 5804.· A high signal on both = step inhibit, and low, high = half-step, and high, low = one-phase, and low, low on pins 9 and 10 respectively = two-phase (which is my current configuration). Could direction also be a debugin command?

I am not running out of bs2 pins as of yet, but is the solution·for this problem·tied to·using some sort of logic
chip? If so what chip should I use? Do I still get to use my debug screen?

And one last thing......I am really having alot of fun!!!!!

Jon Williams
02-08-2005, 02:38 AM
My favorite output expander is the 74HC595 -- you use three pins and get eight in return. And if you want to daisy-chain, you can get eight more ... and eight more ... still using just three BASIC Stamp pins. We have lots of code for the 74HC595; see SHIFTOUT in the help file.

On your other question, perhaps you should develop some sort of command language that you can enter at the prompt; let the BS2 interpret that and handle the IO states and step timing. Should be pretty easy. Remember, DEBUGIN works like SERIN, and you can have multiple variables in your DEBUGIN statement.

Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA