![Nuvoton NuMicro MS51 32K Series Скачать руководство пользователя страница 228](http://html1.mh-extra.com/html/nuvoton/numicro-ms51-32k-series/numicro-ms51-32k-series_technical-reference-manual_1720303228.webp)
MS51
Nov. 28, 2019
Page
228
of 491
Rev 1.00
MS51
32K
SE
RIES
TE
CHNICAL RE
F
EREN
CE MA
N
UAL
TA
– Timed Access
Register
SFR Address
Reset Value
TA
C7H, All page
0000_0000 b
7
6
5
4
3
2
1
0
TA[7:0]
W
Bit
Name
Description
7:0
TA[7:0]
Timed access
The timed access register controls the access to protected SFR. To access protected bits, user
should first write AAH to the TA and immediately followed by a write of 55H to TA. After these two
steps, a writing permission window is opened for 4 clock cycles during this period that user may
write to protected SFR.
In timed access method, the bits, which are protected, have a timed write enable window. A write is
successful only if this window is active, otherwise the write will be discarded. When the software writes
AAH to TA, a counter is started. This counter waits for 3 clock cycles looking for a write of 55H to TA.
If the second write of 55H occurs within 3 clock cycles of the first write of AAH, then the timed access
window is opened. It remains open for 4 clock cycles during which user may write to the protected bits.
After 4 clock cycles, this window automatically closes. Once the window closes, the procedure should
be repeated to write another protected bits. Not that the TA protected SFR are required timed access
for writing but reading is not protected. User may read TA protected SFR without giving AAH and 55H
to TA register. The suggestion code for opening the timed access window is shown below.
(CLR EA)
;if any interrupt is enabled, disable
temporally
MOV
TA,#0AAH
MOV
TA,#55H
(Instruction that writes a TA protected register)
(SETB EA)
;resume interrupts enabled
Any enabled interrupt should be disabled during this procedure to avoid delay between these three
writings. If there is no interrupt enabled, the
CLR EA
and
SETB EA
instructions can be left out.
Examples of timed assess are shown to illustrate correct or incorrect writing process.
Example 1,
MOV
TA,#0AAH
;3 clock cycles
MOV
TA,#55H
;3 clock cycles
ORL
WDCON,#data
;4 clock cycles
Example 2,
MOV
TA,#0AAH
;3 clock cycles
MOV
TA,#55H
;3 clock cycles
NOP
;1 clock cycle
ANL
BODCON0,#data
;4 clock cycles