Maker Pro
Maker Pro

Learning PIC - where to start?

P

Paul E. Schoen

Jan 1, 1970
0
Jan Panteltje said:
Naa jaa use an other programmer then.

I have used the old PICkit 1 for many small projects, and I like to use the
PIC16F684, which is 14 pin and has a PWM output, EEPROM, and other features
at a low cost. The PICkit 2 apparently has some debugging capability, but I
like the ICD 2 and MPLAB. If you damage the ICD 2, you can request a
replacement, and they will send you one practically overnight at no charge.
That is worth the extra cost for the genuine article, and they sometimes
have package deals for 1/2 price.

I am now using the PIC18F2450 and related parts, which have a USB interface
that is easy to implement with minimal external components. They have a USB
Framework, or Stack, that takes care of the low level stuff, and with their
PICDEM FS USB module (about $40) you can implement various USB peripherals
such as HID (mouse, keyboard), CDC (serial port), and mass storage devices.
There is also a bootloader so you can just create a hex file in MPLAB and
have the module load and run your new firmware through the USB port as a
virtual COM port.

And the PIC18F parts have a rich instruction set, lots of flash memory and
RAM, and are particularly suited to C programming (I have the Microchip C18
compiler). If you have room on your board and if a $6 part is in your
budget, it is a good choice. It comes in DIP and SOIC, which are easily
hand soldered, and even the TQFP-44 with 0.8 mm pitch can be hand soldered.

Paul
 
I

ian field

Jan 1, 1970
0
Dave Platt said:
Quite a few of the simple, inexpensive chip programmers don't have
provision for an external power source. They depend on being able to
"rob" power from the RS-232 interface (typically from the
output-handshaking pins e.g. DTR and RTS), and their circuitry depends
on their being able to get a high enough voltage from the pins. The
PIC chips typically require as much as 13.5 volts in order to program
their internal EEPROMs/flashes.

These programmers will typically not work correctly when connected to
a "fake" RS-232 interface - i.e. one which simply uses TTL/CMOS-
compatible voltages (0 and 5) rather than swinging at least 8 or 9
volts above and below ground.

Most USB-to-serial dongles use 5-volt signalling (since their power is
derived from the 5-volt USB bus). Many laptops also have low-voltage
serial interfaces. Port-powered programmers usually won't work with
either.

More complex programmers either use a separate power supply (e.g. a
15-volt "wall wart") or include a voltage-multiplier circuit. I
believe that the PicKit 2 and its clones use the latter approach.

The Velleman K8048 programmer has a power jack marked 15V, this feeds a
78L12 and a 78L05. It would have been a simple matter for the designer to
have made the unit fully RS232 compliant and/or suitably powered when
connected to a pseudo-232 from USB adapter.

AFAIK the incompatibility with a USB to RS232 adapter is due to cheap &
nasty driver software.
 
P

petrus bitbyter

Jan 1, 1970
0
ian field said:
The Velleman K8048 programmer has a power jack marked 15V, this feeds a
78L12 and a 78L05. It would have been a simple matter for the designer to
have made the unit fully RS232 compliant and/or suitably powered when
connected to a pseudo-232 from USB adapter.

AFAIK the incompatibility with a USB to RS232 adapter is due to cheap &
nasty driver software.

That Velleman kit does not contain a UART or similar serial device at all.
All serialising and timing is in the PC-software. An RS232-USB converter
will destroy the timing so it makes the programmer useless.

petrus bitbyter
 
I

ian field

Jan 1, 1970
0
petrus bitbyter said:
That Velleman kit does not contain a UART or similar serial device at all.
All serialising and timing is in the PC-software. An RS232-USB converter
will destroy the timing so it makes the programmer useless.

petrus bitbyter

So an RS232 programmer that could work on a USB adapter would most likely be
considerably more expensive than a native USB programmer.

My original point was that since newer PCs don't have RS232 or LPT ports its
best to avoid programmers that use these ports, in case you've forgotten
what the argument is about - someone suggested using an RS232 to USB
adapter, which in many cases won't work.
 
D

David L. Jones

Jan 1, 1970
0
Paul E. Schoen said:
I have used the old PICkit 1 for many small projects, and I like to use
the PIC16F684, which is 14 pin and has a PWM output, EEPROM, and other
features at a low cost. The PICkit 2 apparently has some debugging
capability, but I like the ICD 2 and MPLAB.

The PICkit 2 is much more versatile than the ICD2. Not only does it do
in-circuit debugging, but it can power your circuit with a software
programmable voltage, and act as a field prorgammer and logic analyser.
I sold my ICD2 and have changed to the "cheaper" PICkit2.

Dave.
 
C

Charles

Jan 1, 1970
0
Jon Kirwan said:
Charles, do you know much about this board? I just looked it over and
it is feature-rich. But one of the things that seems to really be a
problem is the mikroICD. It appears that it may only work with their
own software tools (not good, in my case) and I can't even tell if I
can use assembly coding only with it. They specify the compilers, but
not the assembler. Also, if I were to use it to program target boards
I make where I write my code using Microchip's C compiler, would that
be possible? I haven't yet seen a definitive answer, but what I have
seen concerns me a lot about that.

I evaluated it (only based on bang for the buck) for a company that was
considering entering the PIC development market. When we looked at its
features and cost, we decided to run away!

The LCD could be a problem. I don't have any more to offer about that or
other possible problems.

The value still impresses me. I would try one if I were developing PIC
products.
 
N

Nobody

Jan 1, 1970
0
I'm thinking about learning PIC programming, and would appreciate any
advice.

First, I'd like to thank everyone for their advice and comments.

For now, I'll get the PICkit2 starter kit. As for more involved demo
boards, I'll cross that bridge when I get to it.
 
J

