![NXP Semiconductors MPC5566 Reference Manual Download Page 608](http://html1.mh-extra.com/html/nxp-semiconductors/mpc5566/mpc5566_reference-manual_1721850608.webp)
SRAM
MPC5566 Microcontroller Reference Manual, Rev. 2
Freescale Semiconductor
14-5
14.7.1
Example Code
To initialize SRAM correctly, use the store multiple word (
stmw)
instruction to implement 64-bit writes
to all SRAM locations. The
stmw
instruction concatenates two 32-bit registers to implement a single
64-bit write.
The following example code illustrates the use of the
stmw
instruction to initialize the SRAM ECC bits.
init_RAM:
lis
r11,0x4000
# base address of the SRAM, 64-bit word aligned
ori
r11,r11,0
# not needed for this address but can be for others
li
r12,1024
# loop counter to get all of SRAM;
# 128k/4 bytes/32 GPRs = 1024
mtctr r12
init_ram_loop:
stmw
r0,0(r11)
# write all 32 GPRs to SRAM
addi
r11,r11,128
# inc the ram ptr; 32 GPRs * 4 bytes = 128
bdnz
init_ram_loop
# loop for 128k of SRAM
blr #
done
Summary of Contents for MPC5566
Page 81: ...Introduction MPC5566 Microcontroller Reference Manual Rev 2 1 24 Freescale Semiconductor...
Page 135: ...Signal Description MPC5566 Microcontroller Reference Manual Rev 2 2 54 Freescale Semiconductor...
Page 189: ...Reset MPC5566 Microcontroller Reference Manual Rev 2 4 20 Freescale Semiconductor...
Page 603: ...Flash Memory MPC5566 Microcontroller Reference Manual Rev 2 13 38 Freescale Semiconductor...
Page 609: ...SRAM MPC5566 Microcontroller Reference Manual Rev 2 14 6 Freescale Semiconductor...
Page 1073: ...MPC5566 Microcontroller Reference Manual Rev 2 22 36 Freescale Semiconductor...
Page 1185: ...Nexus MPC5566 Microcontroller Reference Manual Rev 2 25 92 Freescale Semiconductor...