PIC Assembler.

"john jardine" <john.jardine@idnet.co.uk> wrote in message
news:13hvlouadkf2cb7@corp.supernews.com...
"ian field" <dai.ode@ntlworld.com> wrote in message
news:c3PTi.97560$j16.66554@newsfe6-gui.ntli.net...

"john jardine" <john.jardine@idnet.co.uk> wrote in message
news:13hvdvk9b83a745@corp.supernews.com...

"ian field" <dai.ode@ntlworld.com> wrote in message
news:geITi.1019$uH.361@newsfe4-gui.ntli.net...

[...]
Are any of the older versions of MPLAB any less "bloated"?

No. Even the 10 year old original was bloated and from there they have
laboured on each iteration to increase the bloat by a factor of about
sqrt(2).

Ever heard of the EPE magazine TK3? - I think that contains an assembler
but I'd have to dig out my collection of old magazines to find out.

Yep. Over the years they've given excellent coverage and support to many
PIC
(starter or otherwise) projects. I think I came across their 'house'
assembler in a listing for a nice "L-C meter" they did. Had to modify the
text in a couple of lines, to allow a nicked lump of their code (Peter
Helmsley's? 32 bit maths collection), to be assembled on a 'standard' PIC
assembler but it was straightforward otherwise.
<snip>

Having already ordered the EPE pic resources CD (still awaiting arrival), I
think it might be best to stick with that format, I've just found out that
the EPE teach-in series is PIC instead of electronics for this season and my
EPE collection goes back to before the PIC existed so with any luck the
articles go back to when the people at EPE were just getting the hang of it.
 
On Thu, 25 Oct 2007 15:34:02 +0100, Eeyore
<rabbitsfriendsandrelations@hotmail.com> wrote:

John Fields wrote:

Eeyore wrote:
"David L. Jones" wrote:

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.

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 shit as a
Christmas goose.
---

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.

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.


--
JF
 
On 23 Oct, 15:36, "ian field" <dai....@ntlworld.com> wrote:
"Marra" <cresswellave...@talktalk.net> wrote in message

news:1193091936.570121.61080@t8g2000prg.googlegroups.com...

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.

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.

Its horses for courses.

I would use assembler in the smaller PIC's for speed and code
compactness.

If using the bigger memory PIC's then I would recommend C.

Unlesss you are programming for mass production the size of code
probably doesnt matter as there is always a bigger PIC !

I must admit out of 30 years of using the PIC I only used C once and
that was the program I had to fix was written in C.
 
On 24 Oct, 00:24, "john jardine" <john.jard...@idnet.co.uk> wrote:
"ian field" <dai....@ntlworld.com> wrote in message

news:kcpTi.15009$qv1.3845@newsfe2-gui.ntli.net...







"Richard Seriani" <richard_s...@cox.net> wrote in message
news:vPjTi.11299$BT5.19@newsfe18.lga...

"ian field" <dai....@ntlworld.com> wrote in message
news:V_2Ti.20084$0z6.19665@newsfe7-win.ntli.net...
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.
Ian,

Try these. Some are better than others and some have mistakes - but,
you'll be able to spot those within a short time.

http://www.mikroe.com/en/books/picbook/picbook.htm
http://www.winpicprog.co.uk/pic_tutorial.htm
http://www.mstracey.btinternet.co.uk/pictutorial/picmain.htm

Saving these to your hard drive can be done with a right-click and save
as. It creates two files, one is the html document and the other is a
file
folder with the graphics. At least, it does on my Windoz machine.

In a later post, someone also recommended the PIC Elmer 160 tutorial.
That
is a good one and each of the lessons downloads as a PDF.

snip

Many thanks, the first link is *very* interesting - I may already have the
other 2 saved. The Elmer 160 starts off simple enough but the code
examples
quickly get heavy going, I need to go over a lot of simpler code over and
over until I get the hang of it.

It's absolutely essential that you get to write the few lines needed to
flash an LED. If you can get there and can see why you've caused the LED to
flash then -ALL- other PIC programming is downhill.
The "mstracey" link that Richard supplied, will do this, (upto "tutorial
#5") but more importantly, the how's and why's of the individual
instructions are described nicely.

Try and ignore anything written by Microchip.
Sadly though, you may have to make use of Microchip's, bloated, inane piece
of s***, known as "MPLAB", but remember, the hoops it forces you to jump
through, are nothing to do with actual PIC programming but more reflect the
mindset of Microchip's C pogrammers.- Hide quoted text -

- Show quoted text -
I have had no problems with MPLAB and it doies provide a simulator.

I have had trouble with the Microchip FFT that the multiply routine
had a bug.
I fixed it and sent it back to them.
 
It is quite remarkable what you can make a PIC do if you put in some
effort.

I did a dual cooker for a large manufacturer and it did multi tasking
between the 2 ovens and a scrolling VF display.
 
Marra wrote:

It is quite remarkable what you can make a PIC do if you put in some
effort.

I did a dual cooker for a large manufacturer and it did multi tasking
between the 2 ovens and a scrolling VF display.
Had a scrolling VFD in one of my 8051 designs as it happens.

Graham
 
On Thu, 25 Oct 2007 15:34:02 +0100, Eeyore
<rabbitsfriendsandrelations@hotmail.com> wrote:


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
 
On Thu, 25 Oct 2007 15:31:09 +0100, Eeyore
<rabbitsfriendsandrelations@hotmail.com> wrote:

spamfree@spam.heaven wrote:

spamfree@spam.heaven wrote:
Eeyore wrote:

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

Oh, and another post of yours contained:

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

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
 
On Oct 25, 11:08 pm, Eeyore <rabbitsfriendsandrelati...@hotmail.com>
wrote:
"David L. Jones" wrote:
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
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.

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 !
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
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".
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.
 
"Marra" <cresswellavenue@talktalk.net> wrote in message
news:1193360493.191387.182070@k79g2000hse.googlegroups.com...
On 24 Oct, 00:24, "john jardine" <john.jard...@idnet.co.uk> wrote:
"ian field" <dai....@ntlworld.com> wrote in message

news:kcpTi.15009$qv1.3845@newsfe2-gui.ntli.net...







"Richard Seriani" <richard_s...@cox.net> wrote in message
news:vPjTi.11299$BT5.19@newsfe18.lga...

"ian field" <dai....@ntlworld.com> wrote in message
news:V_2Ti.20084$0z6.19665@newsfe7-win.ntli.net...
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.
Ian,

Try these. Some are better than others and some have mistakes - but,
you'll be able to spot those within a short time.

http://www.mikroe.com/en/books/picbook/picbook.htm
http://www.winpicprog.co.uk/pic_tutorial.htm
http://www.mstracey.btinternet.co.uk/pictutorial/picmain.htm

Saving these to your hard drive can be done with a right-click and
save
as. It creates two files, one is the html document and the other is a
file
folder with the graphics. At least, it does on my Windoz machine.

In a later post, someone also recommended the PIC Elmer 160 tutorial.
That
is a good one and each of the lessons downloads as a PDF.

snip

Many thanks, the first link is *very* interesting - I may already have
the
other 2 saved. The Elmer 160 starts off simple enough but the code
examples
quickly get heavy going, I need to go over a lot of simpler code over
and
over until I get the hang of it.

It's absolutely essential that you get to write the few lines needed to
flash an LED. If you can get there and can see why you've caused the LED
to
flash then -ALL- other PIC programming is downhill.
The "mstracey" link that Richard supplied, will do this, (upto "tutorial
#5") but more importantly, the how's and why's of the individual
instructions are described nicely.

Try and ignore anything written by Microchip.
Sadly though, you may have to make use of Microchip's, bloated, inane
piece
of s***, known as "MPLAB", but remember, the hoops it forces you to jump
through, are nothing to do with actual PIC programming but more reflect
the
mindset of Microchip's C pogrammers.- Hide quoted text -

- Show quoted text -

I have had no problems with MPLAB and it doies provide a simulator.

I have had trouble with the Microchip FFT that the multiply routine
had a bug.
I fixed it and sent it back to them.
To repeat an earlier question - would I find an earlier version of MPLAB
easier to get started, or would I seriously disadvantage myself by denying
myself of the advanced features of newer versions?

It seems a lot of people prefer to use a stand alone text editor, I'd
welcome any advice as to which choice to make.
 
ian field wrote:

It seems a lot of people prefer to use a stand alone text editor, I'd
welcome any advice as to which choice to make.
I've been known to use notepad (that comes with Windows). It does have a maximum
file size limitation though.

Graham
 
"Eeyore" <rabbitsfriendsandrelations@hotmail.com> wrote in message
news:4722058A.F0CA782A@hotmail.com...
ian field wrote:

It seems a lot of people prefer to use a stand alone text editor, I'd
welcome any advice as to which choice to make.

I've been known to use notepad (that comes with Windows). It does have a
maximum
file size limitation though.

Graham
That might not be too big a problem while all I'm trying to do is get a F84
to flash an LED or two.
 
ian field wrote:

That might not be too big a problem while all I'm trying to do is get
a F84 to flash an LED or two.
I think it really just comes down to personal preference. I use MPLAB to
"manage" the projects, but I do the text editing using UltraEdit instead of
the built in editor in MPLAB. Personally I haven't really noticed major
feature changes between versions of MPLAB, just increases in the start-up
time. Keep in mind that I don't generally use the simulator, so I could
just do everything I need with .BAT files to invoke the assembler, linker
and PIC programmer. I'm just too lazy to set it all up. ;-)
 
ian field wrote:

"Eeyore" <rabbitsfriendsandrelations@hotmail.com> wrote
ian field wrote:

It seems a lot of people prefer to use a stand alone text editor, I'd
welcome any advice as to which choice to make.

I've been known to use notepad (that comes with Windows). It does have a
maximum file size limitation though.


That might not be too big a problem while all I'm trying to do is get a F84
to flash an LED or two.
It would be perfect.

Here's a way to flash a LED using PL/M51. The formatting got squished a bit btw.




$ROM(small)
$REGISTERBANK(0)

FLASHLED: DO;

$INCLUDE (REG51.DCL)
/* standard 8051 register declarations */

DECLARE P2_0 BIT AT (0A0H) REG;


default:procedure;

P2_0 = 0;
disable; /* disable all interrupts */

end;



led_oscillator:procedure;

dcl count byte;

do count = 1 to 250;
call time(250);
end;

P2_0 = NOT P2_0;

end;




start:

call default;
do while 1;

call led_oscillator;

end;


END;
 
"ian field" <dai.ode@ntlworld.com> wrote in message
news:7snUi.2937$Eq.2527@newsfe3-gui.ntli.net...
To repeat an earlier question - would I find an earlier version of MPLAB
easier to get started, or would I seriously disadvantage myself by denying
myself of the advanced features of newer versions?

It seems a lot of people prefer to use a stand alone text editor, I'd
welcome any advice as to which choice to make.
Ian,

I don't think version will matter much to you at this stage. Since MPLAB is
free, it may be worth your time to try it. There are a few things to learn
about simulation (setting up and firing bits comes immediately to mind).
Overall, simulation saves me time (sure could have used that in the 70's!).
Though some folks don't care for it or have problems I haven't run into at
my level, it works for me.

I have been using v7.50 and v7.51 of MPLAB, depending on which computer I am
on, as my editor, builder, and for the simulation capabilities. When I am
somewhere it isn't readily available, I use whichever text editor is handy.
Later, I open the .asm files in MPLAB, to build and simulate. If I happen to
be using my PICStart programmer, I also use it to program. I have also used
the MPLAB-generated hex code with ICProg (http://www.ic-prog.com) and an El
Cheapo programmer. Others also, but too rarely to know enough about them to
decide how good, or bad, they are.

The bottom line is that only you will be able to figure out what will work
best for your application. The only thing for certain is that your needs and
wants will change as your abilities, requirements, and financial situation
chage. Text editor or MPLAB doesn't really make much difference. The
question may come down to "to simulate or not to simulate?"

Whichever way you decide to go, good luck and have fun learning. As for
those who will tell you your decisions are wrong, non illegitimi
carborundum - don't let the bastards wear you down!

Richard
 
On Fri, 26 Oct 2007 15:10:59 GMT, "ian field" <dai.ode@ntlworld.com>
wrote:

snip
To repeat an earlier question - would I find an earlier version of MPLAB
easier to get started, or would I seriously disadvantage myself by denying
myself of the advanced features of newer versions?
The earlier versions of MPLAB are kept around on the Microchip website
for at least a few reasons I can think of: (1) Some earlier versions
of MPLAB were supported on earlier Windows platforms, such as Win95
and Win98. The newer versions don't claim support for the same
Windows platforms. If you are using an older Microsoft Windows
version, and you want to use a version of MPLAB that was intended for
that Windows version, you may need to use one of the older MPLAB
prorgam installations. (2) Some earlier versions of Microchip's (or
other vendors' products) may not install themselves properly with
newer MPLAB systems. In those cases, you may need an older MPLAB so
that the compiler tool installation procedure works as advertized. (3)
Older version of MPLAB include older versions of firmware for their
development tools, such as the Pro Mate II. If you want to follow
procedures written for the older firmware on such devices, you may
need an older MPLAB in order to access that firmware and download it
into the programmer tool.

There are probably other reasons, too. But if you don't have a
specific reason, including one of the above, then probably you are
better off with the newer version of MPLAB available. Certainly, you
do NOT want to go back to a version of MPLAB that doesn't support your
F84 chip, though. So whatever you do, make sure that your chip is
supported by the MPLAB program and your programmer tools.

It seems a lot of people prefer to use a stand alone text editor, I'd
welcome any advice as to which choice to make.
I use the built-in editor, usually. But I adapt easily to different
editing tools and don't have a penchant for using one particular
editor I like, when writing code. Being flexible that way, it doesn't
matter that much to me. I would recommend that you do what feels more
comfortable to you -- no one else can tell you what you will like or
won't. Just try a couple of ways and settle on one.

Jon
 
"Jonathan Kirwan" <jkirwan@easystreet.com> wrote in message
news:7fh4i3lkb29cs1ak41gde8b1jt55gl864u@4ax.com...
On Fri, 26 Oct 2007 15:10:59 GMT, "ian field" <dai.ode@ntlworld.com
wrote:

snip
To repeat an earlier question - would I find an earlier version of MPLAB
easier to get started, or would I seriously disadvantage myself by denying
myself of the advanced features of newer versions?

The earlier versions of MPLAB are kept around on the Microchip website
for at least a few reasons I can think of: (1) Some earlier versions
of MPLAB were supported on earlier Windows platforms, such as Win95
and Win98. The newer versions don't claim support for the same
Windows platforms. If you are using an older Microsoft Windows
version, and you want to use a version of MPLAB that was intended for
that Windows version, you may need to use one of the older MPLAB
prorgam installations. (2) Some earlier versions of Microchip's (or
other vendors' products) may not install themselves properly with
newer MPLAB systems. In those cases, you may need an older MPLAB so
that the compiler tool installation procedure works as advertized. (3)
Older version of MPLAB include older versions of firmware for their
development tools, such as the Pro Mate II. If you want to follow
procedures written for the older firmware on such devices, you may
need an older MPLAB in order to access that firmware and download it
into the programmer tool.

There are probably other reasons, too. But if you don't have a
specific reason, including one of the above, then probably you are
better off with the newer version of MPLAB available. Certainly, you
do NOT want to go back to a version of MPLAB that doesn't support your
F84 chip, though. So whatever you do, make sure that your chip is
supported by the MPLAB program and your programmer tools.

It seems a lot of people prefer to use a stand alone text editor, I'd
welcome any advice as to which choice to make.

I use the built-in editor, usually. But I adapt easily to different
editing tools and don't have a penchant for using one particular
editor I like, when writing code. Being flexible that way, it doesn't
matter that much to me. I would recommend that you do what feels more
comfortable to you -- no one else can tell you what you will like or
won't. Just try a couple of ways and settle on one.

Jon
If I'm after ground shaking simplicity in an editor, how about the older DOS
edit in a command line window, which is very similar to the editor in the
user interface of an old Quickbasic compiler I might still have somewhere.

Then there's the old Debug program, which IIRC was for entering assy' into
the original PCs - pity I can't remember the commands & syntax!
 
Eeyore wrote:
Had a scrolling VFD in one of my 8051 designs as it happens.

A good programmer could have fixed that problem.



--
Service to my country? Been there, Done that, and I've got my DD214 to
prove it.
Member of DAV #85.

Michael A. Terrell
Central Florida
 
On Fri, 26 Oct 2007 20:34:27 GMT, "ian field" <dai.ode@ntlworld.com>
wrote:

If I'm after ground shaking simplicity in an editor, how about the older DOS
edit in a command line window, which is very similar to the editor in the
user interface of an old Quickbasic compiler I might still have somewhere.
Yes, in fact it is built from the same code base. (At some point in
time, I found and read a copy on the web of all the source to these
things including QBASIC.)

Then there's the old Debug program, which IIRC was for entering assy' into
the original PCs - pity I can't remember the commands & syntax!
Yes. I have a web page on the subject. Not a good one, but it would
be a start of some kind:

http://www.infinitefactors.org/jonk/x86lrn.html

Jon
 
On Fri, 26 Oct 2007 21:33:02 GMT, Jonathan Kirwan
<jkirwan@easystreet.com> wrote:

On Fri, 26 Oct 2007 20:34:27 GMT, "ian field" <dai.ode@ntlworld.com
wrote:

If I'm after ground shaking simplicity in an editor, how about the older DOS
edit in a command line window, which is very similar to the editor in the
user interface of an old Quickbasic compiler I might still have somewhere.

Yes, in fact it is built from the same code base. (At some point in
time, I found and read a copy on the web of all the source to these
things including QBASIC.)

Then there's the old Debug program, which IIRC was for entering assy' into
the original PCs - pity I can't remember the commands & syntax!

Yes. I have a web page on the subject. Not a good one, but it would
be a start of some kind:

http://www.infinitefactors.org/jonk/x86lrn.html
Sorry, I could have directed you a little better, by moving you to the
exact page where a small discussion takes place:

http://www.infinitefactors.org/jonk/x86lrn03.html

Jon
 

Welcome to EDABoard.com

Sponsor

Back
Top