Searching \ for '[PIC] Microchip app notes quality. (Long grumble)' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Microchip app notes quality. (Long grumble)'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Microchip app notes quality. (Long grumble)'
2005\05\31@073028 by Joe McCauley

picon face
I've just spent the last couple of days wrestling with AN906 which describes
how to use a PIC16F684 as a stepper motor controller (full step, half step &
microstepping mode).

<www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824
&appnote=en012150>

I found the app note text only bore a passing resemblance to the code for
the article (both downloaded at the same time from the Microchip website).
Things described in the text such as chopper mode current limiting were not
implemented in code, resulting in large currents flowing in the windings.

The app note says "The modes of operation are off, forward, off, and
reverse".

There is no reverse mode implemented in the code, though it is of course
easy to roll your own.

Modifying the PWM lookup table as described on page 6 of the appnote to
accommodate different winding voltages does not seem to help much, I really
do have to look at this a bit closer though.

It also appears to me that, in the Mode4IncrementState routine, the wrong
PWM values were being output to the motors in microstepping mode due the
fact that the upper 8 bits of the PWM value were being anded with 0x30
instead of 0x3f before being placed in the CCPR1L register. Changing this
gave a much cleaner sine profile to the current waveform when microstepping.

Even more bizarrely, the author claims in his conclusion that "Extra I/O
pins and CPU resources are left over for implementing serial communication,
an LCD interface, or any number of I/O configurations."

The device used has 12 I/O pins, 6 of which are used to drive the motor, 4
for the current sensing circuitry & 2 for inputs (in this case a
speed/position control pot & switch)

Has anyone else had any experiences like this with Microchip app notes? I
normally don't look at them for a complete application, but this one looked
perfect for something I was doing until these problems bit me. It seems to
me that this particular application was either badly written or supplied
with the wrong version of code.

I've only mentioned the stuff I found so far in the sections of code I was
interested in. I have no idea how many other errors are in it or indeed if I
should rely on any of it.

If anyone is really interested in trying to use this app note, let me know &
I'll mail them a copy of my modified code & a full set of waveforms showing
operation in microstepping mode. (not yet willing to vouch for how correct
my version is yet though :o)

Joe


2005\05\31@125457 by James Newton, Host

face picon face
> If anyone is really interested in trying to use this app
> note, let me know & I'll mail them a copy of my modified code
> & a full set of waveforms showing operation in microstepping
> mode. (not yet willing to vouch for how correct my version is
> yet though :o)
>
> Joe
>


Please consider sharing your code at piclist.com so that anyone can access
it.

---
James Newton: PICList webmaster/Admin
spam_OUTjamesnewtonTakeThisOuTspampiclist.com  1-619-652-0593 phone
http://www.piclist.com/member/JMN-EFP-786
PIC/PICList FAQ: http://www.piclist.com



2005\05\31@133558 by phil B

picon face
I've looked at that note and came away with the
impression that it was pretty sloppy.  Microchip app
notes are great resources but frequently have
significant errors and just plain bad coding style.
There was one appnote where they must have changed the
processor late in the process because several code
sequences had incorrect banks for SFRs.  I suspect
that's what happened with the "lots of left over pins"
comment.

I also recall seeing several app note code sequences
that had the RMW problem.  Kind of bad when microchip
is propagating those kinds of errors.  It is an easy
to make, yet false, assumption that their code is
reasonably correct.  

I look at app notes as nice places to look for ideas.

I would also be interested in your changes.

--- Joe McCauley <.....joe.mccauleyKILLspamspam@spam@tcd.ie> wrote:
> I've just spent the last couple of days wrestling
> with AN906 which describes
> how to use a PIC16F684 as a stepper motor controller
> (full step, half step &
> microstepping mode).
>
>
<www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824
{Quote hidden}

> --

2005\05\31@143934 by Harold Hallikainen

face picon face
A problem with writing code then moving on is that bugs never get fixed.
In a production environment, we update code as production test and
customers find problems. I think an ap note tends to be written,
published, then never looked at again. The code pages at
http://www.piclist.org are great since users can add comments. It might be
kinda interesting to have a pic code wiki or CVS where users can
contribute code, other users can comment on it, remove bugs, make
improvements, etc.

Harold


--
FCC Rules Updated Daily at http://www.hallikainen.com

2005\05\31@151121 by PicDude

flavicon
face
On Tuesday 31 May 2005 12:35 pm, phil B scribbled:
> I've looked at that note and came away with the
> impression that it was pretty sloppy.  Microchip app
> notes are great resources but frequently have
> significant errors and just plain bad coding style.
> ...

