Searching \ for '%Please help rookie with these two question%' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=please+help+rookie
Search entire site for: 'Please help rookie with these two question'.

_Sub string match.
PICList Thread
'[PIC]: Please help rookie with these two question'
2002\03\23@140700 by Jim Martin

flavicon
face
First:  What beginner's book do you recommend for entry level PIC
programming for the 16F84?

Second:  Is the 16F876 code-compatible with the 16F84?  Just wondering if I
should start with the '876 instead of the F84.

Thank you.....

Jim D. Martin

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\03\23@141323 by Herbert Graf

flavicon
face
> First:  What beginner's book do you recommend for entry level PIC
> programming for the 16F84?

       I found the 16F84 datasheet and MPLAB tutorial were enough for me.

> Second:  Is the 16F876 code-compatible with the 16F84?  Just
> wondering if I
> should start with the '876 instead of the F84.

       Pretty much, most of the 16F series is practically code compatible, the
only differences are in initializeation, some of them have peripherals that
are ON by default (ie. analog comparators), the datasheet mentions all of
this.

       As for which PIC you should start with I recommend the 16F628, it's cheaper
then any other flash part, has alot of good stuff (such as USART, internal
RC) and it has alot of I/O for it's size (16 pins can be used for input, 15
pins can be used for output). Thanks, TTYL

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\03\23@150700 by Olin Lathrop

face picon face
> First:  What beginner's book do you recommend for entry level PIC
> programming for the 16F84?

The 16F84 reference manual.  It tells you everything you need to know about
the processor.  You will also need to read the assembler manual and at least
skim thru the MPLAB IDE documentation.

However, the 16F84 is obsolete.  The 16F628 is does more, has the same
pinout, and costs less.  Again, the best way to learn any of the PICs is its
reference manual.  Each manual is self contained.

> Second:  Is the 16F876 code-compatible with the 16F84?

Mostly, at the source code level, but only if it is written properly.  If
you do boneheaded things like defining symbolic data memory locations by
EQUing them to hard constants then you are asking for problems.
Unfortunately many of the Microchip example code snippets do boneheaded
things.  Mircochip may be good at designing microcontrollers, but they don't
seem to be much good at programming them.

A/D and comparator modules are common causes of code incompatibilities
between chips.  All the chips that have analog inputs wake up with these
inputs set to analog.  If you want to use the pins for digital I/O, you have
to explicitly disable the analog module.  The 16F84 has no analog module, so
code that runs fine there won't on a 16F876 if it tries to use the analog
input pins as digital I/O.  Of course this is easy to get around, but I have
never seen a Microchip example that does so.

Other common differences are in the config word and the associated features,
like the oscillator setting.

> Just wondering if I
> should start with the '876 instead of the F84.

Yes, I think you should.  The 876 has more stuff, but you can mostly ignore
what you're not ready to play with yet.  The only exception is the A/D
module, which wakes up ON.  Until you are ready to play with the A/D, just
don't use the analog input pins.

I like starting with the '876 better because you get to see the bigger
picture even though you can still use a subset like what is in the '84.
This forces you to be aware of banking and paging right from the start
instead getting used to bad programming practices, then having to unlearn
them later.

I also think the 16F876 is the best all around hobbyist (yoo hav to spel
this wird rite arownd heer or yoo get arressted bie the spelling poleese)
PIC.  I would get few of those to get the first quantity price break.  The
16F628 and the 16F877 are options if you need smaller and larger packages.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, spam_OUTolinTakeThisOuTspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\03\23@152606 by Byron A Jeff

face picon face
On Sat, Mar 23, 2002 at 02:01:45PM -0500, Jim Martin wrote:
> First:  What beginner's book do you recommend for entry level PIC
> programming for the 16F84?

It's best to skip the 16F84. Microchip has pretty much succeeded in obsoleting
it with the features and price of the 16F627 and 16F628 chips. It's better
to start there.

I don't have a book recommendation for you unfortunately. There are any number
of online tutorials that'll get you started. I'm partial to Myke Predko's
online stuff. You can find a couple of introductory articles here:

http://www.rentron.com/Myke3.htm
http://www.rentron.com/Myke5.htm

There are also several dozen other PIC related articles on the site here:

http://www.rentron.com/pic.htm

