Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsElectronicsBasicsRepairDesignCADComponentsEquipmentElectrical Engineering
ElectronicsKB.com
Contact UsLink To UsSearch & Site Map

Electronics Forum / Basics / October 2007



Tip: Looking for answers? Try searching our database.

PIC Assembler.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ian field - 22 Oct 2007 16:05 GMT
Does anyone have a link to any tutorials for PIC assembly?

Over the past few months I've been trying many permutations of Google search
string, but most of the tutorials I've found assume previous experience at
writing assy for microprocessors.

Another problem is most of what I've found is HTML which is untidy to save
for later study and many pages lose their image files after being saved to
disk (anyone know why that happens?). Any help appreciated.

TIA.
spamfree@spam.heaven - 22 Oct 2007 16:03 GMT
>Another problem is most of what I've found is HTML which is untidy to save
>for later study and many pages lose their image files after being saved to
>disk (anyone know why that happens?). Any help appreciated.

I have found that the best way to save HTML off the web is to copy and
paste into a blank email message in Outlook Express, with Rich Text
(HTML) selected in the format menu.
It ain't perfect, but much easier to edit and print in my experience.
jack
Anthony Fremont - 22 Oct 2007 16:24 GMT
> Does anyone have a link to any tutorials for PIC assembly?

No, but I know of a couple of good books by John Peatman, but they aren't
exactly "beginner" books.  Which particular PIC "line" were you looking at?
Allot of the old stuff on the net are based upon 16f84 (or lesser) PICs.
Those parts are basically obsolete and the modern day equiv would be a
16F88.

Since you are starting out fresh, I suggest you look at the 18F type PIC
chips.  They are far more capable and easier for a beginner IMO.
www.picbook.com is a site worth looking at.  Digikey has a part number for a
complete set of parts to populate the circuit board that is included with
the book.

> Over the past few months I've been trying many permutations of Google
> search string, but most of the tutorials I've found assume previous
> experience at writing assy for microprocessors.

I learned from looking at other code and using Peatman's first book, but I
had quite a bit of past experience with programming in assembler.  I could
give you some sample code that I've written if you want.

> Another problem is most of what I've found is HTML which is untidy to
> save for later study and many pages lose their image files after
> being saved to disk (anyone know why that happens?). Any help
> appreciated.
ian field - 22 Oct 2007 16:53 GMT
>> Does anyone have a link to any tutorials for PIC assembly?
>
[quoted text clipped - 3 lines]
> PICs. Those parts are basically obsolete and the modern day equiv would be
> a 16F88.

The book I've already bought (PIC in Practice) is based mainly on the F84,
at Maplin this is about twice the price of newer more capable PICs possibly
indicating that Microchip want to discourage future sales, the Velleman
K8048 kit I bought came with a 'free' F627, this and the F628 seem to be
matching the F84's former popularity for projects & articles to be found on
the net

> Since you are starting out fresh, I suggest you look at the 18F type PIC
> chips.  They are far more capable and easier for a beginner IMO.
> www.picbook.com is a site worth looking at.  Digikey has a part number for
> a complete set of parts to populate the circuit board that is included
> with the book.

What makes the 18F parts easier than the 16F parts? I must admit not having
paid much attention to the 18F parts - I think the Velleman programmer has
limited 18F support compared to 16F parts, they might even be only supported
via ICSP and also restricted by what is supported by the burner application.
Fortunately the programmer is remarkably similar to the David Tait & Serpic1
designs, so I may be able to search for programmer software with more
devices supported.

>> Over the past few months I've been trying many permutations of Google
>> search string, but most of the tutorials I've found assume previous
[quoted text clipped - 3 lines]
> had quite a bit of past experience with programming in assembler.  I could
> give you some sample code that I've written if you want.

Does the Peatman book have an ISBN number? Most bookshops around here are
reluctant to make much effort finding books without an ISBN and if its a US
book we in the UK tend to get charged as many £ as the price in $ regardless
of exchange rate - so I'm already baulking at the price before I've even
seen it!

>> Another problem is most of what I've found is HTML which is untidy to
>> save for later study and many pages lose their image files after
>> being saved to disk (anyone know why that happens?). Any help
>> appreciated.
Anthony Fremont - 22 Oct 2007 18:28 GMT
>>> Does anyone have a link to any tutorials for PIC assembly?
>>
[quoted text clipped - 10 lines]
> and the F628 seem to be matching the F84's former popularity for
> projects & articles to be found on the net

It usually depends upon the date of the project.  Currently, the 16F88 is
the best of the bunch.  They are all pretty much pin compatible, just more
features in the newer parts.  The 88 has a nice internal oscillator block
that is precise enough (1%) to do serial comms without a crystal.  Most code
is easily ported, just changes in the _CONFIG word values and having to add
an instruction or two during the program's initialization to disable the
analog features of some of the i/o pins.

>> Since you are starting out fresh, I suggest you look at the 18F type
>> PIC chips.  They are far more capable and easier for a beginner IMO.
[quoted text clipped - 4 lines]
> What makes the 18F parts easier than the 16F parts? I must admit not
> having paid much attention to the 18F parts - I think the Velleman

The short answer is banking.  The chip still uses banking, it's just that it
powers on in such a state that all the SFRs are accessible without having to
manipulate banking control bits.  Just makes life a little easier on a
beginner.

> programmer has limited 18F support compared to 16F parts, they might
> even be only supported via ICSP and also restricted by what is
> supported by the burner application. Fortunately the programmer is
> remarkably similar to the David Tait & Serpic1 designs, so I may be
> able to search for programmer software with more devices supported.

If you can spare the money, buy a programmer, don't try to build one of the
el-cheapo designs on the net.  Most of the "no parts" type programmers
depend upon conditions that most modern PCs don't operate under.  Trust me
you will have enough issues to sort out without having to wonder if your
programmer is working.  I use one from www.melabs.com.  It wasn't exactly
cheap, but it's fast, powered by USB cable and will program almost anything.

You may wish to consider a pre-made dev board from somewhere like
www.olimex.com.  Some boards will make use a bootloader so that you don't
need a programmer at all, just a serial connection to the board.

>>> Over the past few months I've been trying many permutations of
>>> Google search string, but most of the tutorials I've found assume
[quoted text clipped - 10 lines]
> price in $ regardless of exchange rate - so I'm already baulking at
> the price before I've even seen it!

ISBN: 0-13-046213-6 is the number for the book at www.picbook.com.  Like
usual, the 18F452 has been superceded by newer parts with less errata.  The
older book is ISBN: 0-13-759259-0 and the title is "Design with PIC
Microcontrollers".  To give you an idea of it's age, it talks allot about
the 16C74 which was pre 16F84.  I'd recommend the newer one.

>>> Another problem is most of what I've found is HTML which is untidy
>>> to save for later study and many pages lose their image files after
>>> being saved to disk (anyone know why that happens?). Any help
>>> appreciated.
ian field - 22 Oct 2007 19:53 GMT
>>>> Does anyone have a link to any tutorials for PIC assembly?
>>>
[quoted text clipped - 32 lines]
> having to manipulate banking control bits.  Just makes life a little
> easier on a beginner.

Thanks - that certainly sounds like it might be easier, maybe I could look
into 18F parts and leave bank manipulation until I've learned a bit more
about learning assy'.

>> programmer has limited 18F support compared to 16F parts, they might
>> even be only supported via ICSP and also restricted by what is
[quoted text clipped - 9 lines]
> cheap, but it's fast, powered by USB cable and will program almost
> anything.

Unfortunately I'm not wealthy so I'll just have to make the best of what I
can afford. The velleman is supposedly a proven reliable design although a
bit dated by now, since that's what I've got that's what I'll have to put up
with for now.

