PIC16F1512 Program Copying With Seventeen ADC Channels

Small Flash, Wide Analog

The PIC16F1512 starts the 151x family at the small end: 2,048 words of flash (0x0000-0x07FF), 128 bytes of SRAM, twenty-five I/O lines on a 28-pin package, and seventeen channels of ten-bit ADC – an unusually wide analog front end for a 3.5 KB part. The generation adds the Complementary Waveform Generator (the family table’s “advanced control” column), two CCP modules, an EUSART and an MSSP. No EEPROM; instead the top 128 words of the array (0x0780-0x07FF) serve as the High-Endurance Flash window.

Lock And Sweep

CONFIG1 at 0x8007 with the single CP bit; ID at 0x8006. Rules:

– 0x0000-0x07FF: array, 0x000 under CP, 0xFFFF when erased. – 0x0780-0x07FF: HEF window, swept with the array. – Above 0x07FF: unmapped, 0x000.

The 2K boundary distinguishes the 1512 from the 4K PIC16F1513 in the same package. Both carry the same seventeen-channel converter, so the ID word at 0x8006 – not pin count – decides the sweep end.

Image Anatomy

A 1512 image is an analog scanner with a small brain: a seventeen-entry channel table, two-register results, averaging accumulators in the 128-byte SRAM, and trip decisions in software or via the comparators the family shares with the 150x line. The CWG setup appears whenever the board drives a power stage; the EUSART reports results upstream. Because the array is small, recovered listings are compact – every word can be reviewed manually, which makes verification unusually strong.

The Session

Identify via the ID word, read CONFIG1/CONFIG2, sweep 0x0000-0x07FF over two-wire ICSP, verify, deliver. Nothing is erased; the part returns to service. The HEF window gets separate annotation because calibration written at final test and field-updated parameters both live there – on a 2K part those 128 words are a significant fraction of the whole image.

Deliverables

HEX at word addresses, annotated disassembly with the scan table, CWG and HEF blocks labeled, configuration report, checksum tied to the die. Clone policy documented. For the larger members, see the PIC16F1513 and the 8K PIC16F1516 pages.

Two Thousand Words And A Complementary Waveform Generator

The PIC16F1512 is the smallest of the 151x line: 2,048 words of flash, 128 bytes of SRAM, 25 I/O pins in the 28-pin package, 17 ADC channels, two ECCP and two CCP, and a complementary waveform generator. The CWG is the notable block – it produces a dead-banded pair of outputs suitable for driving a half bridge, and it is why this small part appears in motor and lighting designs.

Dead Band Is A Design Number

The dead-band delay programmed into the CWG reflects the switching characteristics of the external transistors, not anything intrinsic to the microcontroller. Recovering it matters when a client rebuilds a board with a different FET: the value has to be re-derived, and knowing the original tells them what margin the designer had. The report records the delay, the polarity and the blanking source as separate fields.

– Flash: 0x0000-0x07FF (2K words), 0x3FFF erased, 0x0000 protected. – Configuration: 0x8007-0x8008, device ID 0x8006.

Small Array, Dense Peripheral Use

With only 2K words the firmware has to be economical, so the CWG, the ADC and the serial port share the same initialisation block and there is almost no code that is not in service. That makes the disassembly short enough to review line by line, and the deliverable can include a fully commented listing rather than a summary.

Output

HEX at word addresses, a fully annotated disassembly with the CWG and ADC setup called out, configuration report, checksum tied to the die.

Delivery

The CWG dead-band value is reported in nanoseconds as well as in register counts, since the register encoding depends on the oscillator frequency the design selected.

To book a 1512 recovery, use the services desk or the contact form.