Yes, I learned a long time ago not to trust them.  An obvious indication that
code is not tested before being printed, and as an ex-PM/Tech Writer, that
bugs me.

Cheers,
-Neil.


2005\05\31@160545 by James Newtons Massmind

face picon face
> The code
> pages at http://www.piclist.org are great since users can add
> comments. It might be kinda interesting to have a pic code
> wiki or CVS where users can contribute code, other users can
> comment on it, remove bugs, make improvements, etc.


What do you see as a difference between what piclist.org has and what a wiki
or CVS would offer in terms of what would be useful to this code sharing /
review / comment / etc... Process?

---
James Newton: PICList webmaster/Admin
jamesnewtonspamKILLspampiclist.com  1-619-652-0593 phone
http://www.piclist.com/member/JMN-EFP-786
PIC/PICList FAQ: http://www.piclist.com



2005\05\31@191632 by Bob Ammerman

picon face
In my opinion James created an 'almost wiki' quite a long time ago with his
massmind sites, including PICLIST.COM.

The only significant reason I could see to transfer over to a 'true' wiki
would be that the interface to it is more familiar (dare I say easier?) and
might result in more use of the site (both to get and provide information).

Bob Ammerman
RAm Systems

{Original Message removed}

2005\05\31@195201 by Harold Hallikainen

face picon face
I agree, piclist.org/com is the first place I go when looking for code. I
don't know how much editing James has to do, but with a wiki, editing
would be distributed. Wanna make another page on some subject? Just do it.
Gets lots of people involved in the editing process.

Harold

{Quote hidden}

> {Original Message removed}

2005\05\31@201040 by Mark Rages

face picon face
On 5/31/05, James Newtons Massmind <.....jamesnewtonKILLspamspam.....massmind.org> wrote:
> > The code
> > pages at http://www.piclist.org are great since users can add
> > comments. It might be kinda interesting to have a pic code
> > wiki or CVS where users can contribute code, other users can
> > comment on it, remove bugs, make improvements, etc.
>
>
> What do you see as a difference between what piclist.org has and what a wiki
> or CVS would offer in terms of what would be useful to this code sharing /
> review / comment / etc... Process?
>

A wiki is less structured than piclist.com.  Anyone can edit anything.

CVS is more structured, for holding code.  More suited to large
projects than example snippets of code.

Personally, I think piclist.com is about right for what it does,
although I don't like the busy user interface very much.  I think
wikis are remarkable in the power they present with a very simple
interface.  It might improve piclist.com to copy this aspecy

Regards,
Mark
markrages@gmail
--
You think that it is a secret, but it never has been one.
 - fortune cookie

2005\05\31@201429 by Mark Rages

face picon face
Sorry, my thumb hit the trackpad and sent the mail prematurely.

On 5/31/05, Mark Rages <EraseMEmarkragesspam_OUTspamTakeThisOuTgmail.com> wrote:
> Personally, I think piclist.com is about right for what it does,
> although I don't like the busy user interface very much.  I think
> wikis are remarkable in the power they present with a very simple
> interface.  It might improve piclist.com to copy this aspecy

... to copy this aspect of the Wiki.

Regards,
Mark
markrages@gmail
--
You think that it is a secret, but it never has been one.
 - fortune cookie

2005\05\31@202627 by James Newton, Host

face picon face
> I agree, piclist.org/com is the first place I go when looking
> for code. I don't know how much editing James has to do, but
> with a wiki, editing would be distributed. Wanna make another
> page on some subject? Just do it.
> Gets lots of people involved in the editing process.


Piclist.org allows you make new pages as well. The only difference is that
you must log in. This prevents just any idiot from doing it.
http://www.piclist.com/techref/idea/website/pageadd.htm

I do a lot of editing, but each page can be owned by a different editor.
There is a link a the bottom of all pages that tells who owns it or if no
one does, offers to make you the owner.

---
James.



2005\05\31@203713 by Jamie Lyon

picon face
I agree, I'm relatively new with PICs so haven't had a chance to
really use the archive yet, though I did look through it for some
samples of interrupt code, but I find the user interface rather
cluttered. The layout is fine, but it feels a bit bloated.

I'm not sure how much work a wiki would be to implement but it would
be nice if we could all contribute to write small articles, link
snippets of code (I know we can do this already, but perhaps in a more
structured way). For example the comments/question section doesn't add
too much in my opinion, allowing editing of the articles themselves so
that suggestions and code fixes etc.. can be implemented by anyone
would be ideal. If there are any questions rather than adding them to
the wiki, they could just be e-mailed directly to the author(s), or to
the piclist.

I am willing to help implement something in a few weeks if wanted, as
I'll have several months of free time before starting Uni.

-Jamie


On 01/06/05, Mark Rages <markragesspamspam_OUTgmail.com> wrote:
{Quote hidden}

> -


'[PIC] Microchip app notes quality. (Long grumble)'
2005\06\01@055127 by Dave W Turner
picon face
Every single wiki I have ever seen has been extremely useful - the
subjects seem to always end up on the same page, instead of having 10
pages about the same thing, but very slightly different.

Also, if someone does spam/corrupt/mess with any pages in the wiki, it
is extremely easy for the first user to see it to roll-back to an
earlier copy of the page.

On 6/1/05, Jamie Lyon <KILLspamaeonflameKILLspamspamgmail.com> wrote:
{Quote hidden}

2005\06\01@060745 by Nate Duehr

face
flavicon
face
Mark Rages wrote:
> On 5/31/05, James Newtons Massmind <TakeThisOuTjamesnewtonEraseMEspamspam_OUTmassmind.org> wrote:
>
>>>The code
>>>pages at http://www.piclist.org are great since users can add
>>>comments. It might be kinda interesting to have a pic code
>>>wiki or CVS where users can contribute code, other users can
>>>comment on it, remove bugs, make improvements, etc.
>>
>>
>>What do you see as a difference between what piclist.org has and what a wiki
>>or CVS would offer in terms of what would be useful to this code sharing /
>>review / comment / etc... Process?
>>
>
>
> A wiki is less structured than piclist.com.  Anyone can edit anything.

Open wiki's are already going the way of the dodo bird.  James'
PicList.com setup where users have to be logged in is becoming much more
common, with wiki-spam on the rise.

My similar-to-a-wiki blogging software I run has to have posting
moderation turned on and an automated spam filter set up to skim through
every ten posts and remove any with certain keywords or from certain
IP's, all downloaded from central servers updated by hundreds of people
running the software to keep up with just allowing anonymous comments to
non-anonymous posts.  If it weren't for the automation I'd have shut it
down long ago.

Open wikis without moderators are going to die the slow painful death
most of our Inboxes have over the last few years.  (Ask your mail admin
how many messages a day they throw out for you without you even knowing
about it nowadays... my domain for just personal stuff is currently
generating about 1500 spam messages a week... and at work... well, let's
just say they're paying a commercial filtering company and they're not
keeping up.)

James is ahead of his time!  (GRIN)  Or just smarter than the average
college student coding up wiki/blog-du-jour software who hasn't figured
out that in the real world, idiots do things like spam in 100 messages
into the wiki at a time that say vulgar and/or stupid things and/or
advertise something utterly useless.

Nate

2005\06\01@072354 by Joe McCauley

picon face
This is not simply a case of a bug that did not get fixed. It is also a case
of code which did not fulfill the specification doc (the app note). Bugs I
could accept, after who has not left more than one in 'finished code'.
(though the apparent bug in this case means that the system could not
operate as specified)

The fact that this is published by the manufacturers of the devices makes
it, to me at least, even more annoying & leaves me skeptical of any other
app notes. As someone else said they are great sources of ideas, but having
seen this particular app note, I wonder how many of these ideas will work
without significant rework.....

Anyhow when I get a couple of more things sorted with this one, I'll put it
up for others to use.

Joe

{Original Message removed}

2005\06\13@224933 by Patrick J

flavicon
face
I have also just spent a few days (still spending actually) on an appnote.
How about if we all could post BUGFIXED source in an Appnote-page
say for instance http://www.piclist.com/mc-appnotes on http://www.piclist.com ?

Joe, feel free to be the first one to post that fixed AN on piclist.com! :-)
A few notes in the beginning of the fixed AN that explanins that was fixed
by who and why is good.


{Original Message removed}

2005\06\13@230350 by Mark Rages

face picon face
When you fix an app note, also send the fixed copy to
RemoveMEdocerrorsspamTakeThisOuTmicrochip.com.   Help them fix the documentation.

Regards,
Mark
markrages@gmail
--
You think that it is a secret, but it never has been one.
 - fortune cookie

More... (looser matching)
- Last day of these posts
- In 2005 , 2006 only
- Today
- New search...