Listing 2-1. Initialization Block Code Example
/*
This file contains 3 sections: */
/*
1) A Pre-Init Section–this section saves off all the
DSP registers onto the stack.
2) An Init Code Section–this section is the initialization
code which can be modified by the customer
As an example, an SDRAM initialization code is supplied.
The example setups the SDRAM controller as required by
certain SDRAM types. Different SDRAMs may require
different initialization procedure or values.
3) A Post-Init Section–this section restores all the register
from the stack. Customers should not modify the Pre-Init
and Post-Init Sections. The Init Code Section can be
modified for a particular application.*/
#include <defBF532.h>
.SECTION program;
/**********************Pre-Init Section************************/
[--SP] = ASTAT;
[--SP] = RETS;
[--SP] = (r7:0);
[--SP] = (p5:0);
[--SP] = I0;[--SP] = I1;[--SP] = I2;[--SP] = I3;
[--SP] = B0;[--SP] = B1;[--SP] = B2;[--SP] = B3;
[--SP] = M0;[--SP] = M1;[--SP] = M2;[--SP] = M3;
[--SP] = L0;[--SP] = L1;[--SP] = L2;[--SP] = L3;
/*******************Init Code Section**************************/
/*******Please insert Initialization code in this section******/
/***********************SDRAM Setup****************************/
Setup_SDRAM:
P0.L = EBIU_SDRRC & 0xFFFF;
/* SDRAM Refresh Rate Control Register */
VisualDSP++ Loader Manual
for 16-Bit Processors
Blackfin Processor Loader/Splitter
/* Stack Pointer (SP) is set to the end of */
/* scratchpad memory (0xFFB00FFC) */
/* by the on-chip boot ROM */
2-23
Need help?
Do you have a question about the VisualDSP++ 3.5 and is the answer not in the manual?