> You may wish to consider a pre-made dev board from somewhere like
> www.olimex.com.  Some boards will make use a bootloader so that you don't
[quoted text clipped - 20 lines]
> Microcontrollers".  To give you an idea of it's age, it talks allot about
> the 16C74 which was pre 16F84.  I'd recommend the newer one.

Thanks, I'll phone the book shop tommorrow - is Peatman the author or the
publisher?

>>>> Another problem is most of what I've found is HTML which is untidy
>>>> to save for later study and many pages lose their image files after
>>>> being saved to disk (anyone know why that happens?). Any help
>>>> appreciated.
Anthony Fremont - 23 Oct 2007 00:31 GMT
>>> What makes the 18F parts easier than the 16F parts? I must admit not
>>> having paid much attention to the 18F parts - I think the Velleman
[quoted text clipped - 7 lines]
> look into 18F parts and leave bank manipulation until I've learned a
> bit more about learning assy'.

www.picbook.com  That book covers the 18F452, but it is not a beginner's
guide.  It's a college level text book with nice real-world examples.

>>> programmer has limited 18F support compared to 16F parts, they might
>>> even be only supported via ICSP and also restricted by what is
[quoted text clipped - 14 lines]
> design although a bit dated by now, since that's what I've got that's
> what I'll have to put up with for now.

It'll probably work fine.  I believe I built a Velleman kit for Atmel parts.

>> You may wish to consider a pre-made dev board from somewhere like
>> www.olimex.com.  Some boards will make use a bootloader so that you
[quoted text clipped - 24 lines]
> Thanks, I'll phone the book shop tommorrow - is Peatman the author or
> the publisher?

The author.  Take a good look at the web site.  You can download sections of
the book and check it out now.
ian field - 23 Oct 2007 15:13 GMT
>>>> What makes the 18F parts easier than the 16F parts? I must admit not
>>>> having paid much attention to the 18F parts - I think the Velleman
[quoted text clipped - 64 lines]
> The author.  Take a good look at the web site.  You can download sections
> of the book and check it out now.

The book is £45 and the Velleman K8048 doesn't support 18F parts at all as
far as I can see, so it looks as if the fruits of the 18F parts may elude me
for the time being. OTOH - EPE magazine has switched it's Teach In series
from general electronics to a PIC tutorial, this is usually about secondary
school level so I never bothered reading it before but now its all PIC it
might be just what I'm looking for.
steamer - 22 Oct 2007 16:47 GMT
    --FWIW if you're a complete novice I recommend the Basic Stamp and
the tutorials at parallax.com I built my first robot with their stuff; great
fun! I'm still using the Stamp for various projects. I'm told that the
Propeller chip offers many more features and a friend is using one to build
me a cnc controller for a machine tool but the 'basic' Stamp (actually the
current iteration is the BS II) is still a great place to start. The book
that comes with it is worth its weight in gold: a very good introduction.

Signature

       "Steamboat Ed" Haas         :  Whatever happened            
       Hacking the Trailing Edge!  :  to Andy Philbrick?
                         www.nmpproducts.com
                  ---Decks a-wash in a sea of words---

Eeyore - 22 Oct 2007 18:29 GMT
> Does anyone have a link to any tutorials for PIC assembly?
>
> Over the past few months I've been trying many permutations of Google search
> string, but most of the tutorials I've found assume previous experience at
> writing assy for microprocessors.

Why would you want to use assembly language ?

IIRC, there's a neat free high level language for PICs but since I don't use
PICs, I never bookmarked it.

Graham
Anthony Fremont - 22 Oct 2007 18:41 GMT
>> Does anyone have a link to any tutorials for PIC assembly?
>>
[quoted text clipped - 3 lines]
>
> Why would you want to use assembly language ?

Hopefully because it's the right way to learn how to program AFAIC.

> IIRC, there's a neat free high level language for PICs but since I
> don't use PICs, I never bookmarked it.

You must be referring to the PIC-AXE thingys that are programmed at a fairly
high level by the user.
Eeyore - 22 Oct 2007 19:21 GMT
> >> Does anyone have a link to any tutorials for PIC assembly?
> >>
[quoted text clipped - 5 lines]
>
> Hopefully because it's the right way to learn how to program AFAIC.

All of the worst code I've ever seen was written in assembler by people who
'thought' they knew what they were doing.

Assembly language makes NO sense whatever to my mind in the modern world. Sure,
it's cheap since it avoids the need for a usually paid for compiler and that's
your lot.

> > IIRC, there's a neat free high level language for PICs but since I
> > don't use PICs, I never bookmarked it.
>
> You must be referring to the PIC-AXE thingys that are programmed at a fairly
> high level by the user.

Not sure. I think there's some 'PIC BASIC' out there too.

Graham
ian field - 22 Oct 2007 19:58 GMT
>> >> Does anyone have a link to any tutorials for PIC assembly?
>> >>
[quoted text clipped - 15 lines]
> that's
> your lot.

Its better than raw binary.
Eeyore - 22 Oct 2007 20:15 GMT
> > Assembly language makes NO sense whatever to my mind in the modern world.
> > Sure, it's cheap since it avoids the need for a usually paid for compiler
> and
> > that's your lot.
>
> Its better than raw binary.

That much is true. Seriously, the need to use assembler vanished about 30+ years
ago.

Graham
Anthony Fremont - 23 Oct 2007 00:24 GMT
> Seriously, the need to use assembler vanished
> about 30+ years ago.

What an absurd statement.
Eeyore - 23 Oct 2007 15:08 GMT
> > Seriously, the need to use assembler vanished
> > about 30+ years ago.
>
> What an absurd statement.

Why would you NEED to use assembler do please tell.

Graham
Tom2000 - 23 Oct 2007 16:27 GMT
>> > Seriously, the need to use assembler vanished
>> > about 30+ years ago.
[quoted text clipped - 4 lines]
>
>Graham

12F683
Anthony Fremont - 23 Oct 2007 18:23 GMT
>>>> Seriously, the need to use assembler vanished
>>>> about 30+ years ago.
[quoted text clipped - 6 lines]
>>
> 12F683

Funny that you should mention that particular part.  It's a much more
capable processor than it's name would have people believe.  Even though
it's a 12F label, it's still a 14-bit core (like the 16F series parts)
making it the king of the 8 pin parts.  Now something like a 10C with a
two-level stack..........
Eeyore - 24 Oct 2007 11:45 GMT
> >> > Seriously, the need to use assembler vanished
> >> > about 30+ years ago.
[quoted text clipped - 4 lines]
>
> 12F683

Would you care to elaborate ?

Graham
John Fields - 22 Oct 2007 23:06 GMT
>> >> Does anyone have a link to any tutorials for PIC assembly?
>> >>
[quoted text clipped - 8 lines]
>All of the worst code I've ever seen was written in assembler by people who
>'thought' they knew what they were doing.

