Maker Pro
Maker Pro

Is PIC a good choice?

P

Padu

Jan 1, 1970
0
I'm a software engineer with some concepts in electronics and digital
electronics.

My new project involves software (my domain) and hardware. On the hardware
side, I'm contemplating using PIC as my microcontroller based on some things
I've already searched through the net, but before starting to commit
learning this, I'd like to ask if it is a good choice for my project, which
I will briefly describe below:

I will not mention trivial electronic components such as capacitors, power
supply, resistors, LEDs and so on, but I'll tell you the main components of
the system. The device is a gps logger, and it will have a GPS receiver, a
controller and a compact flash drive. The GPS receiver is a module,
therefore it is completely self contained, and the only thing I need to
provide it is power, ground and tap into the data pins. The
microcontroller's task is to get the data from the GPS module, usually a
string of 80 ASCII characters (or a binary word) and save it into the memory
stick, probably into a text file. I imagine that there's more to it, such as
file initialization, gps initialization, checking if the memory stick is in
the drive, if there is enough memory space to continue recording and etc,
but I think you got the idea.

So, is PIC ideal for this task? I saw a tutorial on the internet where a guy
uses a PIC controller to control a compactflash drive, but that was a very
brief overview. I'm planning to buy a book on the PIC subject, get a kit and
try some simpler examples first (leds and pushbuttons), but this is the app
I ultimately have in mind.

Thanks for the help
 
P

Padu

Jan 1, 1970
0
Thanks Mark, that was exactly the kind of information I was looking for.

The company I work has a "chip burner" but I don't know anything about it or
even if it would be compatible with the PIC pins. I'll try to get some
information on that.

I know the chipset we use (it's an ADC used in our audio device) can be
programmed either by that "machine" or by USB. Maybe this is a too dumb
question, but is there such a thing as a USB programmable PIC?

A C compiler would be heaven. I know regular (8088/80386) assembler, and
I've done some things for the Z80 (ok, I'm starting to reveal my age) but
that was a long time ago. Any disadvantage on using a C compiler?
 
P

petrus bitbyter

Jan 1, 1970
0
Padu said:
I'm a software engineer with some concepts in electronics and digital
electronics.

My new project involves software (my domain) and hardware. On the hardware
side, I'm contemplating using PIC as my microcontroller based on some things
I've already searched through the net, but before starting to commit
learning this, I'd like to ask if it is a good choice for my project, which
I will briefly describe below:

I will not mention trivial electronic components such as capacitors, power
supply, resistors, LEDs and so on, but I'll tell you the main components of
the system. The device is a gps logger, and it will have a GPS receiver, a
controller and a compact flash drive. The GPS receiver is a module,
therefore it is completely self contained, and the only thing I need to
provide it is power, ground and tap into the data pins. The
microcontroller's task is to get the data from the GPS module, usually a
string of 80 ASCII characters (or a binary word) and save it into the memory
stick, probably into a text file. I imagine that there's more to it, such as
file initialization, gps initialization, checking if the memory stick is in
the drive, if there is enough memory space to continue recording and etc,
but I think you got the idea.

So, is PIC ideal for this task? I saw a tutorial on the internet where a guy
uses a PIC controller to control a compactflash drive, but that was a very
brief overview. I'm planning to buy a book on the PIC subject, get a kit and
try some simpler examples first (leds and pushbuttons), but this is the app
I ultimately have in mind.

Thanks for the help

Well, ask a football supporter for the best team...
Allmost any type of micro will do and a PIC is a good choice. Whether it is
the best depends on the supporter you ask.

You can find a lot of info on the net along with free software and
programmer designs. Try for instance:
http://www.voti.nl/

petrus bitbyter
 
A

Al Klein

Jan 1, 1970
0
A C compiler would be heaven. I know regular (8088/80386) assembler, and
I've done some things for the Z80 (ok, I'm starting to reveal my age) but
that was a long time ago. Any disadvantage on using a C compiler?

I programmed Z-80s too - and 8080s and 4040s - (in assembler, of
course, and in octal at first), and I didn't find much problem in
learning to program PICs - except for "learning" the different
instruction set. (I still write my PIC code with the "book" open.)

Only 2 disadvantages I can see with using C:

1) Possible bugs in the compiler which, to fix, you'll need to know
assembler anyway.

2) MUCH "looser" code. No compiler can write code as tightly as a
human being, and a PIC has a lot less room than a Z-80 - so far.

Advantage? Ten lines of debugged code/day is a lot more productive if
the code is C than if it's assembler.
 
D

Don Taylor

Jan 1, 1970
0
Al Klein said:
Only 2 disadvantages I can see with using C:
1) Possible bugs in the compiler which, to fix, you'll need to know
assembler anyway.

Possible bugs in the assembler, possible bugs in MPLAB, possible bugs
with the the operating system fighting with the programming process...
possible bugs in the processor which, to fix you will need to know VHDL
to fix the chip?
the list goes on and on... but I'm not sure how substantal these are.
(actually bugs in getting two tools to work together is likely much more
of a problem than anything else, based in my experience in the business)
2) MUCH "looser" code. No compiler can write code as tightly as a
human being, and a PIC has a lot less room than a Z-80 - so far.

