PIC18F4539: When the Silicon Revision Changes the PWM

This part is marked not recommended for new designs, which means the boards in service were built over a long window and do not all contain the same silicon. A dump that is byte-identical can still behave differently on a different revision — and the rev ID is one address away.

The PIC18F4539 is the 24 KB member of the PIC18FXX39 family: 12,288 instruction words, 1,408 bytes of SRAM, 256 bytes of data EEPROM, 32 I/O pins, eight channels of 10-bit ADC, two 10-bit PWM modules, and a single-phase induction motor control kernel. It comes in 40-pin PDIP and 44-pin TQFP and shares DS30485 with the 12 KB PIC18F4439.

What NRND Means for a Rebuild

A part marked not recommended for new designs is still in production and still orderable in some packages, but no longer the subject of active silicon work. Boards built with it span a decade or more, and over that window the die went through revisions with errata published for each.

The published errata for this family includes a Timer1 module erratum, DS80329 — and Timer1 is the time base the PWM period is derived from.

So when a rebuilt board shows jitter, come to the conclusion “the dump is bad” last, not first.

The Address That Settles It

Every PIC18 device answers at 0x3FFFFF with its silicon revision. It is not protected, it is not in flash, and it is readable with the same command that reads the device ID at 0x3FFFFE.

Read both, from the donor and from the part you are programming:

Address Content Why it matters
0x3FFFFE Device ID Confirms 4539 rather than 4439 or 2539
0x3FFFFF Revision ID Confirms the same silicon generation

If the two revision IDs differ, you are not doing a like-for-like replacement. That is not necessarily fatal — the instruction set is the same and the peripherals are the same — but it changes what “working” means. Compare behaviour, not bytes.

Errata Workarounds Are in the Code

Here is the part that makes this practical. When a silicon erratum needs a software workaround, the workaround is in the firmware: a specific sequence of register writes, a delay loop, a re-read of a status flag.

A dump taken from a board with revision A contains the workaround for revision A. Program it onto a revision B5 die and the workaround is either unnecessary — harmless — or actively wrong, because it manipulates a register whose behaviour changed.

The observable symptom depends entirely on which erratum is involved. On a PWM part the two most likely are:

  • Period jitter. The duty cycle is right on average and unstable cycle to cycle. Shows up as acoustic noise or as a current waveform with sidebands.
  • Dead-time asymmetry. One half-bridge switches slightly later than the other. Shows up as uneven heating between the high and low side devices.

Both look like a bad rebuild. Neither is.

What the Kernel Does and Does Not Do

The ProMPT block generates the variable-frequency waveform in hardware from a voltage-versus-frequency curve that firmware writes. The curve, the ramp rate and the protection thresholds are in flash and come out with the read.

What does not come out is the *tolerance* the designer worked to. A curve written for one revision may sit closer to a timing edge than the same curve on another, so a 24 KB image that is 100 percent correct at the byte level can run at 95 percent of the intended margin.

Which is why the acceptance test for an obsolete motor drive should be thermal and acoustic, not a byte comparison. Run both under load for an hour and compare heatsink temperature; a few degrees of difference means the timing is not equivalent.

Scope

A 4539 job is the 24 KB flash in four protection blocks, twelve configuration bytes at 0x300000, 256 bytes of EEPROM at 0xF00000, and both IDs at 0x3FFFFE and 0x3FFFFF. Add the chip extraction analysis note if the board is going back into service rather than onto a bench.

Two units from the same production run are worth more here than on any other part in this series: they tell you whether the fleet is homogeneous or was revised mid-life, which determines whether a rebuild is a copy or a re-engineering job.

Reading the memory out of an obsolete controller is routine, and the reading the memory page covers the sequence. The frequently asked questions page covers obsolescence questions specifically, and the services page lists what each route includes. If the drive is the only one of its kind and the line has to keep running, say so — it changes the acceptance criteria.