September
1998, Issue 98
PIC'Spectrum
Audio
Spectrum Analyzer
YOU
SAY PIC17C756?
Before
getting into more details about PICSpectrum (see
Photo 1), lets have a look at the PIC17C756 and
its stripped-down version, the PIC17C752. These new
fully static CMOS chips are an enhancement of the existing
PIC17C4X family.
|

Photo 1The
PICSpectrum prototype is built on a 1"
× 3" PCB. A good ground plate is mandatory
on a mixed digital/analog design like this one.
I used a transparent box to prove that there are
very few components inside.
|
The
microcontroller core runs up to 33 MHz, giving a 121-ns
instruction cycle. These chips are pure RISC design,
and thanks to the two-stage pipeline, each instruction
executes in only one cycle, except program branches
and table reads/writes, which are two cycles long. That
makes it near 8 MIPSnot bad for a microcontroller.
The
58 single-word instructions (coded on 16 bits) are easy
to learn for any user of Microchips smaller controllers.
Direct, indirect, and relative addressing modes are
supported. External interrupts are present, as is a
16-level hardware stack.
One
interesting feature for compute-intensive applications:
there is an integrated 8 × 8 bit hardware multiplier,
working in only one instruction cycle. This multiplier
offers a performance boost of more than three times
(compared to a software-only version) for a complete
FFT calculation.
The
internal memory is impressive as well. The PIC17C756
has 16 K words of EPROM program memory as well as 902
bytes of general-purpose RAM, which accommodates quite
large projects without the need of external memories,
even if extended modes are available and support up
to 64 K words of program memory.
The
smaller PIC17C752 has only 8 K words of EPROM and 454
bytes of RAM. Microchip has also announced flash-memory
versions (PIC17F75X). The memory map is shown in Figure
2.
|

Figure 2From
this memory map of the PIC17C756, you see that
the program and data areas are separated, as usual
on a Harvard architecture. The 17C752 has
the same memory map, except that there is only
8 KB of user program memory and two user RAM banks.
|
One
piece of bad news: the RAM and registers are still banked,
and the working page is selected by some bits in the
BSR register. Even if some specific assembler instructions
help, this is a major headache for the programmer and
a major source of bugs. I hope that Microchip switches
to a linear address mode in the near future.
Hosted
in 64- (DIP) or 68-pin packages (PLCC and TQFP), the
PIC17C75X provides 50 I/O pins with individual direction
control. As usual, each pin may be used for general-purpose
I/O or dedicated to some on-chip peripherals.
Have
a look of the pinout of the PLCC version in Figure 3 and youll understand that this chip is quite
flexible. Both OTP and windowed versions exist, even
if they arent so easy to find.
On
the peripheral feature list, there are four timers (two
16 bits wide and two 8 bits wide, TMR0 having an internal
8-bit programmable prescaler), four capture input pins,
and three PWM outputs with a 10-bit resolution.
Need
more? Perhaps two asynchronous and one synchronous serial
port, the latter configurable both in SPI and I2C modes,
master or slave? Or a 12-channel 10-bit ADC? Or an RC-clocked
watchdog timer?
How
about an integrated supply-voltage supervision? Or a
configurable RC/crystal/ceramic clock system with an
oscillator start-up timer? Name it, and its probably
there.
The
PIC17C756X also has in-circuit programming hardware.
By pulling the TEST and MCLR/VPP pins to a 13-V programming
voltage before powering up the chip, a specific ROM
bootstrap code is launched and waits for orders coming
from a dedicated serial synchronous interface (RA1/RA4/RA5
pins).
With
a small interface connected to the LPT port of your
favorite computer, you can read or write the internal
EPROM without any specific programmer and without having
to extract the chip from its socket.
I
developed my own PC-based in-circuit programmer based
on Microchips programming specifications [2].
Electrically,
the standard-grade PIC17C756 needs a supply voltage
from 4.5 to 6.0 V, while a special extended device (PIC17LC756)
accepts anything from 3.0 to 6.0 V. In both cases, the
minimum RAM retention voltage is 1.5 V.
The
supply current is 6 mA at 4 MHz but climbs to 50 mA
at 33 MHz. Of course, sleep modes reduce consumption
down to 1 ľA, depending on the selected peripherals,
but high performances and low consumption are still
difficult to conciliate.