---
A poor workman blames his tools, and in this case (since, by your
own admission you're unfamiliar with the tools) you blame the poor
work on the tools instead of the workmen.
---

>Assembly language makes NO sense whatever to my mind in the modern world.

---
Many things which make no sense to you, however, make a great deal
of sense to others more qualified to make the call.
---

>Sure, it's cheap since it avoids the need for a usually paid for compiler and that's
>your lot.

---
The avoidance of the cost of a compiler can be of small consequence
when considering the expense of writing and maintaining the code,
but often can be well worth it in terms of performance that can be
realized through the use of assembler.

Signature

JF

Anthony Fremont - 23 Oct 2007 00:21 GMT
>>> Why would you want to use assembly language ?
>>
>> Hopefully because it's the right way to learn how to program AFAIC.
>
> All of the worst code I've ever seen was written in assembler by
> people who 'thought' they knew what they were doing.

ISTR that you're some kind of 8052 genius.  Let's see some of your code.

> Assembly language makes NO sense whatever to my mind in the modern
> world. Sure, it's cheap since it avoids the need for a usually paid
> for compiler and that's your lot.

Of all the reasons I can think of to use assembler, that one is near the
bottom of the list.  One closer to the top of the list would be to gain a
real understanding of what's going on in the hardware.  There's nothing like
coding an interrupt handler in assembler to get an idea of what's required
to be done by an ISR.  I've had to work with way to many programmers who
didn't have the faintest idea of what takes place at low levels.  Talk to a
JAVA evangelist to see what I mean.  :-/

>>> IIRC, there's a neat free high level language for PICs but since I
>>> don't use PICs, I never bookmarked it.
[quoted text clipped - 3 lines]
>
> Not sure. I think there's some 'PIC BASIC' out there too.

There sure is and it's far from free.
Eeyore - 23 Oct 2007 15:21 GMT
> >>> Why would you want to use assembly language ?
> >>
[quoted text clipped - 4 lines]
>
> ISTR that you're some kind of 8052 genius.  Let's see some of your code.

I have some experience with the 8051 family, true. I don't make any special
claim to have written the most elegant code ever but it works utterly reliably
and is easy to maintain.

> > Assembly language makes NO sense whatever to my mind in the modern
> > world. Sure, it's cheap since it avoids the need for a usually paid
[quoted text clipped - 3 lines]
> bottom of the list.  One closer to the top of the list would be to gain a
> real understanding of what's going on in the hardware.

That's kind of academically interesting and I've often examined the internal
operation of certain parts of the 8051 internal hardware to educate myself about
those kind of things but it's not very relevant to writing decent code IMHO.

>  There's nothing like
> coding an interrupt handler in assembler to get an idea of what's required
> to be done by an ISR.  I've had to work with way to many programmers who
> didn't have the faintest idea of what takes place at low levels.  Talk to a
> JAVA evangelist to see what I mean.  :-/

I can imagine that an interrupt might conceivably benefit most from 'tweaking'
like that but my experience with PL/M shows it to produce very competent
interrupts without any such need to tweak.

Graham
Jamie - 23 Oct 2007 00:31 GMT
>>>>Does anyone have a link to any tutorials for PIC assembly?
>>>>
[quoted text clipped - 12 lines]
> it's cheap since it avoids the need for a usually paid for compiler and that's
> your lot.

That's because you don't know and there for shouldn't even engage.

>>>IIRC, there's a neat free high level language for PICs but since I
>>>don't use PICs, I never bookmarked it.
[quoted text clipped - 5 lines]
>
> Graham

Might as well forget coding in uC if you think that's a professional
way of going.

  And what the hell do you think was used for those BASIC,C etc.
compilers?
  And what do you think goes in the chip at the end?

 You do realize the majority of PIC's don't come with lots of
memory and clock speed to work with ? Using high level languages
just makes for bloated slower code there by, crippling the PIC
compared to what it could do.

 Oh well, just another proclaimed subject of yours.

Signature

"I'm never wrong, once I thought I was, then, eeyore came along!"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5

Eeyore - 23 Oct 2007 15:28 GMT
> Might as well forget coding in uC if you think that's a professional
> way of going.

Are you seriously trying to suggest that using HLLs is *unprofessional* ?

>    And what the hell do you think was used for those BASIC,C etc.
> compilers?

Why is that even remotely relevant ? It's NOT.

>    And what do you think goes in the chip at the end?

Not assembler for sure !

>   You do realize the majority of PIC's don't come with lots of
> memory and clock speed to work with ? Using high level languages
> just makes for bloated slower code there by, crippling the PIC
> compared to what it could do.

Most uCs are massively overpowered for the job anyway. Sure if you use 'C' for
example you may produce large quantities of slow running code but I'm not here to
defend 'C' or any other kludgy language and/or compiler.

Graham
Jonathan Kirwan - 23 Oct 2007 00:35 GMT
>Assembly language makes NO sense whatever to my mind in the modern world.

Flat, dead wrong.  But then, I'm not surprised.

If you are seriously interested in defending that position, I will
present you with narrow, specific cases that come from __actual__
projects in real situations, complete with detailed analysis about why
and see if you can find a high level language to seriously promote
your above point.  I will expect you to work, though.

Otherwise, I can tell you from actual experience with actual projects
that you are wrong -- in the modern world, no less.

Jon
Eeyore - 23 Oct 2007 15:22 GMT
> >Assembly language makes NO sense whatever to my mind in the modern world.
>
[quoted text clipped - 8 lines]
> Otherwise, I can tell you from actual experience with actual projects
> that you are wrong -- in the modern world, no less.

On what architecture and comparing with what HLL ?

Graham
Jonathan Kirwan - 23 Oct 2007 17:10 GMT
>> >Assembly language makes NO sense whatever to my mind in the modern world.
>>
[quoted text clipped - 10 lines]
>
>On what architecture and comparing with what HLL ?

I am NOT thinking of any particular HLL, since the solution to one of
the problems/cases I have in mind cannot be solved properly in any I
know of.  (There are many other cases which cannot be solved in C or
C++, but can in CLU or some other HLL -- but I'm eliminating those
thoughts just in case you happen to be familiar with every HLL I am
familiar with.)  The architecture I'm thinking of is the case for most
microcontrollers without branch detection and cache.  Even in those
cases, it probably applies, but the detailed answer will depend a
little.

Mostly, my problem with your statement is that it is obviously made
from the perspective of a god, which I know you are not.  You don't
have the perspective to say it.  And I'm prepared to show you cases
(more than one) which can give the lie to it and demonstrate that you
lack perspective in making it.  If you hadn't been so sure of yourself
and had toned down the sweeping nature, I'd have left it be.  But you
said what you said and I have a few cases to easily take it down a
notch or two.

I could tell you the upshot of one of the cases, right away, without a
lot of todo.  And if you go back and use google to read my posts in
comp.arch.embedded, you will actually find some cases I mentioned
there for exactly this purpose.  So you don't have to be caught
flat-footed, if you don't want to be.  But they have been examined by
others and I don't recall anyone doing anything but finding the cases
sufficient to make the point.  You could be the first to find the
flaws in what I will write, though.  And these are actual cases from
real projects I've faced.  Not made up school problems.

Jon
Jamie - 24 Oct 2007 00:11 GMT
>>>>Assembly language makes NO sense whatever to my mind in the modern world.
>>>
[quoted text clipped - 41 lines]
>
> Jon
Good reply.
   Spoken like a true experienced coder in the field of uC.  I'm glad
you stepped up to the plate.

Signature

"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5

Jonathan Kirwan - 24 Oct 2007 19:08 GMT
><snip>
>    Spoken like a true experienced coder in the field of uC.  I'm glad
>you stepped up to the plate.

And I doubt Graham will respond to the challenge.  He probably has
either read what I've written before or else can, now prodded, think
of a few reasons and evidence that makes his claims clearly false.

Jon
Eeyore - 24 Oct 2007 19:59 GMT
> >    Spoken like a true experienced coder in the field of uC.  I'm glad
> >you stepped up to the plate.
>
> And I doubt Graham will respond to the challenge.  He probably has
> either read what I've written before or else can, now prodded, think
> of a few reasons and evidence that makes his claims clearly false.

I can think of no reason whatever to use a language (assembler) that requires
more than one line of code to even add two numbers, never mind anything more
complex.

Graham
Jonathan Kirwan - 25 Oct 2007 00:22 GMT
>> >    Spoken like a true experienced coder in the field of uC.  I'm glad
>> >you stepped up to the plate.
[quoted text clipped - 6 lines]
>more than one line of code to even add two numbers, never mind anything more
>complex.

Then your imagination is unusually restricted.

Three choices are obvious at this juncture.  Feel free to suggest
others.  (1) You can retract your sweeping, godlike statement, tell me
you really aren't interested in knowing any more about it, and we can
disengage with a notched-down statement from you that allows for other
possibilities you cannot and have not been able to imagine.  (2) You
can re-affirm your sweeping and comprehensive knowledge on this
subject and say you willing to defend that position against specific
challenges I will present you.  (3) You retreat to a less sweeping
position, simply saying you cannot imagine a case on your own, but
allow me to present one or two for your enjoyment and we leave it
there.

Keep in mind that, for the most part, I am not expecting to convince
you about "assembly-only" projects -- though I can actually draw from
actual projects that I still support (in fact, today, I'm currently
working on precisely one of these), which cannot possibly have been
done except as entirely assembly projects.  But your claim goes so
much further than this and was quite broad, "Assembly language makes
NO sense whatever to my mind in the modern world."  In other words,
you make no room whatsoever.  Period.  Not even as an adjunct with
other languages in use.  That is so completely and obviously false, to
anyone with the slightest consideration and experience, that I truly
marvel you feel able to make it at all.

Your choice.  But you are wrong.  There is no question of that.

Jon
Eeyore - 25 Oct 2007 09:23 GMT
> >> >    Spoken like a true experienced coder in the field of uC.  I'm glad
> >> >you stepped up to the plate.
[quoted text clipped - 14 lines]
> disengage with a notched-down statement from you that allows for other
> possibilities you cannot and have not been able to imagine.

I will do no such thing.

Obsession with writing assembler (seemingly for the sake of it) strikes me as
typical of 'god like' behaviour actually. I suspect a lot of it is to do with job
insecurity and the desire to obfuscate.

Graham
Jonathan Kirwan - 25 Oct 2007 09:46 GMT
>> >> >    Spoken like a true experienced coder in the field of uC.  I'm glad
>> >> >you stepped up to the plate.
[quoted text clipped - 16 lines]
>
>I will do no such thing.

Your choice, of course.  You are still wrong.

>Obsession with writing assembler (seemingly for the sake of it) strikes me as
>typical of 'god like' behaviour actually. I suspect a lot of it is to do with job
>insecurity and the desire to obfuscate.

I take it that you imagine that any use at all of assembly today can
only be due to "obsession."  If that is the extreme you believe in,
I'm sure you are in a smaller group of believers.

And no, it has nothing to do with what you suggested.  And if you were
willing to listen to those who know better than you about this, you'd
be able to learn something new.  You suspicions are simply wrong, as
was your earlier claim.

I smiled a little at the suggestion from you that the very idea of
writing assembler can only come out of some "godlike" behavior.  I
know that you only mean that as silly "turn the tables" rhetoric,
since it simply isn't possible you mean it seriously.  My point in
saying it the way I did would be clear and easily understood as
correct by anyone.  Your sweeping statements could ONLY be made from a
position of conprehensive and complete knowledge.  And everyone knows
that you do NOT have that perspetive.  So my point stands clear and
true.  By comparison, your comment is just ridiculuous.  Daring to use
a line of assembly is no more godlike than writing a line of c would
be.  And I don't think you'll find anyone to agree with you about it.

Still being rather parochial, I see.

If you are ever up to seeing a few practical examples from real
projects, let me know.

Jon
Tim Wescott - 22 Oct 2007 19:53 GMT
>> Does anyone have a link to any tutorials for PIC assembly?
>>
[quoted text clipped - 8 lines]
>
> Graham

Several reasons:

For _really teeny_ bits of code it's easier to just write in assembly
than to deal with the C runtime environment.

For _really fast_ bits of code you'll almost always get more speed out
of assembly than compiled C.

For _really odd_ bits of code you often can't do things in C at all, or
you get absurd levels of code bloat compared to what you can do in assembly.

There's no better way to learn how a microprocessor really works.

Many micro-based projects require just a bit of assembly programming to
really work well, and you can't do that unless you've got someone on
your team who can work in assembly.  Even when they don't, understanding
what the processor is doing 'underneath C' can be invaluable for debugging.

Signature

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Do you need to implement control loops in software?
"Applied Control Theory for Embedded Systems" gives you just what it says.
See details at http://www.wescottdesign.com/actfes/actfes.html

ian field - 22 Oct 2007 19:59 GMT
>>> Does anyone have a link to any tutorials for PIC assembly?
>>>
[quoted text clipped - 30 lines]
> team who can work in assembly.  Even when they don't, understanding what
> the processor is doing 'underneath C' can be invaluable for debugging.

Thanks.
Eeyore - 22 Oct 2007 20:13 GMT
> >> Does anyone have a link to any tutorials for PIC assembly?
> >>
[quoted text clipped - 11 lines]
> For _really teeny_ bits of code it's easier to just write in assembly
> than to deal with the C runtime environment.

Who said anything about C ? Blech !

> For _really fast_ bits of code you'll almost always get more speed out
> of assembly than compiled C.

Who said anything about C ? Blech !

> For _really odd_ bits of code you often can't do things in C at all, or
> you get absurd levels of code bloat compared to what you can do in assembly.

Who said anything about C ? Blech !

> There's no better way to learn how a microprocessor really works.

I disagree. Obsessing with operation at register level is academically interesting
but of almost no value to a coder and 'getting the job done'.

> Many micro-based projects require just a bit of assembly programming to
> really work well, and you can't do that unless you've got someone on
> your team who can work in assembly.  Even when they don't, understanding
> what the processor is doing 'underneath C' can be invaluable for debugging.

Who said anything about C ? Blech !

Graham
John Fields - 22 Oct 2007 23:10 GMT
>> >> Does anyone have a link to any tutorials for PIC assembly?
>> >>
[quoted text clipped - 28 lines]
>I disagree. Obsessing with operation at register level is academically interesting
>but of almost no value to a coder and 'getting the job done'.

---
You're completely, irrevocably wrong, but you've already admitted
that you don't work with PICs, so how would you know?
---

>> Many micro-based projects require just a bit of assembly programming to
>> really work well, and you can't do that unless you've got someone on
>> your team who can work in assembly.  Even when they don't, understanding
>> what the processor is doing 'underneath C' can be invaluable for debugging.
>
>Who said anything about C ? Blech !

---
Just about anything you say, Blech!

Signature

JF

Tim Wescott - 23 Oct 2007 17:02 GMT
>> >> Does anyone have a link to any tutorials for PIC assembly?
>> >>
[quoted text clipped - 37 lines]
>
> Graham

In the embedded world we call people with the skill set to go with your
attitude "applications programmers".

It's not a compliment.

Signature

Tim Wescott
Control systems and communications consulting
http://www.wescottdesign.com

Need to learn how to apply control theory in your embedded system?
"Applied Control Theory for Embedded Systems" by Tim Wescott
Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html

Eeyore - 24 Oct 2007 11:50 GMT
> >> >> Does anyone have a link to any tutorials for PIC assembly?
> >> >>
[quoted text clipped - 40 lines]
>
> It's not a compliment.

'Applications' on an 8051 ?

It seems that the very mention of an HLL has become so inextricably linked to 'C' that
any sensible discussion of the use of a HLL on a uC is no longer possible.

Have you ever even encountered PL/M ?

Just because Intel no longer sell / support it doesn't mean it's not relevant to this
discussion. And furthermore, I often inspect the assembler it produces out of interest.
That's one reason I see no need to code natively in it.

Graham
ian field - 24 Oct 2007 14:11 GMT
>> >> >> Does anyone have a link to any tutorials for PIC assembly?
>> >> >>
[quoted text clipped - 65 lines]
>
> Graham

PL/M isn't relevant to my original question about PIC assy', and when
someday I might progress to making PIC a career boost potential employers
are somewhat more likely to require experience with C PIC HLL than PL/M.
Eeyore - 24 Oct 2007 19:55 GMT
> > Tim Wescott wrote:
> >>
[quoted text clipped - 22 lines]
> someday I might progress to making PIC a career boost potential employers
> are somewhat more likely to require experience with C PIC HLL than PL/M.

If you're hell bent on programming a PIC, PL/M certainly will be of no use to
you. That wasn't my point however.

On the other matter, why are you so interested in PICs (as opposed to 8051
family or any other) ? One nice thing about 8051 is that the basic architecture
doesn't change from model to model. I've also heard that the data on the chips
is more reliable.

Graham
ian field - 24 Oct 2007 20:13 GMT
>> > Tim Wescott wrote:
>> >>
[quoted text clipped - 39 lines]
>
> Graham

Maybe I'm just more comfortable following what everyone else is doing - Who
knows, if I do well at PICs I might even have a look at the AVR.
Eeyore - 24 Oct 2007 20:52 GMT
> > On the other matter, why are you so interested in PICs (as opposed to 8051
> > family or any other) ? One nice thing about 8051 is that the basic
[quoted text clipped - 4 lines]
> Maybe I'm just more comfortable following what everyone else is doing - Who
> knows, if I do well at PICs I might even have a look at the AVR.

I think you're mistaken to imagine everyone uses PICs. It's more of a joke than
reality AIUI.

Graham
Anthony Fremont - 24 Oct 2007 21:11 GMT
>>> On the other matter, why are you so interested in PICs (as opposed
>>> to 8051 family or any other) ? One nice thing about 8051 is that
[quoted text clipped - 7 lines]
> I think you're mistaken to imagine everyone uses PICs. It's more of a
> joke than reality AIUI.

You're just being anti-PIC.  Do you really think there are more people using
805x parts than PICs?  Considering that you have little experience in
programming micros and aparently none with PICs, I'm at a complete loss to
understand why you want to ram PL/M and 805x down everyones throat every
time this stuff comes up.  What is it exactly that is so great about PL/M
and so "Bleh" about C?
ian field - 24 Oct 2007 21:40 GMT
>>>> On the other matter, why are you so interested in PICs (as opposed
>>>> to 8051 family or any other) ? One nice thing about 8051 is that
[quoted text clipped - 14 lines]
> every time this stuff comes up.  What is it exactly that is so great about
> PL/M and so "Bleh" about C?

Isn't AVR what Atmel would like everyone to use instead of 805x parts?
Anthony Fremont - 24 Oct 2007 21:51 GMT
>>>>> On the other matter, why are you so interested in PICs (as opposed
>>>>> to 8051 family or any other) ? One nice thing about 8051 is that
[quoted text clipped - 16 lines]
>
> Isn't AVR what Atmel would like everyone to use instead of 805x parts?

Probably, it's their counterpart to the Microchip PIC.  Atmel also makes ARM
processors.  Of all the processors I've played with, I think the ARM has the
most beautiful architecture.
John Fields - 25 Oct 2007 00:39 GMT
>Probably, it's their counterpart to the Microchip PIC.  Atmel also makes ARM
>processors.  Of all the processors I've played with, I think the ARM has the
>most beautiful architecture.

---
I don't know if they still use it, because I'm not in that game any
more, but I hated Intel for their segmented gangster-like addressing
scheme and I fell in love with Motorola's lovely flat address space
from the getgo.

I've never played with Microchips' stuff because it always seemed to
me that talking to their chips was like having to use a really fast,
power wasting clock to get some really simple sh.t done quickly.

Also, I've never had occasion to use Atmel's stuff because I've
always been able to do everything I needed to with Motorola's stuff.

Plus, I'm tooled up for Motorola. :-)

If you've had a chance to look at Motorola's (Freescale's)
instruction set and addressing modes for 8 bitters and have compared
them against Atmel's, I'd be really, really, interested in your
opinions. :-)

Signature

JF

Anthony Fremont - 25 Oct 2007 01:56 GMT
>> Probably, it's their counterpart to the Microchip PIC.  Atmel also
>> makes ARM processors.  Of all the processors I've played with, I
[quoted text clipped - 5 lines]
> scheme and I fell in love with Motorola's lovely flat address space
> from the getgo.

> I've never played with Microchips' stuff because it always seemed to
> me that talking to their chips was like having to use a really fast,
[quoted text clipped - 9 lines]
> them against Atmel's, I'd be really, really, interested in your
> opinions. :-)

