Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Beginning PICs

2 views
Skip to first unread message

bender

unread,
Aug 31, 2005, 10:07:44 PM8/31/05
to
I don't want to start a flame war - but need to ask - which would be a
good solution to begin PIC programming?
This would include not only the chip but the programmer & tools.
I would also like to learn an architecture that's fairly common in the
industry (Z8, 8051, 16XXX) or just let me know which controllers are
best for certain situations.

Kits are good too.

Any info would be great and price is a big consideration also.

Thanks,
Bender

bender

unread,
Aug 31, 2005, 10:14:02 PM8/31/05
to
BTW, I also have no knowledge of circuits (I know, I know, I'll get
there) so I'm looking for solutions with very limited soldering/building.

DirtDobber

unread,
Aug 31, 2005, 10:50:24 PM8/31/05
to
Why torture yourself with a PIC?
Start with Atmel AVR. Go to www.avrfreaks.net
Get WinAVR package for free. Contains free C compiler
that is a port of GCC. Get the STK500 kit.


"bender" <ma...@the-benders.com> wrote in message
news:QntRe.62315$Hx4....@twister.nyroc.rr.com...

Al Borowski

unread,
Aug 31, 2005, 11:51:32 PM8/31/05
to

I suggest you look into AVRs. They are much nicer to program and a bit
faster to boot.

cheers,

Al

Don McKenzie

unread,
Sep 1, 2005, 12:07:48 AM9/1/05
to
bender wrote:

have a look at:
http://www.dontronics.com/auto.html
this may help

Don...


--
Don McKenzie
E-Mail Contact Page: http://www.e-dotcom.com/ecp.php?un=Dontronics

RS-232 to VGA. Many resolutions http://www.dontronics.com/micro-vga.html
USB to RS232 Converter that works http://www.dontronics.com/usb_232.html


Mat Nieuwenhoven

unread,
Sep 1, 2005, 12:22:47 AM9/1/05
to