I'd like to add a couple of comments related to the 16F84 to 16F627/8 upgrade.
First is that if the application isn't time sensitive (such as an asyncronous
serial interface) that the internal RC oscillator of the 16F627/8 preludes
having to use an external oscillator or resonator. Next is that one must be
acutely aware that one of the best new features of the 16F627/8 is the onboard
hardware USART. This means that one doesn't have to implement software UARTs
by hand. I find that a lot of 16F84 tutorials spend a lot of time discussing
how to build software serial routines for RS-232. The next thing is that
the 16F627/8 family along with the 16F87X family are low voltage programmable
so very cheap and simple programmers can be utilized to get started quickly.
My Trivial Low Voltage Programmer (TLVP) is a $10, afternoon project that'll
get you in the game quickly. Last on my list is that for programming hardware
USART the best software/tutorial going is Fr. Thomas McGahee's PICUART code.
I've seen problems dowloading it from his site (http://mcgahee.freeservers.com)
so I've made a copy available from my PIC site where the TLVP lives:

http://www.finitesite.com/d3jsys

Also you can find a description os Myke's book "Programming and Customizing
PICmicro Microcontrollers" on his site at http://www.myke.com where he has
a online chapter for your perusal.

>
> Second:  Is the 16F876 code-compatible with the 16F84?  Just wondering if I
> should start with the '876 instead of the F84.

I think you can pretty much get a consensus not to start with the 16F84. Yes
the 16F87X series is code compatible with the 16F84 and will port over with
a very few caveats such as variable starting address and that PORTA starts
in analog mode instead of digital mode.

But starting with the 16F84 means playing catchup later. There's much less of
a jump from the 16F62X family to the 16F87X chips.

Hope this gives you some insight.

BAJ

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\03\23@162929 by Pic Dude
flavicon
face
A slightly different perspective...

As a rookie myself, I believe that the 16F84 is a great chip to
start with, because there are lots of sample projects/code out on
the web to pick things up quickly.  You can just copy, compile
and test, then experiment with the code. At a few bucks each,
cost isn't much of a factor.

And if they're becoming obsolete, then perhaps they're less
than a few bucks now?

Get a very simple 16F84 programmer or get one that will handle
16F84 + others you think you will need.  I built a simple Tait
programmer and there was a simple wiring difference to handle
the 16F872's when I started playing with those.

Good beginning info and books...
       http://www.piclist.com/techref/piclist/begin.htm

Cheers,
-Neil.


{Original Message removed}

2002\03\23@163608 by Jinx

face picon face
> the 16F84 is a great chip to

> And if they're becoming obsolete, then perhaps they're less
> than a few bucks now?

Quite the opposite - suppliers around here have the F628
priced well below the F84, and it's been that way since the
F628 was introduced

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


'[PIC]: Please help rookie with these two questions'
2002\03\23@165311 by Shawn Mulligan

picon face
I agree that the 16F84 is an excellent chip to begin with. It comes in a
small package which fits nicely on a prototype board. It is very well
supported and easy to use. Programmers can be built easily by a beginner,
using very few components. Realistically, for $50 - $100 you could purchase
a couple of PICs, an LCD, keypad, LED's, support components and a few good
books. I would recommend Easy PIC'n and PIC'n Up the Pace. After you gain
some experience you might try Myke Predko book -- it's excellent to, yet it
may be too advanced for the absolute beginner. With a degree in computer
science, I find some of Myke's algorithms and approaches quite clever, yet
certainly not intuitive. The Easy PIC'n series doesn't attempt to optimize
code size or efficiency at the expense of clarity -- however successfully
manages to present many interesting projects and tutorials. That's my two
cents worth.
Shawn


{Quote hidden}

>{Original Message removed}

2002\03\23@225515 by Byron A Jeff

face picon face
On Sat, Mar 23, 2002 at 03:31:31PM -0600, Pic Dude wrote:
> A slightly different perspective...
>
> As a rookie myself, I believe that the 16F84 is a great chip to
> start with, because there are lots of sample projects/code out on
> the web to pick things up quickly.  You can just copy, compile
> and test, then experiment with the code. At a few bucks each,
> cost isn't much of a factor.

Two things. With a couple of very small exceptions the code works as is. Here
are the exceptions:

* If you're using PORTA you must turn the analog comparators off.
* You must move the beginning starting address of variables because of the
 new special purpose registers.
* Be aware that the last 16 bytes of every bank is shared. This is actually
 an advantage for interrupt code.

>
> And if they're becoming obsolete, then perhaps they're less
> than a few bucks now?

PICs have always had a small cost. But the 16F628 are about 60% the price of
a 16F84A.

>
> Get a very simple 16F84 programmer or get one that will handle
> 16F84 + others you think you will need.

