Re: PICS as L297 replacements
Posted by
Alan Rothenbush
on 2001-04-20 21:21:57 UTC
>Have you tried the interrupt on PORTB change feature for the encoders? I'veI've been using C63 chips for a while, as I have an investment in tools
>got a commercial product out there doing just this and it is working great.
>Now, it's not running the encoders and super high speeds, but it's certainly
>working very well. I've used up to 1000 CPR encoders on the F877 at 20mhz.
for those parts and generally, the C6x chips have done well for me.
In the case of the particular project I was describing, I needed a bunch of
I/O lines, meaning I had to use the upper nibble of PortB for I/O, while
intending to use the IOC ( interrupt on change ) feature of the lower nibble.
Darned if it DIDN'T work !
Looked and looked and looked at the code, over and over again, ran fine in
the simulator, ran to all the breakpoints in the pseudo emulator, just didn't
ALWAYS Interrupt on Change .. just interrupted SOME of the time. VERY
frustrating, especially as I have written a LOT of PIC code and kinda like to
think I know what I'm doing.
So, I started to comment out bits of code here and there until .. IOC DID start
to work. Hmmm, what did I comment out last .. a routine that reads the upper
nibble of .. PortB !
Back to the datasheet, then to the errata, then to the FINE PRINT in the errata
wherein I'm told that IOC doesn't work "reliably" when interspersed with
generic reads of PortB's upper nibble.
This is a new and interesting usage of the word "reliably". I might
have said "doesn't work AT ALL" !
So much for that brainstorm. At that point, it was easier to just offload
the quadrature processing to a C508 and use Int0. Turned out to be faster,
anyway, just a bit more expensive. Annoyingly, the C508 is so cheap the
added circuit board real estate was more money than the added chip.
Funny, though, that's what the original batch of boards are doing now ..
they're acting as one channel DROs, using the IOC feature. Great minds
thinking alike ? ( Quiet, the rest of you, snickering about lesser minds
thinking alike too )
This project, BTW, was a dual purpose thingy. It took quadrature input and
displayed it on an LCD. Also, it took step and direction input and then
echoed the same signals to the actual motor controller. It also watched
the quadrature signals and if a step didn't actually cause the expected amount
of movement, additional steps were issued until it did. This was an attempt
to "linearize" a worn/junky leadscrew.
During these additional steps, the CNC controller software needed to be
paused. I didn't want to be bothered with buffering incoming steps during
the "extra step" time and then trying to replay them at just the right rate.
Doug Yeager added a "pause" feature to CNCPro when I asked him about it. I'm
probably the only person in the world who would want this particular feature,
but he added it anyway. THAT'S customer support.
It all worked fine on the bench ( or seemed to ), but before I could get it
installed on a real machine, ball screws were added to my 3in1, relieving
me of my leadscrew worries. Then EMC came out with the feedback feature, which
I liked even more than my idea, and so THAT batch of boards also changed their
mission in life. They're now dual channel tachs, with a low RPM error output,
designed to drive an E-Stop input. More darned LCDs hanging around my machine
than you can shake a stick at.
Alan
--
Alan Rothenbush | The Spartans do not ask the number of the
Academic Computing Services | enemy, only where they are.
Simon Fraser University |
Burnaby, B.C., Canada | Agix of Sparta
Discussion Thread
Alan Rothenbush
2001-04-20 21:21:57 UTC
Re: PICS as L297 replacements
ballendo@y...
2001-04-21 02:52:08 UTC
CncPRO "pause steps" function was Re: PICS as L297 replacements
Alan Rothenbush
2001-04-22 10:53:02 UTC
PICS as L297 replacements
Larry Edington
2001-04-22 22:51:06 UTC
Re: [CAD_CAM_EDM_DRO] PICS as L297 replacements