3.10.12.6 High-Voltage Serial Programming

The High-Voltage Serial Programming (HVSP) mode allows memories, fuses and lock bits to be programmed. To enter the HVSP mode, a special test signature has to be applied on the ATA8510/15.

Figure 3-97. High-Voltage Serial Programming Connection
Table 3-116. Pin Mapping for HVSP

Symbol

Pins

I/O

Description

NRESET

PC0

I

External Reset

TEST_EN

TEST_EN

I

Test Enable

TESTSIG0

PC2

I

Test Signature Bit 0

TESTSIG1

PC3

I

Test Signature Bit 1

TESTSIG2

PC4

I

Test Signature Bit 2

TESTSIG3

PB7

I

Test Signature Bit 3

SCI

PC1

I

Serial Clock Input

SDI

PB2

I

Serial Data Input

SII

PB3

I

Serial Instruction Input

SDO

PB1

O

Serial Data Output

Entering the High-Voltage Serial Programming Mode

The following algorithm is recommended for entering HVSP mode:

  1. Set all test signature pins (TESTSIG0 … TESTSIG3) to ‘0’.
  2. Set NRESET and TEST_EN pins to ‘0’.
  3. Apply 2.4-5.5V between VS and GND.
  4. Wait 1-4 ms.
  5. Set TEST_EN to 2.4V – 3.3V and NRESET to VS (HIGH). The TEST_EN pin is damaged if voltages higher than 3.3V are applied. A lower voltage than the voltage on VS shall be used for TEST_EN. VS_PA must be set to the same voltage as TEST_EN.
  6. Keep the test signature pins unchanged for at least 10 µs.
  7. Release all test signature pins.
  8. Execute the desired HVSP commands.
  9. Exit programming by powering down the device.

Considerations for Efficient Programming

The loaded command and address are retained in the device during programming. For efficient programming, the following items must be considered:

  • The command only needs to be loaded once when writing or reading multiple memory locations.
  • Skip writing the data value 0xFF because this is the content of the entire EEPROM (unless the EESAVE fuse is programmed) and Flash after a chip erase.
  • The address high byte only needs to be loaded before programming or reading a new 256-word window in Flash or 256-byte EEPROM. This consideration also applies to reading signature bytes.

Chip Erase

The CHIP ERASE command erases the Flash, the EEPROM and the lock bits. The lock bits are not reset until the program memory is completely erased. The fuse bits are not changed. A chip erase must be performed before the Flash and/or EEPROM are reprogrammed.

The EEPROM memory is preserved during chip erase if the EESAVE fuse is programmed. The following procedure describes how to execute a “chip erase”:

  1. Load the CHIP ERASE command (see Table 3-115).
  2. After instruction 3, wait until SDO goes HIGH for the chip erase cycle to finish.
  3. Load the NO OPERATION command.

Programming the Flash

The Flash is organized in pages, see the In-System Re-programmable Flash Program Memory (ATA8510). When programming the Flash, the program data is latched into a page buffer. This allows one page of program data to be programmed simultaneously. The following procedure describes how to program the entire Flash memory:

  1. Load the WRITE FLASH command (see the following table)
  2. Load the Flash page buffer.
  3. Load the Flash high address and program page. After instruction 3, wait until SDO goes HIGH for the page programming cycle to finish.
  4. Repeat 2 through 3 until the entire Flash is programmed or until all data is programmed.
  5. Terminate page programming by loading the NO OPERATION command.

When writing or reading serial data to the ATA8510, data is clocked on the rising edge of the serial clock.

Programming the EEPROM

The EEPROM is organized in pages as described in the EEPROM Data Memory. When programming the EEPROM, the data is latched into a page buffer. This allows one page of data to be programmed simultaneously. The programming algorithm for the EEPROM data memory is as follows (see the following table):

  1. Load command “Write EEPROM”.
  2. Load EEPROM page buffer.
  3. Program EEPROM page. Wait after Instruction 2 until SDO goes high for the “Page Programming” cycle to finish.
  4. Repeat instruction 2 through 3 until the entire EEPROM is programmed or until all data is programmed.
  5. Terminate page programming by loading command “No Operation”.

Reading the Flash

The algorithm for reading the Flash memory is as follows (see the following table):

  1. Load the READ FLASH command.
  2. Read the Flash low and high bytes. The contents at the selected address are available at serial output SDO.

Reading the EEPROM

The algorithm for reading the EEPROM memory is as follows (see the following table):

  1. Load the command “Read EEPROM”.
  2. Read EEPROM byte. The contents at the selected address are available at serial output SDO.

Programming and Reading the Fuse and Lock Bits

The algorithms for programming and reading the fuse low/high bits and lock bits display in the following table.

Reading the Signature Bytes and Calibration Byte

The algorithms for reading the signature bytes and the calibration byte display in the following table.

HVSP Instruction Overview

Table 3-117. High-Voltage Serial Programming Instruction Set

Instruction

Instruction Format

Comment

Instr 1/5/9/13

Instr 2/6/10/14

Instr 3/7/11/15

Instr 4/8/12/16

Chip Erase

SDI

0_1000_0000_00

0_0000_0000_00

0_0000_0000_00

Wait after instruction 3 until SDO goes HIGH for the chip erase cycle to finish

SII

0_0100_1100_00

0_0110_0100_00

0_0110_1100_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

Load “Write Flash” Command

SDI

0_0001_0000_00

Enter Flash programming code

SII

0_0100_1100_00

SDO

x_xxxx_xxxx_xx

Load Flash Page Buffer

SDI

0_aaaa_aaaa_00

0_dddd_dddd_00

0_eeee_eeee_00

0_0000_0000_00

Repeat after instructions 1-5 until the entire page buffer is filled or until all data within the page is filled