PICs are very cheap. There's a webring called piclist that has lots of info.
I don't know the AVRs but if you're in assembly programming PICs only have 30
odd instructions which are very easy to work with (IMHO). I use them for
low-level realtime stuff where cycles count. They do about 5M
instructions/second without overclocking. There's a free develeopment tool
from Microchip called MPLAB. I'm not sure there's a free C compiler, never
looked. There is a free other compiler called JAL which is Pascal-like (see
http://www.voti.nl/pic/index.html -> tools -> Jal).

Mat Nieuwenhoven


Michael Lange

unread,
Sep 1, 2005, 2:15:06 AM9/1/05
to
Mat Nieuwenhoven schrieb:

> PICs are very cheap. There's a webring called piclist that has lots of info.
> I don't know the AVRs but if you're in assembly programming PICs only have 30
> odd instructions which are very easy to work with (IMHO). I use them for
> low-level realtime stuff where cycles count. They do about 5M
> instructions/second without overclocking. There's a free develeopment tool
> from Microchip called MPLAB. I'm not sure there's a free C compiler, never
> looked. There is a free other compiler called JAL which is Pascal-like (see
> http://www.voti.nl/pic/index.html -> tools -> Jal).

There is cc5x, free for hobbyists, with some limitations (1k
instructions, but you can work around. Look: http://cc5x.de/Crack.html).
Support in MPLab is included.

Michael

Michael Lange

unread,
Sep 1, 2005, 2:42:14 AM9/1/05
to
bender schrieb:

> I don't want to start a flame war - but need to ask - which would be a
> good solution to begin PIC programming?

It's a good intention, but you can't prevent this. Be not frustrated ;-)

> This would include not only the chip but the programmer & tools.

That is my Prog-HW (Less than 10 € or $):
http://www.rotgradpsi.de/mc/picprog/picproge.html

A good and useful SW for many HW can be found there:
http://people.freenet.de/dl4yhf/winpicpr.html

The dev-suite can be downloaded from the microchip web site for free.
C-Compiler: cc5x for PIC 12F/16F or C18 (from Microchip) for 18F.
Some other languages are available.

> ...


> Kits are good too.
>
> Any info would be great and price is a big consideration also.

If you are a hobbyist, look around the web. There are many projects,
also some to realize a circuit for development. (But it's not my way.)

My best kit is a breadbord ;-)


More questions?
Michael

Leif Holmgren

unread,
Sep 1, 2005, 4:00:53 PM9/1/05
to
DirtDobber wrote:
> Why torture yourself with a PIC?

I agree fully with this. Many years ago I used Z80/8085, liked them.
More lately I used HC11, loved it. Then I needed something cheap and
small, found PIC and have regretted it since. When I have used up the
chips I have bought I will look at something different.

Donna and Ian

unread,
Sep 1, 2005, 4:37:46 PM9/1/05
to
Leif Holmgren wrote:

> I agree fully with this. Many years ago I used Z80/8085, liked them.
> More lately I used HC11, loved it. Then I needed something cheap and
> small, found PIC and have regretted it since. When I have used up the
> chips I have bought I will look at something different.

I looked back at a 16F628 project I wrote in assembler
in 2002 - a keyboard morse generator that decodes the
data and clock lines of a standard keyboard. What an
untidy mess of a chip - banked RAM, no way to pop the
return address off the stack just for starters.
I'm not far from testing a rewrite of it for the
68HC908, which is a joy to programme. I don't care
how efficient PICs can be - they're so ugly.

--
Ian Stirling, G4ICV, AB2GR, Long Valley, New Jersey, USA.
Email address is not valid: contact details are on that
domain's web site.

Eric

unread,
Sep 1, 2005, 4:49:42 PM9/1/05
to
I like the Z8 from Zilog. The eval kits are cheap <$50 on Digikey. And
the programmer & Complier come with the eval kit.

Zilogs App Notes are excellent aswell.

I've heard good things about AVR's too, but I have never used one.

Eric

Grant Edwards

unread,
Sep 1, 2005, 4:57:27 PM9/1/05
to
On 2005-09-01, Eric <ericjoh...@hotmail.com> wrote:

> I like the Z8 from Zilog. The eval kits are cheap <$50 on
> Digikey. And the programmer & Complier come with the eval kit.

Are there any Linux-hosted toolchains for the Z8?

> Zilogs App Notes are excellent aswell.
>
> I've heard good things about AVR's too, but I have never used
> one.

I've looked at the data sheets, and they seem pretty decent.
The gnu AVR toolchains is also supposed to be good.

--
Grant Edwards grante Yow! I know things about
at TROY DONAHUE that can't
visi.com even be PRINTED!!

Thomas Magma

unread,
Sep 1, 2005, 5:15:04 PM9/1/05
to
I'm a fan of the PIC. Mainly for cost reasons. I understand that there is
better microcontrollers out there but it's usually reflected in the cost.
Another reason I like the PIC is because they are so wide spread in use. You
ask a question about a PIC on the newsgroups and your almost guaranteed an
answer within ten minutes. Their new MPLAB simulator is free and fun to play
with, and it gives you a good understanding of how assembly language is
executed.

I think they are currently the number one selling micro. Surpassing Motorola
a few years back. So they must be doing something right.

Thomas

"bender" <ma...@the-benders.com> wrote in message
news:QntRe.62315$Hx4....@twister.nyroc.rr.com...

Jim Granville

unread,
Sep 1, 2005, 6:14:46 PM9/1/05
to
Leif Holmgren wrote:

There is more choice than there used to be, at the low end.

Now you have Atmel, Freescale, Philips, SiliconLabs, TI, ST, Zilog all
making usefull small, microcontrollers.
The most widely sourced 8 bit core is 80C51, with 5 of 7 of the above
offering 80c51 variants amongst their lineups.
In larger cores, ARM is the most widely sourced, with 5 of 7 of the
above also offering ARM variants.

-jg

DirtDobber

unread,
Sep 1, 2005, 9:36:08 PM9/1/05
to

"Donna and Ian" <i...@opus131.com> wrote in message
news:lYqdnaXzycA...@comcast.com...

> Leif Holmgren wrote:
>
>> I agree fully with this. Many years ago I used Z80/8085, liked them.
>> More lately I used HC11, loved it. Then I needed something cheap and
>> small, found PIC and have regretted it since. When I have used up the
>> chips I have bought I will look at something different.
>
> I looked back at a 16F628 project I wrote in assembler
> in 2002 - a keyboard morse generator that decodes the
> data and clock lines of a standard keyboard. What an
> untidy mess of a chip - banked RAM, no way to pop the
> return address off the stack just for starters.
> I'm not far from testing a rewrite of it for the
> 68HC908, which is a joy to programme. I don't care
> how efficient PICs can be - they're so ugly.

Other PIC 16 series torture methods:
o No way to read constant from FLASH other than a return literal (retlw).
Awkward at best.
o Bank switching of RAM to get to variables. Difficult to keep track of and
wasteful of FLASH and time.
o Multiply and Divide are not available in the most popular 16 series.
o Bank switch of FLASH not as bad as RAM bank switching, but a pain none the
less.
o Only one interrupt vector
o Only 35 instructions are to rudimentary. Use of Microchip supplied macros
highly recommended.

That said, their tech support is very good.


Stan

unread,
Sep 2, 2005, 3:51:30 AM9/2/05
to

"DirtDobber" <ddobber@abc123@.biz> a écrit dans le message de news:
c0ORe.3696$v83....@newssvr33.news.prodigy.com...

> Other PIC 16 series torture methods:
> o No way to read constant from FLASH other than a return literal (retlw).
> Awkward at best.
> o Bank switching of RAM to get to variables. Difficult to keep track of
> and wasteful of FLASH and time.
> o Multiply and Divide are not available in the most popular 16 series.
> o Bank switch of FLASH not as bad as RAM bank switching, but a pain none
> the less.
> o Only one interrupt vector
> o Only 35 instructions are to rudimentary. Use of Microchip supplied
> macros highly recommended.
>

This is relevant : it can be learned quickly ;-)
Too many instructions isn't good to.
--
-Stan


Wolfgang Mahringer

unread,
Sep 2, 2005, 3:59:04 AM9/2/05
to
Hi Tom,

Thomas Magma schrieb:


> I'm a fan of the PIC.

Me too :-)
And I want to throw in 3 more arguments:
1) I have never seen more ESD/spikes/bad supply robust micros
than the PICs, which makes it easier to do applications which
should *not* reset every now and then.
Forget that with AVRs. May be the main reason, PICs are
widely used in automotive areas.
2) Programming AVR chips is a mess. Once you muck up the
fuses, you have to tinker around to repair that.
*Much* easier with PICs.
3) Free C compilers are available for PICs. No need to bother
with banked RAM.

