4.9.12.6 High-Voltage Serial Programming
The High-Voltage Serial Programming (HVSP) mode allows the user to program memories, fuses and lock bits. To enter the HVSP mode, a special test signature has to be applied on the ATA8210/15.
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:
- Set all test signature pins (TESTSIG0 … TESTSIG3) to ‘
0
’. - Set NRESET and TEST_EN pins to ‘
0
’. - Apply 2.4-5.5V between VS and GND.
- Wait 1-4 ms.
- 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. For TEST_EN, use a lower voltage than the voltage on VS.
- Keep the test signature pins unchanged for at least 10 µs.
- Release all test signature pins.
- Execute the desired HVSP commands.
- 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
command:
- Load the
CHIP ERASE
command. See ISP Instruction Overview in the In-System Programming form Related Links. - After instruction 3, wait until SDO goes HIGH for the chip erase cycle to finish.
- Load the
NO OPERATION
command.
Programming the Flash
The Flash is organized in pages. See In-System Re-programmable Flash Program Memory (ATA8210) in the Program Memory from Related Links. 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:
- Load the
WRITE FLASH
command (see the following table). - Load the Flash page buffer.
- Load the Flash high address and program page. After instruction 3, wait until SDO goes HIGH for the page programming cycle to finish.
- Repeat 2 through 3 until the entire Flash is programmed or until all data is programmed.
- Terminate page programming by loading the
NO OPERATION
command.
When writing or reading serial data to the ATA8210, data is clocked on the rising edge of the serial clock.
Programming the EEPROM
The EEPROM is organized in pages. See EEPROM Data Memory from Related Links. 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):
- Load command “Write EEPROM”.
- Load EEPROM page buffer.
- Program EEPROM page. Wait after Instruction 2 until SDO goes high for the “Page Programming” cycle to finish.
- Repeat instruction 2 through 3 until the entire EEPROM is programmed or until all data is programmed.
- 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):
- Load the
READ FLASH
command. - 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):
- Load the
Read EEPROM
command. - 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
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 | 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 | 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 | 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 | 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 | SDI | 0_0000_0000_00 | — | — | — | — |
SII | 0_0100_1100_00 | — | — | — | ||
SDO | x_xxxx_xxxx_xx | — | — | — |
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 care | 1 = lock bit 1 |
2 = lock bit 2 | 3 = boot lock bit 01 |
4 = boot lock bit 02 | 5 = boot lock bit 11 |
6 = boot lock bit 12 | 7 = EXTCLKEN fuse |
8 = RSTDISBL fuse | 9 = BOOTRST fuse |
A = EESAVE fuse | B = WDTON fuse |
C = SPIEN fuse | D = DWEN fuse |
E = CKDIV8 fuse | — |