[Color Computer] [coco] Learning MW C
George's Coco Address
yahoo at dvdplayersonly.com
Sun Aug 13 19:26:33 EDT 2006
There are too many replies with too many variants to respond to them all.
Lots of good stuff, though.
Since I'm ignorant about C, and only intend to use it on a Coco, I suppose
MW C is good enough unless I run into problems.
I have been developing a system to machine some small parts for my steam
engine projects. I'm using stepping motors on what I call my "Tiny CNC" 3 or
4 axis machine.It uses three or four stepping motors(depending on the
application)
It uses a dremel for the cutting. The machine is built, the interface is
built and it works.
A stepping motor requires a lot of steps to make one revolution, both
positive and negative on each of the three phase coils to make it step
properly.
In B09, I can step ONE motor at about two hundred steps/sec using only
positive and negative voltages (square wave). Stepping more than one motor
takes more time and therefore, slows the process. These stepping motors step
at 1.5 degrees/step.
The stepping motors directly drive a screw that is 36 pitch. This requires
8640 steps/inch or about one inch per millennium. For the most part, when
actually cutting, the step rate is just perfect as the dremel can only cut
so fast and it works fine. However, at times (especially when moving to a
new location to start a new cut), it takes a long time to move it at this
slow
stepping rate. Should I wish to step these motors faster, I need to also use
a modified sine wave. I figure four bits per coil could do this. Of course,
this takes more time for the computer to do and speed is getting more
serious.
The reason for my desire to learn "C" is so I can build a subroutine in C
to do the stepping of the motors. This is why I want to discover a way to
use the equivalent of Peek and Poke in C.
It won't be a large subroutine by any means. My B09 subroutine is, maybe
fifty lines of code. I figure C would be a lot faster once it's compiled.
If it's fast enough, I intend to add some feedback from the steppers. The
usual way is with optics. This would require some more peeks, would slow it
down and make the process more time consuming. After that, I can begin
learning to do the math in C and therefore, start migrating from B09 to C
completely.
If I could wrap my head around assembly, I would work with that. But I've
tried ASM and keep failing. If I knew what I was doing wrong I could
probably ask a question but I don't have a clue how to work it.
I figure maybe C would be easier for me.
Can a C routine be called upon from an interrupt? That would be great, as
the optical position sensor could call on the routine. I can solder that one
up too.
It seems if it isn't B09, I'm lost
I NEED ....."AN IDIOT'S GUIDE TO 6809/OS9 ASSEMBLY( HOW TO WORK THE
THING)"
Then I could begin to learn the microprocessor.
George
Brought to you by the 6809, the 6803 and their cousins!
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ColorComputer/
<*> To unsubscribe from this group, send an email to:
ColorComputer-unsubscribe at yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
More information about the Coco
mailing list