C. EPROM Programming: MSP430 Family EPROM Module
C. EPROM Programming: MSP430 Family EPROM Module
C. EPROM Programming
This appendix describes the MSP430 EPROM module. The EPROM module is erasable
with ultraviolet light, and electrically programmable. Devices with an EPROM module are
offered in a windowed package for multiple programming and OTP package, for one
time programmable.
C-1
EPROM Module MSP430 Family
The CPU can fetch data and instructions from the EPROM. When the programming
voltage is applied to the TDI/VPP pin, the CPU can also write to the EPROM module.
Reading the EPROM is an identical process to that with other internal peripheral
modules. Both programming and reading can occur on byte or word boundaries.
Erasure
Before programming, the entire EPROM should be erased. Erasing of the EPROM
module is achieved by exposing the transparent window to ultraviolet light.
The data in the EPROM module can be programmed serially via the integrated ‘JTAG’
feature, or via software which is part of the application software. The ‘JTAG’
implementation features an internal mechanism for security purposes. Once the ‘security
fuse’ is activated, no accesses to the device via the ‘JTAG’ functions are possible. The
‘JTAG’ is permanently switched to the by-pass mode.
Programming
The application must provide an external voltage supply to the TDI/VPP pin, to provide
the necessary voltage and current for programming. The minimum programming time is
noted in the electrical characteristics of the device data sheets.
The EPROM control register EPCTL controls the EPROM programming, once the
external voltage is supplied. The erase state is a ‘1’. When EPROM bits are
programmed, they are read as ‘0’.
The programming of the EPROM module can be done for single bytes, words, blocks of
individual length, or with the entire module. All bits that have a final level of ‘1’ must be
erased before programming. The programming can be done on single devices or even
in-system. The supply voltage should be in the range required by the device datasheet.
The levels on the ‘JTAG’ pins are defined in the device datasheet, and are usually
CMOS levels.
C-2
MSP430 Family EPROM module
- - - - - - - -
xxxAh DEF0 xxxBh D E
xxx8h 9ABC xxxAh F 0
xxx6h 5678 xxx9h 9 A
xxx4h 1234 xxx8h B C
- - - - xxx7h 5 6
xxx6h 7 8
xxx5h 1 2
xxx4h 3 4
- -
7 0
EPCTL
VPPS EXE
054h
r-0 r-0 r-0 r-0 r-0 r-0 rw-0 rw-0
Bit 0: The execute bit EXE initiates and ends the programming to the EPROM
module. The external voltage must be supplied to the TDI/VPP before EXE bit
is set. The timing conditions are noted in the datasheets.
Bit 1: When the VPPS bit is set, the external programming voltage is connected to
the EPROM module. The VPPS bit must be set before EXE bit is set. It can be
reset together with the EXE bit. The VPPS bit must not be cleared between
programming operations.
EPROM Protect
The EPROM access via the serial test and programming interface ‘JTAG’ can be
inhibited when the ‘security fuse’ is activated. The security fuse is activated via serial
instructions shifted into the ‘JTAG’. Activating the fuse is not reversible and any access
to the internal system is disrupted. The by-pass function described in the standard
IEEE1149.1 is active.
C
C-3
EPROM Module MSP430 Family
Start-of-subroutine
No Yes
Verify byte
End-of-subroutine: RET
C-4
MSP430 Family EPROM module
C3. Program EPROM module via serial data link using ‘JTAG’
feature
The hardware interconnection of the ‘JTAG’ pins is done via four separate pins, plus the
ground or VSS reference level. The ‘JTAG’ pins are TMS, TCK, TDI(/VPP) and
TDO(/TDI).
VPP***
(11.5V/70mA)
TMS
TMS
TCK
TCK
TDI/VPP*
TDI
TDO/TDI**
TDO
SN74HCT125 68k MSP430Xxxx
Xout/TCLK****
TCLK
VCC/DVCC
AVCC
VSS/DVSS
AVSS
+ VCC/
DVCC
1k
Note *: TDI in standard mode,
220
VPP input during programming
Note **: TDO in standard mode,
SN74HCT125
Data input TDI during programming
Level Shifter
Note ***: see electrical characteristics in
the latest data sheet
Note ****: Optional, fast incrementing of
address via PC possible
Switches shown for programming situation
C
C-5
EPROM Module MSP430 Family
TMS*
TCK*
VPP*** TDI/VPP**
(11.5V/70mA)
68k
TDO/TDI***
68k
MSP430Xxxx
VSS/DVSS
AVCC
C-6
MSP430 Family EPROM module
- - - -
D E
F 0
yyyy 9 A - - - -
B C D E
5 6 F 0
7 8 R9 xxxx 9 A
1 2 B C
3 4 5 6
- - 7 8
1 2
Example: Write data in yyyy into location xxxx 3 4
BurnByte = (yyyy) = (9Ah) - -
R9 = xxxx
The target EPROM module can not execute the programming code sequence while the
data is being written into it. In the example, a subroutine moves the programming code
sequence into another memory, e.g. into the RAM.
C-7
EPROM Module MSP430 Family
Start-of-subroutine: load_burn_routine
End-of-source code?
End-of-subroutine: RET
;-------------------------------------------------------------
; Definitions used in Subroutine :
; Move programming code sequence into RAM (load_burn_routine)
; Burn a byte into the EPROM area (RELOC_Burn_EPROM)
;-------------------------------------------------------------
C-8
MSP430 Family EPROM module
Burn_EPROM
dint ; ensure correct burn
timing
mov.b #VPPS,&EPCTL ; VPPS on
push r_timer ; save registers
push r_count ; programming subroutine
mov #loops,r_count ; 2 cycles = 2 us
Repeat_Burn
mov.b &BurnByte,0(pointer) ; write to data to EPROM
; 6 cycles = 6 us
bis.b #EXE,&EPCTL ; EXE on
; 4 cycles = 4 us
; total cycles VPPon to EXE
; 12 cycles = 12 us (min.)
mov #(100-ov)/lp,r_timer ;:programming pulse of
100us
wait_100 ;:starts, actual time
102us
dec r_timer ;:
jnz wait_100 ;:
bic.b #EXE,&EPCTL ;:EXE / prog. puls off
C-9
EPROM Module MSP430 Family
Burn_EPROM_bad
dec r_count ; not ok : decrement loop counter
jnz Repeat_Burn ; loop not ended : do another trial
inv.b &BurnByte ; return the inverted data to flag
; failing the programming attempt
; the EPROM address is unchanged
;
Burn_EPROM_end
pop r_timer
pop r_count
eint
ret
Burn_end
C-10