I can't really comment as I haven't really written anything for a motorolla.
I've seen some code listings before and it looked ok.  Haven't written any
code for an AVR either, but I can appreciate why people like them with the
register set.  :-)
Eeyore - 25 Oct 2007 09:28 GMT
> >Probably, it's their counterpart to the Microchip PIC.  Atmel also makes ARM
> >processors.  Of all the processors I've played with, I think the ARM has the
[quoted text clipped - 5 lines]
> scheme and I fell in love with Motorola's lovely flat address space
> from the getgo.

For WHAT REASON ?

The 3 parallel address spaces in the 8051 are damn useful. Not least because your
I/O can use low cost partial address decoding.

Graham
Jonathan Kirwan - 25 Oct 2007 09:49 GMT
>> >Probably, it's their counterpart to the Microchip PIC.  Atmel also makes ARM
>> >processors.  Of all the processors I've played with, I think the ARM has the
[quoted text clipped - 10 lines]
>The 3 parallel address spaces in the 8051 are damn useful. Not least because your
>I/O can use low cost partial address decoding.

I love the 8051, as well.  Have a few hundred of them in a box of
parts.  My very first digital/analog hobby project was done with an
80C31 and the code ran the first time out, too.  Turned an IBM
typewriter into a printer for my computer, in 1984/85.  Oh.  It was
written entirely in assembler and took me a day to write.  Never had
to change a line of it, later.