The perhaps relatively simplistic code that I've written with the
PICC compiler, and later looked fairly carefully at the assembly
listings, other that a couple very specific things, I could never
write assembly code as good as it generates, but maybe I've been
using a particularly good compiler.
Advantage? Ten lines of debugged code/day is a lot more productive if
the code is C than if it's assembler.

Advantage, not making the silly little addressing and opcode errors
that seem to be so common with folks who aren't pro's at the chip's
assembly code.

Disadvantage, having a much harder time being taken seriously if you
ask any of the assembly folks for help with a problem when you let
them know you aren't writing in assembly.
 
P

Padu

Jan 1, 1970
0
I'd say the PIC is certainly capable of doing the task you want. I've
seen projects (on the net) that do all the pieces of your project
using a PIC. I use PICs in a lot of my projects (professional and
personal) and find them pretty simple to use.

I'm reading a PIC book that I found online (www.mikroelektronika.co.yu) and
so far it's pretty simple. I've already downloaded MPLAB and did a couple of
example programs.
Unless you really need to use assembler, I'd look at some of the C
compilers available for PICs (I'm assuming you know C). My favorite at
the moment is CCS (www.ccsinfo.com), but there are others available.
You'll probably wind up buying a compiler and some kind if
in-circuit-debugger (ICD). I haven't found a free compiler that does
decent source level debugging using an ICD.

Thanks for the info, either assembler or C are fine with me. I believe I
will use assembler on the initial phase and I'll probably use C later for
improved development productivity.
Microchip (and many others) has a couple of good demo boards that you
might find useful for learning/prototyping. I've found their PICDEM2
board to be pretty nice to work with, especially if you need an LCD
display.

I saw this PICDEM2 but it's out of order, they have a PICDEM2 Plus. I don't
know if I understood right, but it seems like it comes with two
microcontrollers, one PIC18F452 and one PIC16F877, here is the link:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&
dDocName=en010072&part=DM163022
I found it for $99, which I think is a good price. Would you agree?

Mikroelektronika also sells some kits (easypic), and what attracts me most
is that they also sell an optional compactflash card reader/writer for $18.
Exactly what I need for my application. I don't know if Microchip has such
thing.

If you haven't decided on a particular PIC yet, look at using flash
parts. They work with an ICD, are easy to program and erase, etc. I'd
look at the 18Fxxxx series of parts. They typically have more RAM/ROM
than the 16Fxxxx series parts, better I/O, lower power consumption,
etc. And they are sometimes cheaper than the equivalent 16Fxxxx part.

Thanks for the hint, I feel kind of lost with so many options.

Of course you don't need to use a PIC. There are lot's of other
microcontrollers out there that can do the project you describe. Some
even have decent GNU C compilers available (atmel AVR for example).

The GPS module I want to integrate is made by atmel, do you think I would
have any advantage using AVR over PIC for that reason?

I have many years of development experience, but mainly on high level
languages. Having to roll my sleeves and scrub bits is giving me lots of
pleasure. I can do the best of the GUI's, but I don't know why I get so
excited with the idea of making a LED go on and off!


Thanks again

Padu
 
A

Alex Gibson

Jan 1, 1970
0
Padu said:
The GPS module I want to integrate is made by atmel, do you think I would
have any advantage using AVR over PIC for that reason?

Probably not.

For AVRs have a look at www.avrfreaks.com
http://www.avrfreaks.net/Freaks/ need to join, its free

These pages have some pretty interesting avr projects
http://instruct1.cit.cornell.edu/courses/ee476/FinalProjects/
http://instruct1.cit.cornell.edu/courses/ee476/

Also have a look at the Atmel journals.
http://www.atmel.com/journal/

Alex
 
A

Al Klein

Jan 1, 1970
0
Possible bugs in the assembler, possible bugs in MPLAB, possible bugs
with the the operating system fighting with the programming process...
possible bugs in the processor which, to fix you will need to know VHDL
to fix the chip?
the list goes on and on... but I'm not sure how substantal these are.

Many C compilers have (or have had) known bugs (see one series of
compilers written by a company owned by a very wealthy individual),
which could be fixed in the assembly code they output. There are no
known bugs in current PIC assemblers of which I'm familiar. An
assembler is a trivial translation program (anyone with a chart, a
legal pad and a pencil can do 2-pass assembly). A C compiler isn't.
The perhaps relatively simplistic code that I've written with the
PICC compiler, and later looked fairly carefully at the assembly
listings, other that a couple very specific things, I could never
write assembly code as good as it generates, but maybe I've been
using a particularly good compiler.

Or maybe you're a not particularly good assembly programmer. Most
experienced assembly programmers can optimize better than most C
compilers.
Advantage, not making the silly little addressing and opcode errors
that seem to be so common with folks who aren't pro's at the chip's
assembly code.

Assuming competence that's a non-problem. Assuming incompetence
there's a problem with any job.
Disadvantage, having a much harder time being taken seriously if you
ask any of the assembly folks for help with a problem when you let
them know you aren't writing in assembly.

Only those who haven't yet grown up. Most of us who have ("us"
meaning anyone with knowledge of any subject) are willing to teach
anyone willing to learn.
 
Top