SII

0_0000_1100_00

0_0010_1100_00

0_0011_1100_00

0_0111_1101_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

SDI

0_0000_0000_00

SII

0_0111_1100_00

SDO

x_xxxx_xxxx_xx

Load Flash High Address and Program Page

SDI

0_0bbb_bbbb_00

0_0000_0000_00

0_0000_0000_00

After instruction 3, wait until SDO goes HIGH. Repeat instructions 2-3 for each loaded Flash page until the entire Flash or all data is programmed. Repeat instruction 1 for a new 256-byte page.

SII

0_0001_1100_00

0_0110_0100_00

0_0110_1100_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

Load “Read Flash” Command

SDI

0_0000_0010_00

Enter Flash read mode

SII

0_0100_1100_00

SDO

x_xxxx_xxxx_xx

Read Flash Low and High Byte

SDI

0_aaaa_aaaa_00

0_0bbb_bbbb_00

0_0000_0000_00

0_0000_0000_00

Repeat instructions 1, 3-6 for each new address. Repeat instruction 2 for a new 256-byte page.

SII

0_0000_1100_00

0_0001_1100_00

0_0110_1000_00

0_0110_1100_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

p_pppp_pppx_xx

SDI

0_0000_0000_00

0_0000_0000_00

SII

0_0111_1000_00

0_0111_1100_00

SDO

x_xxxx_xxxx_xx

q_qqqq_qqqx_xx

Load “Write EEPROM”

Command

SDI

0_0001_0001_00

Enter EEPROM programming mode

SII

0_0100_1100_00

SDO

x_xxxx_xxxx_xx

Load EEPROM Page Buffer

SDI

0_aaaa_aaaa_00

0_0000_0bbb_00

0_dddd_dddd_00

0_0000_0000_00

Repeat instructions 1-5 until the entire page buffer is filled or until all data within the page is filled.

SII

0_0000_1100_00

0_0001_1100_00

0_0010_1100_00

0_0110_1101_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

SDI

0_0000_0000_00

SII

0_0110_1100_00

SDO

x_xxxx_xxxx_xx

Program EEPROM Page

SDI

0_0000_0000_00

0_0000_0000_00

Wait after instruction 2 until SDO goes HIGH. Repeat instructions 1-2 for each loaded EEPROM page until the entire EEPROM or all data is programmed.

SII

0_0110_0100_00

0_0110_1100_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

Write EEPROM Byte

SDI

0_aaaa_aaaa_00

0_0000_0bbb_00

0_dddd_dddd_00

0_0000_0000_00

Repeat instructions 1-6 for each new address. Wait after instruction 6 until SDO goes HIGH.

SII

0_0000_1100_00

0_0001_1100_00

0_0010_1100_00

0_0110_1101_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

SDI

0_0000_0000_00

0_0000_0000_00

SII

0_0110_0100_00

0_0110_1100_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

Load “Read EEPROM”

Command

SDI

0_0000_0011_00

Enter EEPROM read mode

SII

0_0100_1100_00

SDO

x_xxxx_xxxx_xx

Read EEPROM Byte

SDI

0_aaaa_aaaa_00

0_0000_0bbb_00

0_0000_0000_00

0_0000_0000_00

Repeat instructions. 1, 3-4 for each new address. Repeat instruction 2 for a new 256-byte page.

SII

0_0000_1100_00

0_0001_1100_00

0_0110_1000_00

0_0110_1100_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

p_pppp_ppp0_00

Write Fuse Low Bits

SDI

0_0100_0000_00

0_EDCB_A987_00

0_0000_0000_00

0_0000_0000_00

After instruction 4, wait until SDO goes HIGH.

Write E-7 = 0 to program the fuse bit.

SII

0_0100_1100_00

0_0010_1100_00

0_0110_0100_00

0_0110_1100_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

Write Lock Bits

SDI

0_0010_0000_00

0_0065_4321_00

0_0000_0000_00

0_0000_0000_00

After instruction 4, wait until SDO goes high. Write 2-1 = 0 to program the lock bit.

SII

0_0100_1100_00

0_0010_1100_00

0_0110_0100_00

0_0110_1100_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

Read Fuse Low Bits

SDI

0_0000_0100_00

0_0000_0000_00

0_0000_0000_00

Reading E-7 = 0 means the fuse bit is programmed.

SII

0_0100_1100_00

0_0110_1000_00

0_0110_1100_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

E_DCBA_987x_xx

Read Lock Bits

SDI

0_0000_0100_00

0_0000_0000_00

0_0000_0000_00

Reading 2-1 = 0 means the lock bit is programmed.

SII

0_0100_1100_00

0_0111_1000_00

0_0111_1100_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_x654_321x_xx

Read Signature Bytes

SDI

0_0000_1000_00

0_0000_00aa_00

0_0000_0000_00

0_0000_0000_00

Repeat instructions 2-4 for each signature byte address.

SII

0_0100_1100_00

0_0000_1100_00

0_0110_1000_00

0_0110_1100_00

SDO

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

x_xxxx_xxxx_xx

p_pppp_pppx_xx

Load “No Operation” Command

SDI

0_0000_0000_00

SII

0_0100_1100_00

SDO

x_xxxx_xxxx_xx

Note:
a = address low bits b = address high bits
d = data in low bits e = data in high bits
p = data out low bits q = data out high bits
x = do not care1 = lock bit 1
2 = lock bit 23 = boot lock bit 01
4 = boot lock bit 025 = boot lock bit 11
6 = boot lock bit 127 = EXTCLKEN fuse
8 = RSTDISBL fuse9 = BOOTRST fuse
A = EESAVE fuseB = WDTON fuse
C = SPIEN fuseD = DWEN fuse
E = CKDIV8 fuse