Jon
John Fields - 25 Oct 2007 14:29 GMT
>> >Probably, it's their counterpart to the Microchip PIC.  Atmel also makes ARM
>> >processors.  Of all the processors I've played with, I think the ARM has the
[quoted text clipped - 7 lines]
>
>For WHAT REASON ?

---
Take a look at their architecture, their instruction cycle times,
and code a project or two and you might find out.  

>The 3 parallel address spaces in the 8051 are damn useful. Not least because your
>I/O can use low cost partial address decoding.

---
Blah, blah, blah, blah, blah.

Signature

JF

Eeyore - 24 Oct 2007 22:31 GMT
> >>> On the other matter, why are you so interested in PICs (as opposed
> >>> to 8051 family or any other) ? One nice thing about 8051 is that
[quoted text clipped - 9 lines]
>
> You're just being anti-PIC.

Not at all. I'm just poking fun at the oft-seen throwaway "use a PIC" comment.

> Do you really think there are more people using
> 805x parts than PICs?

I believe they're used in comparable numbers.

>  Considering that you have little experience in programming micros

Meow !

> and aparently none with PICs, I'm at a complete loss to
> understand why you want to ram PL/M and 805x down everyones throat every
> time this stuff comes up.

You sound a bit over-sensitive to me. I'm not ramming either down anyone's
throat. I was however posing a reasonable question to Ian.

>  What is it exactly that is so great about PL/M
> and so "Bleh" about C?

'C' was never intended as a programming language for uCs. It's massive overkill.
PL/M was. Check the efficiency of the code they produce.

Graham
David L. Jones - 24 Oct 2007 22:50 GMT
On Oct 25, 7:31 am, Eeyore <rabbitsfriendsandrelati...@hotmail.com>
wrote:

> > >>> On the other matter, why are you so interested in PICs (as opposed
> > >>> to 8051 family or any other) ? One nice thing about 8051 is that
[quoted text clipped - 11 lines]
>
> Not at all. I'm just poking fun at the oft-seen throwaway "use a PIC" comment.

Like it or not PIC is now a ubiquitous term that referes to a
microcontrollers in general.
In reality people pick the microcontroller that suits them and their
project.

PIC did not get to be the #1 selling microcontroller in the world by
being a "joke" of any sort. That must mean that more than hobbyists
are using them to flash LEDs.
I don't think it's #1 now (reliable figures are hard to get), but it's
still probably in the top 3.

Dave.
Jamie - 24 Oct 2007 23:29 GMT
> On Oct 25, 7:31 am, Eeyore <rabbitsfriendsandrelati...@hotmail.com>
> wrote:
[quoted text clipped - 27 lines]
>
> Dave.

100% correct, We use them along with AVR's in industrial applications..
Easy to modify as you work out the bugs. Replaces countless of logic
chips that otherwise would  make the circuit un practical.

Signature

"I'm never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5

Eeyore - 25 Oct 2007 09:21 GMT
> > > You're just being anti-PIC.
> >
> > Not at all. I'm just poking fun at the oft-seen throwaway "use a PIC" comment.
>
> PIC did not get to be the #1 selling microcontroller in the world by
> being a "joke" of any sort.

Nor did I say it was.  Jeez !

Graham
David L. Jones - 24 Oct 2007 23:01 GMT
On Oct 25, 7:31 am, Eeyore <rabbitsfriendsandrelati...@hotmail.com>
wrote:

> > >>> On the other matter, why are you so interested in PICs (as opposed
> > >>> to 8051 family or any other) ? One nice thing about 8051 is that
[quoted text clipped - 33 lines]
> 'C' was never intended as a programming language for uCs. It's massive overkill.
> PL/M was. Check the efficiency of the code they produce.

The top quality C compilers can produce superbly tight and efficient
code, even on the 14bit PICs. With C compilers you do often get what
you pay for. All HHL language compilers are not created equal, there
is massive variability between vendors. You can't just generalise and
say PL/M is better than C or whatever.

And if the efficiency of your C (or any HLL) compiler is that
important to your project then you are too close to pushing the limits
of your design, and should probably re-think your choice of processor
for that project. Sometimes it's necessary for various reasons of
course, but on your average project the efficiency of your HLL won't
matter a rats.

Dave.
Eeyore - 25 Oct 2007 09:17 GMT
> > > >>> On the other matter, why are you so interested in PICs (as opposed
> > > >>> to 8051 family or any other) ? One nice thing about 8051 is that
[quoted text clipped - 36 lines]
> The top quality C compilers can produce superbly tight and efficient
> code, even on the 14bit PICs.

I dare say that must be possible, yet the anitpathy to HLLs in this thread is quite
extraordinary and must have some basis. Possibly as a result of poorly implemented 'C'
compilers.

> With C compilers you do often get what
> you pay for. All HHL language compilers are not created equal, there
> is massive variability between vendors. You can't just generalise and
> say PL/M is better than C or whatever.

I didn't say 'better' though did I ? I pointed out that PL/M is purpose written for
the target uP / uC.

> And if the efficiency of your C (or any HLL) compiler is that
> important to your project then you are too close to pushing the limits
> of your design, and should probably re-think your choice of processor
> for that project.

I agree with you 100%.

> Sometimes it's necessary for various reasons of
> course, but on your average project the efficiency of your HLL won't
> matter a rats.

I think people fret too much and quite possibly erroneously assume that assembler will
provide a superior result when it's far from clear to me that's the case because it'll
depend highly on the individual programmer's skill. As I previously said, all the
worst code I've ever seen is in assembler.

Graham
David L. Jones - 25 Oct 2007 11:55 GMT
On Oct 25, 6:17 pm, Eeyore <rabbitsfriendsandrelati...@hotmail.com>
wrote:

> > > > >>> On the other matter, why are you so interested in PICs (as opposed
> > > > >>> to 8051 family or any other) ? One nice thing about 8051 is that
[quoted text clipped - 40 lines]
> extraordinary and must have some basis. Possibly as a result of poorly implemented 'C'
> compilers.

I think people just took offense to you saying that assembler is not
needed at all (or whatever it was), when it clearly still has an
important place in the development cycle.

> I think people fret too much and quite possibly erroneously assume that assembler will
> provide a superior result when it's far from clear to me that's the case because it'll
> depend highly on the individual programmer's skill. As I previously said, all the
> worst code I've ever seen is in assembler.

Same here. Although I've seen my fair share of shockingly awful C code
too!, but it's always easier to read and comprehend crap C code than
crap assembler code.
And that's why anyone who writes large or even medium size apps in
just assembler is crazy. High level languages have so many advantages
and should be used, unless you need assembler for a specific reason.

My most recent PIC project would have been ridiculously complex and
taken several order of magnitude longer if I wrote it all in
assembler. But I did use a pre-written IEEE floating point package,
the core of which is written entirely in assembler. It was extremely
quick, and I was thankful that some poor schmuck had already written
and debugged it, because the code was almost un-intelligible.

Small in-line assembly is very handy. You can write a routine and know
exactly how many cycles it's going to take regardless of what
optimisation setting you have the compiler set to.

I had the "pleasure" once to take over a project using a TI DSP that
was not only written entirely in Forth, but it used a home-made
compiler only available in German. Awful does not begin to describe
it!

Dave.
Eeyore - 25 Oct 2007 14:00 GMT
> > > > >  Considering that you have little experience in programming micros
> >
[quoted text clipped - 23 lines]
> needed at all (or whatever it was), when it clearly still has an
> important place in the development cycle.

I don't recall saying it never had ANY place whatever. MY experience is simply that there is
rarely a valid need for it. I can certainly see that some people might use it as a job
protection measure for sure.

Graham
spamfree@spam.heaven - 25 Oct 2007 14:03 GMT
>I don't recall saying it never had ANY place whatever.

Let me remind you.

Quote:

"Assembly language makes NO sense whatever to my mind in the modern
world."

jack
spamfree@spam.heaven - 25 Oct 2007 14:09 GMT
>>I don't recall saying it never had ANY place whatever.
>
[quoted text clipped - 6 lines]
>
>jack

Oh, and another post of yours contained:

"Seriously, the need to use assembler vanished about 30+ years
ago."

jack
Eeyore - 25 Oct 2007 15:31 GMT
> >>I don't recall saying it never had ANY place whatever.
> >
[quoted text clipped - 11 lines]
> "Seriously, the need to use assembler vanished about 30+ years
> ago."

NEED to use is a completely different matter.

Graham
spamfree@spam.heaven - 26 Oct 2007 02:02 GMT
>> >>I don't recall saying it never had ANY place whatever.
>> >
[quoted text clipped - 13 lines]
>
>NEED to use is a completely different matter.

From what?

Having a place, or "making any sense whatever"?

English is not your first language, right?

Macquarie Dictionary gives:

"need
  /need/
  noun
      1. a case or instance in which some necessity or want exists; a
requirement: to meet the needs of the occasion."

Note the word "want"

HTH  jack
John Fields - 25 Oct 2007 15:03 GMT
>> I think people just took offense to you saying that assembler is not
>> needed at all (or whatever it was), when it clearly still has an
>> important place in the development cycle.
>
>I don't recall saying it never had ANY place whatever.

---
Conveniently short memory?

From:

471CEA2A.DDE3977D@hotmail.com

"Assembly language makes NO sense whatever to my mind in the modern
world."
---

>MY experience is simply that there is rarely a valid need for it.

