Getting started with PIC chips
PIC components are made by Microchip Technologies Inc.
The chips can be programmed using a Basic-style language.
My development kit comprises the ISP-PRO
programmer and 0818
Development Board made by BasicMicro
and they operate some discussion forums to help beginners.
The Basic compiler software produces assembly
code, and hex code which is downloaded into the PIC chip..
My projects will mostly use the 16F628 and 12F675 chips - until they become obsolete. New and better PIC chips arrive quickly and the ISP-PRO should eventually be able to handle them too.
Most of the projects described here will
require serial-output from the PIC chip. If a PIC 12F675 is configured
to use its internal 4-MHz oscillator (rather than an external crystal)
and its serial-speed is to remain accurate, then it is necessary to either:
1. use the manufacturer's internal calibration
factor stored in the chip's penultimate EPROM location, or
2. add a best-guess serial-speed factor manually
in the code.
1. To use the manufacturers calibration factor:
READ the new chip before writing anything to it and note the hex values
at location 07FE and 07FF. Some examples: B0 34, A8 34. The first hex value
is the calibration value i.e. B0, or A8.
In the Basic code, add a line: osccal = $B0,
or osccal = $A8. This fine-tunes the internal oscillator. If there is no
34 value at location 07FF, the code has already been overwritten and the
calibration factor is lost.
2. A speed-value can be estimated by using a simple
PIC-Basic program which sends numbers into fleXYlog on the Newton.
The program beeps when the speed is inaccurate, and then displays a useable
calibration value without beeping.
Pic-Basic Code examples: