CAD CAM EDM DRO - Yahoo Group Archive

Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s

Posted by paul@a...
on 2001-04-21 07:23:34 UTC
>
> A number of people say they have gone through the torment of programming
> PICs to drive steppers etc., so how about someone sharing their knowledge?
> This is, after all, the purpose of this list and I'm sure there are others
> who, like me, would love to try out a PIC circuit but don't have the time
> (or, in my case, intelligence) to learn the necessary skills to program the
> PIC but who could, nevertheless, build a simple programmer and the rest of
> the driver circuitry if the PIC code were available. I'm not suggesting that
> anyone particularly divulges any 'trade secrets' - there are probably dozens
> of ways the same effect can be achieved, but, in any case, even the trade
> guys may learn how to do 'better, cheaper, faster' from such shared
> knowledge which would be to the advantage of us all.
>
> Ian

There aren't any "trade secrets", really. You can buy a programmer kit
that plugs into the parallel port from a PC from any number of sources
for $15-25. The software tools for basic work are available free from
the PIC website (the assember and simulator) The PIC website has a bunch
of free app notes for download. Their website is http://www.microchip.com

The PIC16F84 flash programmable is one of the most popular types for
hobbiests - they're electrically erasable and you can keep reprogramming
the same part until you get it right. The others types have more or
less built in capability and are either one time programmable or eprom
based. To reuse the latter type you need a UV eprom eraser and a more
involved programmer (i.e. more $$$). You can't reuse the OT parts,
they're more for the production end once you've gotten the design
work finished and working.

A number of books are available on building PIC based projects. You can
also do a Web search and get all kinds of FAQs, projects, etc.

The instruction set is pretty simple and for the 16F series, there are
only 35 different instructions, room for 1000 instructions (more or
less) and a few bytes of RAM (also known as registers). The
architecture is a bit wierd and requires some gyrations to do things.
You have to pay attention to code pages, table lengths etc.

If you've written code at the assembly level before it's not too bad.
If you haven't, you're in for a real headache. Some electronics
experience wouldn't hurt either.

It's not that it's particularly hard, but there are two things going
on: building something becomes an exercise in software development
at the assembly level and it's an embedded controller environment.

The problem with an embedded controller environment is it becomes
difficult to determine what isn't working (is it the software, the
hardware, or some combination?). The simulation tools help that
before making real hardware, but it can be extremely difficult to
figure out what's going on when that little chip just sits there
doing (apparently) nothing. Since you're also typically dealing
with a real time environment on the chip and maybe also using
the interrupt structure, it's very easy to make mistakes - some
of which won't be visible until some wierd set of circumstances
show up (and may even destroy your hardware - nothing like a
runaway motor drive to spice up the day)

These are the skills you need to successfully apply PICs:
1) Basic electronics design and implementation skills
2) Software design
3) Assembly level coding
4) Embedded controllers
5) Software (and hardware) debugging

The only way to get those is to suffer through the learning curves, there
are no secret short cuts. You probably would not want to do a microstepping
driver on a PIC as your first project, for example. Just getting
an LED to blink on and off at 1 second intervals would be challenging
enough. Implementing a PID servo algorithm in a PIC is a nontrivial
task.

You can avoid some of the pain by using higher level tools (the Basic
stamp, for instance is a PIC based controller that uses a form of Basic
as the software language, which is much easier to work with), but
that doesn't work when you're trying to push the limits on what
the chip can do.

OTOH, just building a PIC project isn't bad. This is what you
do:
1) Build the hardware
2) Download the program and assemble it using MPASM if they give you source
3) Burn it into the PIC using the programer you bought for $25.
4) Plug in the PIC and use the project

The real headache will start when you want to make it do something different.
With microcontrollers, almost all of the functionality is in the programming,
the hardware is just the base to support it.

Paul

> --
> Ian W. Wright
> Sheffield UK
> www.iw63.freeserve.co.uk
> ----- Original Message >
> >
> > But actually having done it, actually having programmed a PIC as a
> > replacement for a 297 to drive an L298 ( and others ), I can state with
> > some high level of assurance that it is a non-trivial task should high
> > step rates be required.


--
Paul Amaranth | Rochester MI, USA
Aurora Group, Inc. | Systems & Software
paul@... | Unix / Windows / NT

Discussion Thread

beer@s... 2001-04-20 12:01:01 UTC Re: PICs as replacements for L297s Alan Marconett KM6VV 2001-04-20 17:16:33 UTC Re: PICs as replacements for L297s Larry Edington 2001-04-20 18:09:14 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Larry Edington 2001-04-20 18:29:06 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Ian Wright 2001-04-21 01:11:50 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s paul@a... 2001-04-21 07:23:34 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Larry Edington 2001-04-21 11:05:43 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Kerry 2001-04-21 17:07:33 UTC Re: PICs as replacements for L297s Larry Edington 2001-04-21 17:39:19 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s ballendo@y... 2001-04-21 23:19:09 UTC Re: PICs as replacements for L297s paul@r... 2001-04-22 03:04:43 UTC Re: PICs as replacements for L297s Ian Wright 2001-04-22 04:04:35 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Carol & Jerry Jankura 2001-04-22 05:16:58 UTC RE: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Flosi Gudmundsson 2001-04-22 06:36:12 UTC Re: PICs as replacements for L297s Tom Eldredge 2001-04-22 08:58:45 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Tom Eldredge 2001-04-22 08:58:46 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Kerry 2001-04-22 09:29:05 UTC Re: PICs as replacements for L297s Tim Goldstein 2001-04-22 09:35:07 UTC RE: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Kerry 2001-04-22 10:08:04 UTC Re: PICs as replacements for L297s Tim Goldstein 2001-04-22 10:46:10 UTC RE: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Kerry 2001-04-22 11:36:23 UTC Re: PICs as replacements for L297s Smoke 2001-04-22 18:56:07 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Alan Marconett KM6VV 2001-04-22 21:03:39 UTC Re: PICs as replacements for L297s Larry Edington 2001-04-22 22:01:57 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Larry Edington 2001-04-22 22:03:06 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Larry Edington 2001-04-22 22:31:40 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Larry Edington 2001-04-22 22:40:14 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Alan Marconett KM6VV 2001-04-22 22:51:21 UTC Re: PICs as replacements for L297s paul@r... 2001-04-23 03:12:55 UTC Re: PICs as replacements for L297s Tom Eldredge 2001-04-23 18:46:18 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s chapmani@m... 2001-05-08 04:36:12 UTC PICs as replacements for L297s Dan Mauch 2001-05-08 08:36:20 UTC Re: [CAD_CAM_EDM_DRO] PICs as replacements for L297s Larry Edington 2001-05-08 09:14:35 UTC Re: [CAD_CAM_EDM_DRO] PICs as replacements for L297s Tony Jeffree 2001-05-08 12:19:43 UTC Re: PICs as replacements for L297s Eric Keller 2001-05-08 13:10:20 UTC RE: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Carol & Jerry Jankura 2001-05-08 17:45:10 UTC RE: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s Larry Edington 2001-05-08 18:17:30 UTC Re: [CAD_CAM_EDM_DRO] Re: PICs as replacements for L297s