---
I suggest, then, that your experience is rather limited.
---

>I can certainly see that some people might use it as a job
>protection measure for sure.

---
Since the cost of implementing and maintaining assembly language
often makes its use impractical, I doubt whether competent
management would allow its use, carte blanche, at the discretion of
a job-insecure programmer.

Signature

JF

Eeyore - 25 Oct 2007 15:34 GMT
> >> I think people just took offense to you saying that assembler is not
> >> needed at all (or whatever it was), when it clearly still has an
[quoted text clipped - 17 lines]
> ---
> I suggest, then, that your experience is rather limited.

And I suggest you're wrong.

> >I can certainly see that some people might use it as a job
> >protection measure for sure.
[quoted text clipped - 4 lines]
> management would allow its use, carte blanche, at the discretion of
> a job-insecure programmer.

Your presumption of COMPETENT management is touching.

Graham
John Fields - 25 Oct 2007 16:39 GMT
>> >> I think people just took offense to you saying that assembler is not
>> >> needed at all (or whatever it was), when it clearly still has an
[quoted text clipped - 19 lines]
>
>And I suggest you're wrong.

---
LOL, for years now you've been claiming to be an expert in audio,
with nary a mention of anything even remotely approaching
microcontrollers and now, all of a sudden, you're claiming to be an
expert programmer while, in the same breath, decrying assembly
language as absolutely useless?  You're as full of sh.t as a
Christmas goose.
---

>> >I can certainly see that some people might use it as a job
>> >protection measure for sure.
[quoted text clipped - 6 lines]
>
>Your presumption of COMPETENT management is touching.

---
Poor dumb basturd, you can't even read.  The _requirement_ is for
competent management to make the call, something which will
certainly never burden the likes of you.

 
Signature

JF

spamfree@spam.heaven - 26 Oct 2007 01:57 GMT
>> Since the cost of implementing and maintaining assembly language
>> often makes its use impractical, I doubt whether competent
>> management would allow its use, carte blanche, at the discretion of
>> a job-insecure programmer.
>
>Your presumption of COMPETENT management is touching.

You are now making the sweeping statement that there is no such thing
as competent management?

You will no doubt deny saying this or duck for cover. Do you proof
read your wild assertions?

You've not addressed all those IEC standards you have read, and gotten
completely wrong.

jack
Eeyore - 25 Oct 2007 14:08 GMT
> > I think people fret too much and quite possibly erroneously assume that assembler will
> > provide a superior result when it's far from clear to me that's the case because it'll
[quoted text clipped - 4 lines]
> too!, but it's always easier to read and comprehend crap C code than
> crap assembler code.

EXACTLY ! Assembler makes it easier to hide poor code writing skills IMHO. Certainly so from
the manager.

> And that's why anyone who writes large or even medium size apps in
> just assembler is crazy. High level languages have so many advantages
> and should be used, unless you need assembler for a specific reason.

You're beginning to sound rather like me !

> My most recent PIC project would have been ridiculously complex and
> taken several order of magnitude longer if I wrote it all in
> assembler.

There's a particular application that was originally written for my client in PL/M that
results in about 30k bytes of binary code (actual ROM space).

2 comments about it.

It did contain some niggling bugs but the high level nature of it made it relatively easy
for me to detect and fix.

I cannot even conceive of how it could have intelligently written in assembler. It runs to
something like about 40-50 pages of source !

As a further comment, the coder we used was himself an assembler fan, but at the end of the
project, to his credit, he said to me "I understand now why you wanted it written in PL/M".

Graham
David L. Jones - 26 Oct 2007 02:48 GMT
On Oct 25, 11:08 pm, Eeyore <rabbitsfriendsandrelati...@hotmail.com>
wrote:

> > > I think people fret too much and quite possibly erroneously assume that assembler will
> > > provide a superior result when it's far from clear to me that's the case because it'll
[quoted text clipped - 13 lines]
>
> You're beginning to sound rather like me !

Not at all. I use at least a few lines of in-line assembler in most
projects, and more when needed.
I understand its benefits and its pitfalls and use it appropriately.
Just like I use higher level languages appropriately.

Also, I don't doggedly stick to one processor or architecture like
many people seem to to do. The AVR "freaks" are famous for it, as are
some 8051 evangelists, so are the PIC hobbyists, but not so much the
PIC professionals I've found. The MSP430 crowd are picking up speed
too!
I'll happily use whatever is appropriate for the job at hand.

> > My most recent PIC project would have been ridiculously complex and
> > taken several order of magnitude longer if I wrote it all in
[quoted text clipped - 13 lines]
> As a further comment, the coder we used was himself an assembler fan, but at the end of the
> project, to his credit, he said to me "I understand now why you wanted it written in PL/M".

Yes, a good programmer will understand the massive (and essential)
benefits offered by a high level language, esp as the project size
gets bigger. I doubt there is any programmer around who codes large
jobs entirely in assembler and is able to meet the tight project time
frames that seem to be the norm these days. That's even if the company/
client lets them code in assembler in the first place.

Dave.
Anthony Fremont - 24 Oct 2007 23:10 GMT
>>>>> On the other matter, why are you so interested in PICs (as opposed
>>>>> to 8051 family or any other) ? One nice thing about 8051 is that
[quoted text clipped - 12 lines]
> Not at all. I'm just poking fun at the oft-seen throwaway "use a PIC"
> comment.

At least "some" of the people proposing PICs have supplied code, have you
ever posted any code?

>> Do you really think there are more people using
>> 805x parts than PICs?
>
> I believe they're used in comparable numbers.

PICs took over the 8-bit market about 5 years ago.

>>  Considering that you have little experience in programming micros
>
[quoted text clipped - 13 lines]
> massive overkill. PL/M was. Check the efficiency of the code they
> produce.

AIUI, PL/M is a mish-mash of PL/1, ALGOL and some other odd stuff.  It looks
like some bastardization of COBOL and C to me.  In my experience, decent
quality C compilers usually produce tighter assembler code than I do.
John Fields - 25 Oct 2007 01:09 GMT
>>>>>> On the other matter, why are you so interested in PICs (as opposed
>>>>>> to 8051 family or any other) ? One nice thing about 8051 is that
[quoted text clipped - 42 lines]
>
>AIUI, PL/M is a mish-mash of PL/1, ALGOL and some other odd stuff.

---
Check this out:

http://en.wikipedia.org/wiki/PL/M
---

>It looks
>like some bastardization of COBOL and C to me.  In my experience, decent
>quality C compilers usually produce tighter assembler code than I do.

---
Then you're not much of an assembler. ;)

Signature

JF

Anthony Fremont - 25 Oct 2007 01:51 GMT
> On Wed, 24 Oct 2007 17:10:50 -0500, "Anthony Fremont"

>> AIUI, PL/M is a mish-mash of PL/1, ALGOL and some other odd stuff.
>
> ---
> Check this out:
>
> http://en.wikipedia.org/wiki/PL/M

See.  :-)

>> It looks
>> like some bastardization of COBOL and C to me.  In my experience,
[quoted text clipped - 3 lines]
> ---
> Then you're not much of an assembler. ;)

You haven't used a good C compiler.  ;-)  Seriously, a good optimizing
compiler will generate code that is incomprehensible to a human, but it will
(almost) always work.  :-)
Eeyore - 25 Oct 2007 09:18 GMT
> >>>>> On the other matter, why are you so interested in PICs (as opposed
> >>>>> to 8051 family or any other) ? One nice thing about 8051 is that
[quoted text clipped - 14 lines]
>
> At least "some" of the people proposing PICs have supplied code,

Where ?