Probably not as simple as a low voltage programmer for a 16F628 or 16F877.
At minimum you'll need either a split power supply or a regulator to drop
the 13V to 5V. Then you'll need an additional switch to switch between 13V and
0V on MCLR. My Trivial LVP programmer is trivial for a reason.

>  I built a simple Tait
> programmer and there was a simple wiring difference to handle
> the 16F872's when I started playing with those.

Agreed. In fact it's little more than a different wiring harness.

Now to the 16F628's advantages:

* More of every type of memory.
* Built in INTRC oscillator. For blinkly led type projects, you need nothing
 more than the chip and the LED. No external RC, resonator, or crystal.
* PWM, hardware USART, and capture compare modules.
* 3 timers. Very handy.
* The ability to get up to 3 extra I/O pins. Have you had the 16F84 project
 that would have been perfect if you could get just one extra input? Well
 with the 16F628 you can because MCLR, OSCIN, and OSCOUT can all be
 utilized as I/O.
* The aforementioned ability to be low voltage programmed.
* Runs 16F84 code essentially unmodified.
* It's cheaper. 'nuff said.

In fact the only one feature that it's missing is the ability to self program
its program memory like the 16F87X series.

I was a long time 16F84 user. The lack of hardware USART and timers really
cramps the 16F84's style. Programmers often have to go through contorsions
just to resolve simple issues where more hardware could easily resolve the
problem. the 16F628 still lets beginners start off simple and small, but
has the muscle to tackle bigger problems in a more straightforward fashion.

The 16F84 has no case. That's why Microchip themselves are trying to price
it into retirement.

BAJ
>
> Good beginning info and books...
>         http://www.piclist.com/techref/piclist/begin.htm
>
> Cheers,
> -Neil.
>
>
> {Original Message removed}

2002\03\23@231427 by Byron A Jeff

face picon face
On Sat, Mar 23, 2002 at 02:50:38PM -0700, Shawn Mulligan wrote:
> I agree that the 16F84 is an excellent chip to begin with.

I disagree.

> It comes in a
> small package which fits nicely on a prototype board.

The 16F628 comes in exactly the same package.

>It is very well supported and easy to use.

The 16F628 runs everything the 16F84 does with very minor modifications.

> Programmers can be built easily by a beginner,
> using very few components.

By utilizing low voltage programming, even simpler programmers with even fewer
components can be built for the 16F628.

Other than the fact that the existing 16F84 codebase obviously runs unmodified
on 16F84s, there is absolutely no advantage to using a 16F84 over a 16F628.

A lot of times begenners tend to focus on the starting line because that's
all they've seen. However anyone that sticks with it won't stay a beginner
and will start to tackle more challenging projects. The additional hardware
support of the 16F628 (USART, PWM, capture/compare, multiple timers, more
all around memory) will assist anyone who proceed beyond the basic blinky LED
type projects.

And it cost less. $6 for the 16F84A-20/P, $3.88 for the 16F628-20/P on Digikey.

Can anyone explain to me any advantage of the 16F84 over the 16F628 for
a beginner who hasn't purchased parts yet? Other than the sole reason I listed
above?

I truly think it's a disservice to advocate beginners starting in a smaller
box simply due to inertia. Simply put a beginner will have to learn more on a
16F84 to get over the initial hump. Hardware generally simplifies code. Less
hardware requires more complex code. Hardware can asyncronously handle
tasks without constant code intervention. Software often requires syncrony
and polling to keep track. Then it gets complicated by the fact that the 16F84
only has one timer, one puny 8 bit timer.

I advocate the better part.

BAJ


{Quote hidden}

> >{Original Message removed}

2002\03\23@235239 by Shawn Mulligan

picon face
Well, Ok then.


{Quote hidden}

> > >{Original Message removed}

2002\03\24@090622 by Olin Lathrop

face picon face
> * You must move the beginning starting address of variables because of the
>   new special purpose registers.

Or better yet learn to do it right from the start and use the linker.  That
way you won't care where general RAM starts, only what bank it is in.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, EraseMEolinspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\03\24@090631 by Olin Lathrop

face picon face
> I truly think it's a disservice to advocate beginners starting in a
smaller
> box simply due to inertia. Simply put a beginner will have to learn more
on a
> 16F84 to get over the initial hump. Hardware generally simplifies code.
Less
> hardware requires more complex code. Hardware can asyncronously handle
> tasks without constant code intervention. Software often requires syncrony
> and polling to keep track. Then it gets complicated by the fact that the
16F84
> only has one timer, one puny 8 bit timer.

