
December 3, 2005 S29WS-N_m0_I0
41
P r e l i m i n a r y
33#
EE*%%
%*%*%-)+
) %>%%*%%
%.@
)(/)>
EE/!/IG9
!
)))))
)
/* Example: Write Buffer Programming Command */
/* NOTES: Write buffer programming limited to 16 words. */
/* All addresses to be written to the flash in */
/* one operation must be within the same flash */
/* page. A flash page begins at addresses */
/* evenly divisible by 0x20. */
UINT16 *src = source_of_data; /* address of source data */
UINT16 *dst = destination_of_data; /* flash destination address */
UINT16 wc = words_to_program -1; /* word count (minus 1) */
*( (UINT16 *)base_addr + 0x555 ) = 0x00AA; /* write unlock cycle 1 */
*( (UINT16 *)base_addr + 0x2AA ) = 0x0055; /* write unlock cycle 2 */
*( (UINT16 *)sector_address ) = 0x0025; /* write write buffer load command */
*( (UINT16 *)sector_address ) = wc; /* write word count (minus 1) */
loop:
*dst = *src; /* ALL dst MUST BE SAME PAGE */ /* write source data to destination */
dst++; /* increment destination pointer */
src++; /* increment source pointer */
if (wc == 0) goto confirm /* done when word count equals zero */
wc--; /* decrement word count */
goto loop; /* do it again */
confirm:
*( (UINT16 *)sector_address ) = 0x0029; /* write confirm command */
/* poll for completion */
/* Example: Write Buffer Abort Reset */
*( (UINT16 *)addr + 0x555 ) = 0x00AA; /* write unlock cycle 1 */
*( (UINT16 *)addr + 0x2AA ) = 0x0055; /* write unlock cycle 2 */
*( (UINT16 *)addr + 0x555 ) = 0x00F0; /* write buffer abort reset */
Software Functions and Sample Code
Table 12.15.
Write Buffer Program
''%!JO[0F([ F!(
Cycle
Description
Operation
Byte Address
Word Address
Data
6
J-
0
FC
FC999
;;
@
J-
0
FC99<
FC@
;;99
D
0F'(
0
;;@9
<
00(
0
0(#A6
@"@()4@;
9D=
'F0#
0
0#
0#
'
0F!
0
;;@8