Graham
Eeyore - 25 Oct 2007 09:19 GMT
> >>  What is it exactly that is so great about PL/M
> >> and so "Bleh" about C?
[quoted text clipped - 5 lines]
> AIUI, PL/M is a mish-mash of PL/1, ALGOL and some other odd stuff.  It looks
> like some bastardization of COBOL and C to me.

Shows how little you know about it.

Graham
Anthony Fremont - 25 Oct 2007 14:58 GMT
>>>>  What is it exactly that is so great about PL/M
>>>> and so "Bleh" about C?
[quoted text clipped - 7 lines]
>
> Shows how little you know about it.

I didn't claim to know allot about PL/M, but I do know something about
writing code.  OTOH, you act like your an absolute expert on programming
techniques after having worked with an 805x processor in the mid 80's.
Since you've made no other claims as to your experience, I assume that's the
extent of it.
Eeyore - 25 Oct 2007 15:31 GMT
> >>>>  What is it exactly that is so great about PL/M
> >>>> and so "Bleh" about C?
[quoted text clipped - 11 lines]
> writing code.  OTOH, you act like your an absolute expert on programming
> techniques after having worked with an 805x processor in the mid 80's.

90s and 00s.

Graham
Jonathan Kirwan - 25 Oct 2007 00:38 GMT
><snip>
>> > I think you're mistaken to imagine everyone uses PICs. It's more of a
[quoted text clipped - 3 lines]
>
>Not at all. I'm just poking fun at the oft-seen throwaway "use a PIC" comment.

I think you raise a valid point, that not everyone uses PICs, though I
think your choice of words is very poor after that point.

Microchip is no joke to anyone.  I've been using their parts as part
of my consulting with many companies, since around 1987 or so, when
they first started making them available for smaller businesses to use
(they used to be only in multi-million use products like rice
cookers.)  They support their tools, from what I can see in practice,
literally forever.  Even well after they stop selling an old tool,
such as the Pro Mate II, they will continue to support it as well as
supply new plug in modules for it to this very day.  I can't say the
same for most of their competition.  Business-wise, they are very good
to mid- and smaller companies as well as large customers, so they are
good business partners for most of us.

Sure, the PIC cpu is like looking at a transparent-man anatomy lesson
instead of a mannequin.  You get to "see" pretty much every tiny,
silly detail of how a cpu works inside, with them.  I can cobble up a
nand-only digital circuit to emulate the instruction set in no time
flat, because they are so transparent, in fact.  But that's the only
joke about them, the rest is quite serious business.  Microchip is a
good company to partner with, for a great many of us.  And that is
more important than some argument about cpu internals.

By the way, aren't you the one saying that assembly isn't used
anymore?  If so, what exactly do you mean when you say "joke," then?
Can't be about the machine language, since obviously you don't care
about that, anyway.  So it must be something else.  And on all the
other facets, Microchip is a strong and supportive partner.  So I am
unable to see what else you might be addressing that comment towards.

But yes, I think Microchip is only an important part of the total
business and everyone does NOT use them.  No question.  So you are at
least right on that point.

Jon
Eeyore - 25 Oct 2007 09:25 GMT
> >> > I think you're mistaken to imagine everyone uses PICs. It's more of a
> >> > joke than reality AIUI.
[quoted text clipped - 5 lines]
> I think you raise a valid point, that not everyone uses PICs, though I
> think your choice of words is very poor after that point.

Whine, whine whine .......

Graham
Jonathan Kirwan - 25 Oct 2007 09:52 GMT
>> >> > I think you're mistaken to imagine everyone uses PICs. It's more of a
>> >> > joke than reality AIUI.
[quoted text clipped - 7 lines]
>
>Whine, whine whine .......

Actually, I wasn't at all, Graham.  I was talking about the good
support I've gotten from Microchip, in almost all of what I wrote and
you clipped.  In fact, I have a hard time finding any whining at all
-- unless you don't like me saying that you are foolish to say "joke
than reality."  If that's all, then it's not whining -- just pointing
out where you are wrong.

I note you did NOT ever say why you said what you said about the PIC.
I can only imagine it is for quite silly reasons.  But I'd love to
hear you say the real reason you wrote that way.  I don't expect to,
but that's okay too.

Jon
Eeyore - 25 Oct 2007 09:26 GMT
> Microchip is no joke to anyone.  I've been using their parts as part
> of my consulting with many companies, since around 1987 or so, when
> they first started making them available for smaller businesses to use

And my first exposure to an 8051 was in 1985 when the first CMOS (actually Intel's
CHMOS) version came out.

Graham
Jonathan Kirwan - 25 Oct 2007 09:56 GMT
>> Microchip is no joke to anyone.  I've been using their parts as part
>> of my consulting with many companies, since around 1987 or so, when
>> they first started making them available for smaller businesses to use
>
>And my first exposure to an 8051 was in 1985 when the first CMOS (actually Intel's
>CHMOS) version came out.

Well, as I said earlier, I also love the 8051.  Have a few hundred of
them in a box of parts and I still use them in my hobby projects, once
in a while.  As I wrote, my very first digital/analog hobby project
was done with an 80C31 and the code ran the first time out.  I really
liked the CPU, too.  I took an IBM Electronic 85 typewriter, scoped
out the reed relays and the signaling, and designed and built myself a
nice little wire-wrap board to turn that typewriter into a printer for
my computer, in 1984 or so.  It was written entirely in assembler
(using the free table assembler available from a guy in Washington
state who was making products for the blind or deaf, if memory
serves.)  The whole software thing took me a day to write and I never
had to change a line of it, later on.

I enjoy the 8051 core, a lot.  And the Cygnal parts -- or that new
company that owns them now -- were really nice to play with, a few
years back.  Still have and use them, occasionally.

Jon
Marra - 23 Oct 2007 04:28 GMT
The PIC user manual should be enough to get you started.

The best way I found was to play with the PIC and do simple things
like adding 2 numbers etc
Use the MPLAB simulator to try things out,

If you are struggling with assembler then go for a C compiler.
ian field - 23 Oct 2007 15:35 GMT
> The PIC user manual should be enough to get you started.
>
[quoted text clipped - 3 lines]
>
> If you are struggling with assembler then go for a C compiler.

When in Rome - do as Romans as they say. From what I've seen most everyone
else is using assy', and there must be some reason for that. Although I've
got the impression from what I've read so far, that If I intend to make a
career boost out of PICs then somewhere down the line I'll have to learn to
program PICs in C as well.
Eeyore - 23 Oct 2007 16:21 GMT
> > If you are struggling with assembler then go for a C compiler.
>
> When in Rome - do as Romans as they say. From what I've seen most everyone
> else is using assy'

What on earth gave you that idea ?

I hope you'll like the added complexity involved.

Graham
Tom2000 - 23 Oct 2007 16:47 GMT
>When in Rome - do as Romans as they say. From what I've seen most everyone
>else is using assy', and there must be some reason for that. Although I've
>got the impression from what I've read so far, that If I intend to make a
>career boost out of PICs then somewhere down the line I'll have to learn to
>program PICs in C as well.

Your choice of programming tools depends on the processor and the task
at hand.

If you're writing a small rouine in one of the lower-level processors,
assembly is warranted.

As your project size increases on the larger machines, pure assembly
becomes too time consuming.  For those, you'll want to use C or
another high-level language, for the most part.  However, if
performance is a goal, you'll still find yourself writing your
workhorse functions in assembly code embedded within your C routine.

So I'd say that, if you want to have fun in PICville, you really need
to learn both.

You've got to start somewhere, though, and starting with a simple
assembly tutorial on a lower-level processor is a good place to begin.

(Oh, and while I'm discussing tutorials, work through the exercises as
best you can using the processor you have avaiable.  You can't skip
the experiments.  Try them out, study them, learn how they work, and
to prove to yourself that