>>I don't want to start a flame war - but need to ask - which would be a good
>>solution to begin PIC programming?
>>This would include not only the chip but the programmer & tools.

I would install one of the free C compilers on top of MPLAB.
You should also purchase a ICD2 debugger (maybe there are
DIY projects also). This makes life much easier :-)

>>Kits are good too.
No need. A bit of breadbord and a soldering iron is all you need.

greetz,
Wolfgang

--
From-address is Spam trap
Use: wolfgang (dot) mahringer (at) sbg (dot) at

Grant Edwards

unread,
Sep 2, 2005, 8:08:18 AM9/2/05
to
On 2005-09-02, Stan <z.y....@wanadoo.fr> wrote:

>> Other PIC 16 series torture methods:

>> o Only 35 instructions are to rudimentary. Use of Microchip supplied

>> macros highly recommended.
>>
>
> This is relevant : it can be learned quickly ;-)
> Too many instructions isn't good to.

You don't _have_ to use all of the available instructions in an
architecture. If you feel you must, you can probably get by
using only 35 instructions on most processors -- you just end
up with less efficient code. ;)

--
Grant Edwards grante Yow! They don't hire
at PERSONAL PINHEADS,
visi.com Mr. Toad!

Andrew M

unread,
Sep 2, 2005, 8:37:39 AM9/2/05
to
--> 42
Andrew M

"bender" <ma...@the-benders.com> wrote in message
news:QntRe.62315$Hx4....@twister.nyroc.rr.com...

--> 42
Andrew M


mh...@hvc.rr.com

unread,
Sep 2, 2005, 8:44:23 AM9/2/05
to
I'll second the esd/spike/bad supply observation. I've even plugged
pics in backwards (Vcc pin to ground and the GND pin to +5 volts) and
had them survive. Never seen any other micro do that.

I'd look at the C18 compiler from Microchip. It's a little
non-standard, but it works. And the student edition is free. With C18
and MPLAB's simulator you can do a pretty good job of debugging before
you even think of loading code into a chip. Of course that limits you
to the 18Fxxx family of parts, but they are way easier to use than the
16Fxxx parts. Now if they would just do a 8 pin version...

