Electronic Name Badges.

phiscock-g851W1bGYuGnS0EtXVNi6w at public.gmane.org phiscock-g851W1bGYuGnS0EtXVNi6w at public.gmane.org
Mon Feb 19 04:10:07 UTC 2007


> I won't get in to why I prefer AVR's over
> PIC's as the reasons won't mean much to a lot of people on this list.
>
OK, I'll do that ;). Actually, I think it's relevant - it's a computer
architecture issue.

I used the PIC in an early version of the open-instrumentation hardware,
and came to regret it. We've since switched to Atmel microprocessors. Here
are the reasons:

The PIC has a limited instruction set, which Microchip (in a brilliant
piece of marketing) claim is a virtue - you have fewer instructions to
learn. However, after using the Motorola 68HC11 CISC instruction set,
coding the PIC is like coding in binary. It takes many more instructions
to do each task an the code is unreadable a week later. Of course, you can
work in a high level language - and with the PIC, it's almost required.
But, again in my experience, in an embedded application you frequently
need to do things at the machine level, so you have to deal it assembly
language instructions anyway.

Furthermore, the PIC uses banked registers and segmented memory. You have
to be very careful to ensure you're using the correct bank and the correct
segment and, in some cases, you have to switch back and forth - which
costs in instructions and speed.

As an exercise, write a routine to output a string to a display. On the
PIC, it's a terrible, obscure kluge.

In their favour, Microchip do support the PIC very well, they have
marketed it brilliantly, there is a lot of supporting literature available
and the tools are fine. But this doesn't make up for the limitations of
the machine itself.

In contrast, the Atmel devices are much more like the 68HC11. They have an
extensive CISC instruction set, a flat memory space and all registers are
visible without bank switching. There is very little if any difference in
price between Atmel and PIC and Atmel have all the usual nice features:
A/D inputs, timers, on-board EEPROM and Flash, I/O ports and so on. And
their  literature and tools are excellent as well.

Interestingly, the 68HC11 is still an excellent machine to learn on
because it can easily be set up to have a monitor program in its 64k
memory space that will do breakpoints, dump memory and generally allow for
interactive control of the machine. That sort of thing is difficult with
any of the single-chip microprocessors because the available memory space
is typically 4k of flash. (Disclosure: we developed a 68HC11 board that is
used at Ryerson and community colleges.)

-- 
Peter Hiscocks
Syscomp Electronic Design Limited, Toronto
http://www.syscompdesign.com
USB Oscilloscope and Waveform Generator
647-839-0325

--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list