I agree.  In fact I recommend beginners start with the 16F876 because it is
a full featured part in the smallest package such parts come in.  After
getting done with the Blinky LED project, most people will sooner or later
want an A/D, which the 16F628 doesn't have.  The extra few bucks for the
'876 is small even for amateurs compare to the cost of everything else, and
is offset by the fact that they are less likely to need different chips in
the future.

I think of it this way:  Start with and learn PICs using the 16F876.  If you
have a project where space is really tight, use the 16F628.  If you need
more I/O pins or more A/D channels, use the 16F877.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, RemoveMEolinEraseMEspamEraseMEembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\03\24@125025 by Bob Barr

flavicon
face
On Sun, 24 Mar 2002 08:48:37 -0500, Olin Lathrop wrote:

>> * You must move the beginning starting address of variables because of the
>>   new special purpose registers.
>
>Or better yet learn to do it right from the start and use the linker.  That
>way you won't care where general RAM starts, only what bank it is in.
>

Amen to that.
There is a slight problem with that recommendation, though. The step
from simple single-file absolute coding to relocatable coding looks
*much* bigger than it really is.
Most, if not all, beginners' tutorials are written using absolute
coding. Have you ever seen good tutorial on relocatable coding? There
may be a good one out there somewhere but, if there is, I've never
seen it.

Your .aspic templates make a great example for the more experienced
programmer but may be a bit overwhelming for the person just learning
how to do relocatable coding.
My own 'ah-ha moment' on relocatable coding occurred when I started
working with the Microchip example project for the 16C745/765 USB
chips. Incredibly, up to that point, I had been doing all of my PIC
coding in absolute code. Once I could see the whole process in use and
got a good feel for it, using the linker turned out to be a piece of
cake.

Regards, Bob

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\03\24@164615 by Olin Lathrop

face picon face
> >Or better yet learn to do it right from the start and use the linker.
That
> >way you won't care where general RAM starts, only what bank it is in.
>
> Amen to that.
>
> There is a slight problem with that recommendation, though. The step
> from simple single-file absolute coding to relocatable coding looks
> *much* bigger than it really is.

I don't have a good answer to that.  As you said, it may look much bigger
than it really is, but it's not much different from using any other linker.
I think the problem is not the few additional things you need to learn to
use the linker, but the fact that absolute code is even an option in the
first place.  As I've said before, Microchip seems to have smart EEs
designing their microcontrollers, but they don't seem to have real software
engineers thinking about how to use the microcontrollers and figuring out
what the tools should look like.  It feels like this is done by EEs that
have learned to program a bit, but don't know much about software
engineering.

Microchip has done a huge disservice to the world of firmware by even having
a non-linked mode of programming at all.  They then compounded their
stupidity with outright irresponsibility by writing all their examples in
absolute mode.  If the examples were written in relocatable mode we probably
wouldn't be having this discussion.  Absolute mode would be a curiosity of
the assembler for archaic reasons, and nobody would give it much thought.

Everybody just accepts that you need to use the linker to make an executable
when writing code for windows.  Nobody suggests you should start out in
absolute mode because it's "easier" for the beginner.

And let's get another thing straight while we're at it.  Using the linker
doesn't make
all the code "relocatable", it's only called that.  I've actually been asked
"how do you write an interrupt routine with relocatable code since it has to
start at fixed address 4"?  Using the linker only *allows* code to be
relocatable, but you can still force sections of code and data to specific
addresses, you just use different directives (another Microchip stupidity,
there is no reason ORG couldn't have pretty much the same meaning when using
the linker).

> Most, if not all, beginners' tutorials are written using absolute
> coding. Have you ever seen good tutorial on relocatable coding? There
> may be a good one out there somewhere but, if there is, I've never
> seen it.

I haven't seen one either.  Yet another reason not to use tutorials.  There
is still no substitute for sitting down and reading the damn manual!  Once
you've read the manual, you won't need a tutorial.  It's all in there, and
it's really not that hard to understand.  The PIC tutorials and intro books
just waste your time by slowing down the learning process at best, or teach
you bad habits at worst.  It seems too many people have come to expect an
"xxx For Dummies" book for whatever they are trying to learn as a substitute
for doing any real work to learn it.  That may be OK for some subjects, but
programming microcontrollers isn't for dummies, and in the end will take a
little time an effort to learn.

