|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
2 H' V* r( K3 F) b( @
( f& T0 U" M8 w) W J
28335,仿真器是100v3,做EXRAM写入外部SRAM实验提示上图错误,折磨我两天了,试过打开cl2000.exe,试过修改主函数为最简单的写入函数,试过降低写入值,都没能解决,求大神帮帮我这个新手!# h) r( V/ z* s- ~! v; M
下面是主函数:# F/ d% B7 }' |
#include "DSP2833x_Device.h" // DSP2833x HeadeRFile Include File
. `5 e+ Z* Z. i+ b' M#include "DSP2833x_Examples.h" // DSP2833x Examples Include File
5 b% ? ~9 H6 i$ m* o
% ^, E% n1 M5 A" ]) B* q$ W$ I3 n. H- o* i: j0 }% e k! i
0 S. K! Q3 _0 m: K( g
Uint16 *ExRamstart = (Uint16 *)0x180000;
& t7 y! d; M+ V7 o3 J8 F
7 ` K' B- p G8 m4 ^3 a; r! j `# R7 c9 x
1 b1 U2 e/ s6 a7 N$ I7 {) Hvoid main(void), w; g' s* Q3 z8 f) s
{1 G9 F3 U6 q/ k0 V
Uint16 i;
8 r+ z# W) v e6 `9 B9 G1 u; F// Step 1. Initialize System Control:5 Z0 w3 j) u( D
// PLL, WatchDog, enable Peripheral clocks8 L3 r/ s9 L) F: T5 d
// This example function is found in the DSP2833x_SysCtrl.c file.
7 Y: W% W `! C/ T6 p4 d) |+ X0 J InitSysCtrl();
0 S5 k; S+ [9 w; {# {# E4 g4 f# U+ M* o+ }5 R6 g& o8 O
// Step 2. Initalize GPIO:
% L3 L R+ F7 q( _; v: U" u// This example function is found in the DSP2833x_Gpio.c file and5 u9 u3 s; M& x3 G# W/ ?
// illustrates how to set the GPIO to it's default state.
0 @. s$ n3 ]/ }' _# i7 p// InitGpio(); // Skipped for this example
! _. s1 q6 s5 S InitXintf16Gpio(); //zq
( ~& g4 Q4 v/ m/ k( H7 \7 Z* Q* b. x4 ]. _
// Step 3. Clear all interrupts and initialize PIE vector table:0 A* M' P2 ?. L/ b) R
// Disable CPU interrupts
4 S; `+ Q) V, n DINT;' [1 o! K0 Q3 i" l* a/ D
- v5 c' O5 X/ ~// Initialize the PIE control registers to their default state.
2 V$ U$ }4 Y: Y |; ~1 Y* _// The default state is all PIE interrupts disabLED and flags7 R: U( b% a4 a. P' |0 x% z9 g
// are cleared.8 p; F7 d7 T2 z( _" X
// This function is found in the DSP2833x_PieCtrl.c file.
) w. I* @6 n1 D, @; v InitPieCtrl();8 V- x$ i5 B; m7 k* G# s
/ v! H: ]5 r! }3 J1 K- T
// Disable CPU interrupts and clear all CPU interrupt flags:) G7 I0 B, C" _+ H5 ?
IER = 0x0000;
5 ^; g$ H* V: s2 E* @( r IFR = 0x0000;
$ j# z1 o3 R" T! p
: t3 k3 Z3 ~" ?0 l! b0 C$ M2 V& L8 I% C% T
// Step 4. Write Data to SRAM:0 W! T: h7 E, `6 z. u$ Q
# B/ L9 L0 Z( n: t3 p# I for(i = 0; i < 0xFFFF; i++); ^8 i$ ]+ R2 X7 h4 ~
{3 l, }, }4 i" k1 h" a
*(ExRamStart + i) = 0x5555;
" I3 b+ k; y( l( y( }* _4 w7 C3 _ if(*(ExRamStart + i) != 0x5555); n! r% W# h2 I+ q8 ~7 E& P
{& d# I+ |5 j( M3 d- ]7 r
while(1);" Y0 w. h+ d- j: C |0 A6 R
}8 o2 A! s1 @8 y( v! S% O
}: {% s+ r9 V7 j% z# Y: q) n
0 l- U; K1 b, x% |, b
for(i = 0; i < 0xFFFF; i++)
5 {( h2 E4 H' k, Y9 Q. p4 y {, m. [) V2 b1 w; p6 I' b3 a
*(ExRamStart + i) = 0xAAAA;5 w+ T- k: z, a0 `; M! Y0 j- ^
if(*(ExRamStart + i) != 0xAAAA)4 K" b* P6 i# f8 C
{
3 s7 f: @6 C4 l5 ?8 t; l" B while(1);
. z: F+ I. K" l6 f5 G }3 V7 ~9 r# z N7 T. h
} x4 K- c7 H0 w+ S
) ?+ q- P# k4 ]7 J& l
for(i = 0; i< 0xFFFF; i++)
1 [$ P7 B4 d# k: I {
* {3 p7 I+ \ c *(ExRamStart + i) = i;
9 X: |- ]; @6 ^ if(*(ExRamStart + i) != i)' w" w: y/ _1 Z- P
{$ ~: v9 V* ]- e P3 j
while(1);
' [( Q6 D! I" E& I6 g# Q( t" P }
3 a( h" X2 j) ~) } {8 E" d. n if(*ExRamStart == 0x4000)9 A0 p5 Q0 |8 A& d0 ^/ w/ h. P7 N/ R
{/ z8 N" h$ [. d) Y
while(1);
s7 I8 T% L; B: V% `6 O }9 {9 b- D9 y6 ~
} U! c6 W% T, u8 n% \2 M
i=0;
! Q5 x$ t5 [4 J3 u( g- M for(;;)$ K3 U- b! o1 W: c b7 O
{0 |' \4 x' [( k: _5 b1 e) Y6 N
; S |& }7 T1 C5 S9 Z( g9 J s }
5 _' t5 U& w9 r: e! M7 L, y% O: d9 U; f
}) I3 y$ V3 ^- i
3 G0 e( `0 e8 ?! d% P# X. ^7 F
9 e$ r! F, R0 @7 V( u |
|