Jasen Betts

Jan 1, 1970
0
Quite a few of the simple, inexpensive chip programmers don't have
provision for an external power source. They depend on being able to
"rob" power from the RS-232 interface (typically from the
output-handshaking pins e.g. DTR and RTS), and their circuitry depends
on their being able to get a high enough voltage from the pins. The
PIC chips typically require as much as 13.5 volts in order to program
their internal EEPROMs/flashes.

These programmers will typically not work correctly when connected to
a "fake" RS-232 interface - i.e. one which simply uses TTL/CMOS-
compatible voltages (0 and 5) rather than swinging at least 8 or 9
volts above and below ground.

Most USB-to-serial dongles use 5-volt signalling (since their power is
derived from the 5-volt USB bus). Many laptops also have low-voltage
serial interfaces. Port-powered programmers usually won't work with
either.

most havs a max-232 or other 5v to RS232 interface chip
in them but the +10V these chips produice is not enough for
programming the pic.
 
J

Jasen Betts

Jan 1, 1970
0
Well, the MAX<blah blah> can do everything including clean out the
kitchen sink, but try to *get* one!

max-232 unlike other maxim parts asily had, and also avalable
from TI.
 
I

IanM

Jan 1, 1970
0
Nobody said:
First, I'd like to thank everyone for their advice and comments.

For now, I'll get the PICkit2 starter kit. As for more involved demo
boards, I'll cross that bridge when I get to it.
You are happy with breadboarding stuff?

If so add a few DIL packaged PICs that support using the PICKIT2 as a
debugger to your order.

PIC16F88 - fits in a PIC16F84 socket and once you've turned off the new
ADC converter inputs, its fairly close to being code compatible (You
need to set two config words instead of one, User RAM starts at 0x20 not
0x0C and the internal data EEPROM is accessed via different port
addresses.) Its got a pretty comprehensive set of mid-range peripherals
built in. Better than a PIC16F628A because it has debug support!

PIC16F886 - 28 pin 0.3" DIL package available. Pretty much the same as
the PIC16F887 but fewer pins so more breadboard friendly. Debug support.

PIC16F887 40 pin 0.6" DIL package. Same chip as the SMD one on the
Debug Express board, but breadboardable.

If you have *any* interest in RS232 stuff make up a converter module
with a MAX232 or equivalent with a 9 pin D connector PC side and a 6 pin
header to plug into the breadboard. Pin 2 of the MAX232 outputs about
+10V and 'spare' handshake output lines like DSR should be tied high to
that via a 4.7K resistor. the MAX232 will convert RxD, TxD, RTS and CTS
to/from TTL inverted levels as required by the PIC UART. I've got
bicolour LEDs with 8.2K series resistors on those lines on the PC side
so that RED is line idle (SPACE) or handshake blocking and GREEN is
active data or handshake good (MARK). For testing, loop the TTL level
signals till you get successful echo. You can always leave the RTS and
CTS looped for no handshaking until you have basic success with the PIC
UART.

You will also need a 6 pin header, 6 individual wirewrap pins, some thin
heatshrink and 9" of 6 core small stranded cable preferably with a
simple primary colour code that gives you a black and a red wire and has
all the others easily distinguishable. An offcut of alarm cable is
perfect. These bits are to make up an ICSP cable to go from the
breadboard to the PICKIT 2. Don't make it longer than 9" or you may get
trouble with noise pickup.

Lastly, if using external power, be ****ing careful of ground loops and
power sequencing or you risk frying the PICKIT 2. The 'brains' are a
PIC18F2550-I/SO so if you are really accident prone, get one,
temporarily patch it to a 6 pin ICSP header 'dead bug' fashion using
some kynar or magnet wire and flash it with the PICKIT 2 firmware
(PK2V0nnnnn.hex from your PICKIT 2 program directory) so you have a
spare *before* you blow it up!
 
C

Charles

Jan 1, 1970
0
Snip
I noticed that all microcontroller pins are brought out to IDC header
pins. This would allow using Microchip's development tools for programming
the chip while retaining the features of the development board.

Stephen D. Barnes

Good point Stephen.
 
R

Rich Grise

Jan 1, 1970
0
The PIC is made by Arizona Microchip not Atmel - never mind, have another
bottle of whiskey.

No, the point is that the best way to learn about pic is to forget about
the PIC and learn about a proper processor, at which point you'll know
better.

Cheers!
Rich
 
R

Rich Grise

Jan 1, 1970
0
It must be true what they say about skunk-weed.

No, I'm a pot-sober stonehead! ;-P

I see that both of you have been totally overflown by my sardinic tone
here, and leapt to ad hominem, as is your wont.

Thanks for once again showing your true stripe,
Rich
 
H

Hammy

Jan 1, 1970
0
No, the point is that the best way to learn about pic is to forget about
the PIC and learn about a proper processor, at which point you'll know
better.

Cheers!
Rich

Odd for an improper processor it seems to be pretty popular. Comparing
stock and availability at distributors PIC's blow all of them away. So
this must mean your view is in the minority, albeit vocal which is
typical.
 
L

linnix

Jan 1, 1970
0
No, the point is that the best way to learn about pic is to forget about
the PIC and learn about a proper processor, at which point you'll know
better.

Cheers!
Rich

If you are heading to Atmel anyway, why 8051 instead of Avr?
 
V

Vladimir Vassilevsky

Jan 1, 1970
0
Rich Grise wrote:

No, the point is that the best way to learn about pic is to forget about
the PIC and learn about a proper processor, at which point you'll know
better.

I second your opinion. PIC is for perverts. Experience with PIC is brain
damaging. PIC forces the programmers to bend over mentally. After they
broke, they can see only PICs and think only in the PIC manner.

VLV
 
Top