> Your .aspic templates make a great example for the more experienced
> programmer but may be a bit overwhelming for the person just learning
> how to do relocatable coding.

I agree.  They are not meant as introductory material, but I think the
concepts in them should be taught early on before bad habits to the contrary
are developed.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, RemoveMEolinspam_OUTspamKILLspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2002\03\25@102344 by Byron A Jeff

face picon face
On Sun, Mar 24, 2002 at 09:02:07AM -0500, Olin Lathrop wrote:
> > I truly think it's a disservice to advocate beginners starting in a
> smaller
> > box simply due to inertia. Simply put a beginner will have to learn more
> on a
> > 16F84 to get over the initial hump. Hardware generally simplifies code.
> Less
> > hardware requires more complex code. Hardware can asyncronously handle
> > tasks without constant code intervention. Software often requires syncrony
> > and polling to keep track. Then it gets complicated by the fact that the
> 16F84
> > only has one timer, one puny 8 bit timer.
>
> I agree.  In fact I recommend beginners start with the 16F876 because it is
> a full featured part in the smallest package such parts come in.  After
> getting done with the Blinky LED project, most people will sooner or later
> want an A/D, which the 16F628 doesn't have.  The extra few bucks for the
> '876 is small even for amateurs compare to the cost of everything else, and
> is offset by the fact that they are less likely to need different chips in
> the future.

That is certainly a valid argument. In fact I use 16F877 for pretty much that
reason, plus getting the extra I/O pins to boot.

But cost is one of the reasons I push the 16F628. The other is the form factor
just in case a beginner is using something prefabricated that's slotted for
a 16F84.

>
> I think of it this way:  Start with and learn PICs using the 16F876.  If you
> have a project where space is really tight, use the 16F628.  If you need
> more I/O pins or more A/D channels, use the 16F877.

No argument from me.

BAJ

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.



'[PIC]: Please help rookie with these two questions'
2002\05\07@230253 by Jesse Lackey
flavicon
face
I have to disagree with the Predko book recommendation, I've been using
it extensively and I have found it *rife* with errors.  I just spent the
last 2 hours trying to get serial port receive working, and the simple
sample code on page 236 (11 lines of code) has no less than THREE errors
in it.  Look it up on amazon.com and read the reviews submitted by
readers before you buy.

The most important thing for tech books is to be CORRECT.  You simply
cannot trust any of the code you see in this book.  1 in 10 or more
examples will not work due to typos (half the time) and logic/missing
code the other half.  You wind up scratching your head, getting rather
frustrated that something simple doesn't work, checking stuff with a
logic probe, reading microchip .pdf spec sheets, and then fixing his code.

jesse


Shawn Mulligan wrote:
{Quote hidden}

>> {Original Message removed}

2002\05\08@005832 by Michael Johnston

flavicon
face
I know what you mean. I have several books of mr prediko's i gave one to a
friend and bought the latest and greatest. To me He jumps around to much.
Dave Benson's
easy pic'n is better but it is really  for the rank amature and because most
of the ideas where done before the advent of mplab. I really havent found a
good book to really learn about the pics or any  other microcontrollers.
mike johnston
{Original Message removed}


'[PIC]: Please help rookie with these two questions'
2002\06\04@061620 by myke predko
flavicon
face
Hi Jesse,

Sorry, I've been lurking a bit (lots of other things going on).

The first printing of "Programming and Customizing PICmicro(R)
Microcontrollers" 2nd edition did have a lot of errors due to problems with
the editing process.  All the problems should have been resolved with the
current printings of the book.

I'm curious to know what are the three errors in the code on page 236?  I am
aware of one (a typo, "TCSTA" instead of "RCSTA" on the 7th line), but I
don't know about the other two.

myke
{Original Message removed}

2002\06\04@065325 by Vasile Surducan

flavicon
face
Hi friends, ( and Jesse too )
I was tempted to criticize also mr. Predko for some ( small )mistakes
founded in his book ( actually in the chapters he had amiability to show
us for free in his nice site ). I am assure you is much difficult to write
an error free technical book than to read it and found mistakes, right now
I'm in the same posture as a writer is... So please, don't blame too much
someone who has written an 1200 pages technically book, with programs,
PIC programators, basic compilers and so on.
My bitterness is just I can't read this book from the begining to the end.

best regards,
Vasile Surducan, senior researcher
INCDTIM
Romania
http://www.geocities.com/vsurducan




On Tue, 7 May 2002, myke predko wrote:

{Quote hidden}

> {Original Message removed}

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