regards,

Mark

DirtDobber

unread,
Sep 2, 2005, 9:55:19 AM9/2/05
to
I've used alot of different micros and never had problems with random
resets.
Only reason you might would be bad hardware layout or bad hardware design.

Messing with AVR fuses is trivial. Messing with PIC banking is a huge mess.
Did I mention PIC have very poor support for pointers while AVR was designed
for pointers.
Very important to write an efficient C compiler.

The only free C compilers for the PIC are toys. AVR has free GCC C Compiler
that is highly recognized.

"Wolfgang Mahringer" <yet...@gmx.at> wrote in message
news:y1TRe.2$J72.1...@news.salzburg-online.at...

Meindert Sprang

unread,
Sep 2, 2005, 10:26:14 AM9/2/05
to
<mh...@hvc.rr.com> wrote in message
news:1125665063....@g47g2000cwa.googlegroups.com...

> I'll second the esd/spike/bad supply observation. I've even plugged
> pics in backwards (Vcc pin to ground and the GND pin to +5 volts) and
> had them survive. Never seen any other micro do that.

I have seen an AVR (AT90S2313) survive that too.
I also have discharged myself with a very unpleasant spark to a 8051 in
operation. No problem either.

Meindert


Thomas Magma

unread,
Sep 2, 2005, 11:33:23 AM9/2/05
to

> o Only 35 instructions are to rudimentary. Use of Microchip supplied
> macros
> highly recommended.

This is one of the reasons I like the PIC when I design small timing
critical projects written in assembly. The PIC is extremely easy to keep
track of cycles, which is essential to my timing critical applications. I
was always taught that I RISC processor was superior to a CISC.

Here is part of a RISC definition I pulled off the web. "Reduced Instruction
Set Computer. One advantage of reduced instruction set computers is that
they can execute their instructions very fast because the instructions are
so simple. Another, perhaps more important advantage, is that RISC chips
require fewer transistors, which makes them cheaper to design and produce."

I think it's important that when one states his or her preference for a
certain microcontroller that they also state the type and size of project
they are working on. I love the PIC for the size and type of projects I have
worked on, but if I ever had to design a large complex project written is C
or better, I would more than likely shop around for the best solution, which
probably wouldn't be the PIC.

Thomas


Ian Bell

unread,
Sep 2, 2005, 3:56:32 PM9/2/05
to
Grant Edwards wrote:

> On 2005-09-02, Stan <z.y....@wanadoo.fr> wrote:
>
>>> Other PIC 16 series torture methods:
>
>>> o Only 35 instructions are to rudimentary. Use of Microchip supplied
>>> macros highly recommended.
>>>
>>
>> This is relevant : it can be learned quickly ;-)
>> Too many instructions isn't good to.
>
> You don't _have_ to use all of the available instructions in an
> architecture. If you feel you must, you can probably get by
> using only 35 instructions on most processors -- you just end
> up with less efficient code. ;)
>

What they fail to mention is that there are 35 instruction *types* but by
the time you multiply this by the various addressing modes you still end up
with well over 100. Take your average CISC micro and factor the
instructions by the various addressing modes and you end up with little
more than 35 instruction *types*. So it's just pico micro marketing hype.

Ian

Byron A Jeff

unread,
Sep 2, 2005, 8:00:37 PM9/2/05
to
In article <dfa73u$h43$1...@slavica.ukpost.com>,

Ian Bell <ruffr...@yahoo.com> wrote:
>Grant Edwards wrote:

>> On 2005-09-02, Stan <z.y....@wanadoo.fr> wrote:

>>>> Other PIC 16 series torture methods:

>>>> o Only 35 instructions are to rudimentary. Use of Microchip supplied
>>>> macros highly recommended.


>>> This is relevant : it can be learned quickly ;-)
>>> Too many instructions isn't good to.

>> You don't _have_ to use all of the available instructions in an
>> architecture.

>What they fail to mention is that there are 35 instruction *types* but by


>the time you multiply this by the various addressing modes you still end up
>with well over 100. Take your average CISC micro and factor the
>instructions by the various addressing modes and you end up with little
>more than 35 instruction *types*. So it's just pico micro marketing hype.

