| Electronic Components Datasheet Search |
|
AN3995 Datasheet(PDF) 41 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN3995 Datasheet(HTML) 41 Page - STMicroelectronics |
|
41 / 49 page ![]() AN3995 Application code example Doc ID 022384 Rev 2 41/49 se_bctr #/* Return to Flash (when running from RAM) */ conf_sram_code_end:#/* ---- End of block that will be copied to RAM */ conf_sram: #/* Calculate number of bytes to copy (data between labels) */ e_lis r3, conf_sram_code_begin@h e_or2i r3, conf_sram_code_begin@l e_lis r4, conf_sram_code_end@h e_or2i r4, conf_sram_code_end@l subf r4, r3, r4 mtctr r4 #/* Move to counter register the number of bytes to copy */ e_lis r5, _SRAM_ADDR_Z4@h #/* SRAM start address defined in the linker file */ e_or2i r5, _SRAM_ADDR_Z4@l copy_configuration_code:#/* Copy configuration code from Flash to RAM */ e_lbz r6, 0(r3) e_stb r6, 0(r5) e_addi r3, r3, 1 e_addi r5, r5, 1 e_bdnz copy_configuration_code#/* Loop is based on the value of counter */ e_lis r24, _SRAM_ADDR_Z4@h #/* SRAM start address defined in the linker file */ e_or2i r24, _SRAM_ADDR_Z4@l se_mtctr r24 se_bctr #/* Jump to the SRAM Start address */ run_from_Flash: #/**************************************************************************/ #/* Configure SRAM wait states to 1 */ #/* RAM needs an additional wait state if the system clock is above 64 Mhz */ #/**************************************************************************/ e_lis r3, 0x4000#/* 1-wait state for RAM access */ e_or2i r3, 0x0 e_lis r4, 0xFFF4#/* ECSM */ e_or2i r4, 0x0024 e_stw r3, 0(r4) se_isync msync #/**************************************************************************/ #/* Configure XBAR */ #/**************************************************************************/ #/* Configure Master Priority Register 0 */ e_lis r4, MPR0VALUE@h#/* MPR0 Conf. High Value */ e_or2i r4, MPR0VALUE@l #/* MPR0 Conf. Low Value */ e_lis r5, MPR0ADDR@h#/* MPR0 Address High Value */ e_or2i r5, MPR0ADDR@l#/* MPR0 Address Low Value */ se_stw r4,0x0(r5) #/* Store Value */ #/* Configure Slave General Purpose Control Register 0 */ e_lis r4, SGPCR0VALUE@h#/* SGPCR0 High Value High Value */ e_or2i r4, SGPCR0VALUE@l #/* SGPCR0 Low Value */ se_stw r4,0x10(r5) #/* Store Value (SGPCR0 address is 0x10 bytes after MPR0)*/ #/* Configure Master Priority Register 1 */ |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |