PDK Programming Sequence v0.5
PDK Programming Sequence v0.5
PMC150C: http://www.eevblog.com/forum/blog/eevblog-1144-padauk-programmer-reverse-
engineering/msg2096917/#msg2096917
PFS154C: http://www.eevblog.com/forum/blog/eevblog-1144-padauk-programmer-reverse-
engineering/msg2113471/#msg2113471
No attempts have been made by me to reverse engineer any of the software provided by Padauk.
The information in this document is provided “as is”, without warranty of any kind.
Pinouts
ICPDA
ICVPP ICPCK
PMS150C protocol
Initial analysis of data logs.
From a first glance, the programming interface of the PMS150C seems to be a straight forward SPI interface.
MSB first, data is valid on rising edge of clk.
MOSI SCK
The pinout is as follows:
MISO VPP
Note: The PMS105C is a device with 13x1kbit memory and 13 bit instruction encoding.
Overview of dump2 – writing to previously programmed device
VPP =7.5 7.5 7.5 7.5 10.8 10.8 7.5 7.5 7.5 7.5 10.8 7.5 7.5
VDD =4.0 2.0 5.0 2.0 6.0 6.0 6.5 6.5 2.0 2.0 6.0 6.5 2.0
Command A7 A6 A6 A6 A7 A7 A6 A6 A6 A6 A7 A6 A6
Phase 0 1 2 3 4 5 6 7 8 9 10 11 12
Summary of all phases of the programming sequence (Dump 2)
Phase Command VDD VPP Description
0 A7 (Write) 4.0 V 7.5 V Read device ID. This is achieved by initiating a dummy write that is aborted before starting the actualy OTP programming
1 A6 (Read) 2.0 V 7.5 V Read instruction memory words 0x03F0-0x3FF at low VDD voltage corner. This region contains calibration data.
2 A6 (Read) 5.0 V 7.5 V Read instruction memory words 0x03F0-0x3FF at standard voltage corner. This region contains calibration data. (Should this be VDD=6.5V? May be a bug)
3 A6 (Read) 2.0 V 7.5 V Read instruction memory words 0x000-0x3EF at low VDD voltage corner. Dump of full memory.
4 A7 (Write) 6.0 V 10.8 V Write main memory region between 0x000-0x3EF. Only memory cells used by the program are written to.
6 A6 (Read) 6.5 V 7.5 V Read instruction memory words 0x03F0-0x3FF at high voltage corner for verification.
7 A6 (Read) 6.5 V 7.5 V Read main memory region between 0x000-0x3EF at high voltage corner for verification. Only previously written memory is read.
8 A6 (Read) 2.0 V 7.5 V Read instruction memory words 0x03F0-0x3FF at low voltage corner for verification.
9 A6 (Read) 2.0 V 7.5 V Read main memory region between 0x000-0x3EF at low voltage corner for verification. Only previously written memory is read.
10 A7 (Write) 6.0 V 10.8 V Write to 0x3F6/0x3F8/0x3FC/0x3FE to store clock calibration data and code checksum.
11 A6 (Read) 6.5 V 7.5 V Read instruction memory words 0x03F0-0x3FF at high voltage corner for verification.
12 A6 (Read) 2.0 V 7.5 V Read instruction memory words 0x03F0-0x3FF at low voltage corner for verification.
Note: For a fresh device, clock calibration takes place between steps 9 and 10.
Two additional phases are inserted (see dump 4).
Enter programming mode
Voltages are only adjusted to final target after sending command (step 6).
Steps 7-10 can be skipped if initial voltages are kept.
Note: Logic levels scale with Vdd. If varying Vdd is implemented, this
needs to be considered in the SPI interface hardware (buffer).
100µ 500µ
Enter programming mode with voltage adjustment and read/write phase
Data in/out
Command
Not on PulseView: SPI decoder uses VDD as CS (Active high). This will reset the bitcount when the MCU is reset and ensures proper decoding for magic word
Analog signal were converted to logic by using a threshold of 1.8V (3.3V logic) to also capture the regions with Vdd=2V
0xA5A5A5A6 key/command - read
The slave (MCU) pulls MISO down after clock 31. The pin floats before, which could suggest that the
programming logic is activated after 31 clocks. This may also suggest that only the LSB is actually used
for commands.
Phase 0 – Check device ID - Key-A7, Vdd=4 V, Vpp=7.5 V
32 bits magic key Master sends 26 Bits „0“ Master sends 12 bit „0“
=> 2x13 bit empty data word => Adress 0x000
Slave sends 12 bit response
Phase 0 is basically an incomplete write of 0x0000/0x0000 to 0x000. The write exection cycle is 0b101000010110
omitted to prevent the dummy data from actually being written. = 0xA16 device ID
The device ID is clocked out of MISO during the adress phase of the write. Not that the write execution
sequence is omitted so the actual
In principle, the device ID could also be read during a read phase. memory write is not started.
Sequence is identical for both previously programmed and clean device (logs 2 and 4)
Idcode is updated on falling edge! Delay 240-320ns.
Read sequence
Important !
The device ID is clocked out on MISO during the second adress phase of each read cycle.
This could be used instead of an aborted write sequence to read the device ID.
Bug or feature?
The MCU seems to send out information during adress cycles as well:
During the second adress cycle the device ID is sent.
Occasionally the MSB is set on MISO in subsequent adress cycles. Glitch? Parity information?
Write Sequence Part I
13 bits instruction word 0 13 bits instruction word 1 12 bits adress (even!) 1x‘0‘ -> first part of write execution
Sent by master on MOSI Sent by master on MOSI Sent by master on MOSI
Stretched clock cycle
The PMS150C seems to write two words of memory per write cycle. -> write takes place here
The write execution cycles takes approximately 500µs. Trailing zero bit
?
Device ID
The last write execution cycle simply ends with the H->L transition of SCLK.
The MCU will also output data on MISO during the write initiation cycle.
First adress cycle: The device ID is clocked out.
Subsequent cycles: The data and adress words of the previous cycle are repeated.
This may be a feature to verify the correctness of the written data without a separate read phase. However, it seems
that the current software is not making use of it since the information of the last write cycle is discarded.
Edit: As noted in the EEV forum, this is most likely just information that was clocked out from the SPI register
in the the previous cycle.
PFS154 protocol
Overview
PFS154
PA3 = ICPCK
PA5 = ICVPP
ICPDA
ICVPP ICPCK PA6 = ICPDA
VDD
The programming interface of the PFS154C as based on a serial interface with bidirectial data line. MSB first, data is valid on
rising edge.
The pinout is as follows:
The PFS154C is a device with 14x2kbit memory and 14 bit instruction encoding.
PFS154 full programming sequence overview
Phase 0 4 5 6 7 8
1 2 3
Command A6 A7 A6 A7 A6 A6
A6 A3 A6
Vdd 3.0 5.5 2.0 5.8 2.0 5.0
5.0 2.0 2.0
Vpp 5.5 7.5 5.5 7.5 5.5 5.5
5.5 8.0 5.5
PFS154 entry sequence
Each phase of the programming sequence is as follows:
Voltages are only adjusted to final target after sending command (step 6).
Steps 8-11 can be skipped if initial voltages are kept.
Note: Logic levels scale with Vdd. If varying Vdd is implemented, this
needs to be considered in the SPI interface hardware (buffer).
Entry mode is very similar to PMS150C. Main differences are marked in red.
Note: The most important factor to activate the programming mode is the difference between VPP and VDD during MCU reset.
-> VPP-VDD>=2V! If a higher VDD is used, also VPP needs to be increased accordingly.
E.g. VDD=5V and VPP=6V will fail to enter programming mode. The difference between VPP and VDD can be reduced after entry.
Full sequence
Command ´Data in/out
5 ms 10 ms
The entry key is 32 bit and is sent by the master directly after entering programming mode.
*The three dummy bits are usually „000“, except in phase 3 where they are „011“. Bug? No impact was observed when
changing these bits.
Erase Sequence
5 ms 5 ms
Erase sequence:
Entry key is 0XA5A5A5A3
Ramp to VPP=8V, Vdd=2V
Repeat 2x: (stretched clock 5ms, normal clock 2µs) -> 4 clock cycles in total
Read Sequence
8x 22µs