Maker Pro
Maker Pro

PIC Assembler.

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
 
I

ian field

Jan 1, 1970
0
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.
 
A

Anthony Fremont

Jan 1, 1970
0
ian said:
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.
 
S

steamer

Jan 1, 1970
0
--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.
 
I

ian field

Jan 1, 1970
0
Anthony Fremont said:
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.

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.
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.

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!
 
A

Anthony Fremont

Jan 1, 1970
0
ian said:
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

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.
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.
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!

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.
 
E

Eeyore

Jan 1, 1970
0
ian said:
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
 
A

Anthony Fremont

Jan 1, 1970
0
Eeyore said:
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.
 
E

Eeyore

Jan 1, 1970
0
Anthony said:
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.

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
 
I

ian field

Jan 1, 1970
0
Anthony Fremont said:
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.


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.

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'.
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.

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
need a programmer at all, just a serial connection to the board.


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.

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

Tim Wescott

Jan 1, 1970
0
Eeyore said:
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
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.

--

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
 
I

ian field

Jan 1, 1970
0
Eeyore said:
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.

Its better than raw binary.
 
I

ian field

Jan 1, 1970
0
Tim Wescott said:
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.

Thanks.
 
E

Eeyore

Jan 1, 1970
0
Tim said:
Several reasons:

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
 
E

Eeyore

Jan 1, 1970
0
ian said:
Its better than raw binary.

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

Graham
 
J

John Fields

Jan 1, 1970
0
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.
 
J

John Fields

Jan 1, 1970
0
Who said anything about C ? Blech !



Who said anything about C ? Blech !



Who said anything about C ? Blech !



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

Anthony Fremont

Jan 1, 1970
0
Eeyore said:
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. :-/
Not sure. I think there's some 'PIC BASIC' out there too.

There sure is and it's far from free.
 
A

Anthony Fremont

Jan 1, 1970
0
ian said:
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'.

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.
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.

It'll probably work fine. I believe I built a Velleman kit for Atmel parts.
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.
 
Top