But the addressing mode issue isn't the same for the PIC.

PICs only have one address mode: direct addressing.

So none of the postindexed address with a base offset type stuff is available
on a PIC.

The only instruction variation is that a W and file-register based instruction
can select either W or the file-register as the destination target. So the
ADDWF instruction is directed addressed but can have either W or F as a target.

PICs have a form of indirect addressing. However, it is done by loading an
address register (FSR) and then accessing the target (INDF).

So it is truly a RISC instruction set at 35 instructions.

BAJ

Alex Gibson

unread,
Sep 2, 2005, 11:09:54 PM9/2/05
to

"Mat Nieuwenhoven" <mni...@dontincludethis.zap.a2000.nl> wrote in message
news:zavrhjqbagvapyhqrguvf...@news.text.chello.nl...

There is a free compiler from microchip for the 18f series
look for the student version(free).

Jal is very good as well.

For a non free but "cheap" c compiler picant / boostc www.picant.com
picant was 16f and only
boostc is 12f, 16f and 18f see
http://sourceboost.ipbhost.com/index.php?s=ea776dbd8b320379021939e2bbfb917a&showtopic=961

Avrs are pretty good as well.
avr gcc / win avr - port of gcc for avr - free

If you prefer basic there is the demo version of bascom avr.

Both chips are cheap and reasonably easy to use.

Find a project you want to build and go for it.

Alex


Tom

unread,
Sep 5, 2005, 5:24:41 AM9/5/05
to
>
> I have seen an AVR (AT90S2313) survive that too.
> I also have discharged myself with a very unpleasant spark to a 8051 in
> operation. No problem either.
>

This is a common misconception with ESD in which the device continues
working but with a greatly reduced lifespan. Of course I've never seen any
evidence that I've ever ESDed anything to death and I don't know of anyone
else who has. Perhaps the device's internal protections are now good enough
that ESD doesn't need to be worried about any more?


larwe

unread,
Sep 5, 2005, 6:45:33 AM9/5/05
to
> This is a common misconception with ESD in which the device continues
> working but with a greatly reduced lifespan. Of course I've never seen any
> evidence that I've ever ESDed anything to death and I don't know of anyone
> else who has. Perhaps the device's internal protections are now good enough
> that ESD doesn't need to be worried about any more?

If only that were true. I've spent several board spins on a recent
project trying to ensure that it would pass ESD testing (15kV spark
applied to all locations where a user's hand might be expected to touch
the board).

2Penny

unread,
Sep 5, 2005, 4:50:27 PM9/5/05
to
My first experience with the PIC was with a P18F452 on a PICDEM2+
board and a JTAG port device sold by Microchip under the name ICD2.
The equipment/chip didn't support stacks or computed GOTOs, but
overall it worked as well as the 68010 boards I'd made to do
other tasks developed with an older HP64000 emulator emulating
a 68000 processor. After translating a bunch of pseudo-code
meant to exercise a 68000 board into PIC language I'd found
a few problems and differences, but overall it wasn't that bad.

I'm presently using a PIC18F4431 to develop 3 phase center aligned
PWM project. The output works fine, but it needs amplification
and the input isn't connected to more than one potentiometer
at present. Furthermore I need to put a V/F algorithm in the
code that starts with V/F constant then moves to V constant.
I should probably make the oscillator on the wire-wrap board
out of something better than a 555, but, for the present, I don't
need more than an oscillator and 5 connections to an ICD2 to
program and run a bare board '4431.

The "system on a chip" idea is great as is the JTAG debugger
and not having to deal with back switching is a plus too.
The PIC18 series is a BIG leap forward, in terms of
programming, over previous PICs as is the ICD2 debugger/GUI.

Just my 2 cents worth

Allen Maroney

unread,
Sep 18, 2005, 12:57:03 PM9/18/05
to
I suggest working backwards. Ultimately, what do you plan on making or
working for? If your ultimate killer system will need 40MHz spped and
128K of program area, start learning a system that has a path meeting
those requirements. If you need low cost, 8K at 8MHz then your options
will be different. If you want to work for a company that use 68HC11s
using C, then that is your starting point.

This is like when someone asks should they get a Mac or PC. It depends -
what are you going to do with it?

0 new messages