|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
9 Q" T3 i+ O1 p7 U
+ h+ U. w! ]) g! \ W9 Q
28335,仿真器是100v3,做EXRAM写入外部SRAM实验提示上图错误,折磨我两天了,试过打开cl2000.exe,试过修改主函数为最简单的写入函数,试过降低写入值,都没能解决,求大神帮帮我这个新手!
" O0 b& Q; l! p) h9 K下面是主函数:# |% V' `8 e2 P/ u
#include "DSP2833x_Device.h" // DSP2833x HeadeRFile Include File
: T- M. U1 ^" P T#include "DSP2833x_Examples.h" // DSP2833x Examples Include File
e/ M& i3 W) @0 ~4 _! I2 m" ^6 F& ^. V7 p
, V8 ?- M/ u# d, I
4 t8 ~" _' A4 w3 Q- wUint16 *ExRamstart = (Uint16 *)0x180000;
2 J0 ?+ n( Q# V9 f0 \' ]$ P5 z8 D$ [1 }$ j s7 I8 z3 J
1 l' x$ m: x9 K
J7 O" ~5 w& U
void main(void)
4 `3 m$ [1 _* x+ @9 J' k" `8 _{( n k. C% T# _5 g8 C" B# Y0 w
Uint16 i;' _( W5 u0 j8 \
// Step 1. Initialize System Control:( C' p, j5 I1 M/ J, C. B" Y" t
// PLL, WatchDog, enable Peripheral clocks$ P6 I% `; Y8 |0 H( ? C" L
// This example function is found in the DSP2833x_SysCtrl.c file.
0 ^# `2 |( s7 U. c' c3 t8 b- s" b InitSysCtrl();, D( j: z+ m# Q1 d: D; @" c% ~ ?* n
! y& ]5 ~7 z% d( T$ e, @// Step 2. Initalize GPIO:3 n: ? I5 b5 U% d( N
// This example function is found in the DSP2833x_Gpio.c file and
+ l$ S9 o4 H$ V* T9 Q// illustrates how to set the GPIO to it's default state.$ U% g4 B" ?" M( x: A1 L
// InitGpio(); // Skipped for this example
6 N$ }: ~ K8 Z4 l* \ InitXintf16Gpio(); //zq; R4 n1 O- x/ ~7 b L R# }
6 [1 ^# i$ a7 u" c. l// Step 3. Clear all interrupts and initialize PIE vector table:. o, E1 C. g, V# x
// Disable CPU interrupts
: {7 @/ H- `2 K+ G# L- d DINT;8 Q) |3 S3 G. m1 V( H ^
1 U/ s7 o5 O& }0 s6 p5 j
// Initialize the PIE control registers to their default state.
! f6 ~* [# l+ Z1 N// The default state is all PIE interrupts disabLED and flags
+ d7 U0 F) ^. f7 w# O3 S3 z3 c// are cleared.+ ?) n7 S7 V9 }, \3 U) u7 U: r
// This function is found in the DSP2833x_PieCtrl.c file.
( C' x3 y# O. K! L; M/ z InitPieCtrl();
7 y- f: ?8 }; {$ r* j3 j0 r/ k* |8 C8 @( Y; l" w% D( ]
// Disable CPU interrupts and clear all CPU interrupt flags:
% m& W2 `2 }2 O( g; A* q+ R' Y5 O IER = 0x0000;
( r8 B) Q9 ]' y# s. j6 I IFR = 0x0000;
$ `# F. Q- ^0 q! [, s. ~
/ V7 {4 T1 s! R- |
V, P6 _, h a/ `$ o, H8 Y// Step 4. Write Data to SRAM:
, }: w; W- m& W8 A* _, @) \; `
1 e) E" j6 n: Z9 G7 Y for(i = 0; i < 0xFFFF; i++)% L- W. Y* w/ ]& [+ H; [
{
2 L7 T; w4 I( u; F' ? L *(ExRamStart + i) = 0x5555;
( w2 N# r( l/ R. q, a if(*(ExRamStart + i) != 0x5555)( ?9 i+ F4 V, {- F3 @+ a8 f
{
8 l% L) j$ t/ ^1 E4 J$ U; u) P while(1);: k: n( p0 M5 j( Z1 E
}
- y( k* Y: q; E4 \! d } Y! I6 g4 @# M' A/ x
* p. `7 R; J4 ?( |. g, A% [' C& p
for(i = 0; i < 0xFFFF; i++)
4 n2 H+ ]) r# T) `+ | {. \" q6 p7 Z, K
*(ExRamStart + i) = 0xAAAA; u, p% F1 m+ w L, W
if(*(ExRamStart + i) != 0xAAAA)
( P+ @* M6 V7 s! k {6 t P. ~5 r) `8 G
while(1);: K/ @% p* g4 E4 j% i# ~( y
}
1 d( y) h& o C }
- c% k8 A0 Q0 ?) C: l8 p3 R! P" p$ | H5 ~+ }- a- m( P' X
for(i = 0; i< 0xFFFF; i++)
; F: u( @' n& F! A" h( F0 v. c {: t) }3 @+ I# B5 U i# m4 J
*(ExRamStart + i) = i;3 u9 k* \9 a6 {9 n1 E! L5 ~
if(*(ExRamStart + i) != i)
" Y+ E, [: V* h( H4 v' J- Q {5 |# x9 D8 R3 X g
while(1);4 O0 r6 a8 `7 O& v: v7 s" H/ R5 C
}$ u R& v g1 }" l. n! s
if(*ExRamStart == 0x4000)6 t) J5 |7 H' V8 P7 p5 ~" j
{: }, x" Y) r7 x; r" i# z; P& \
while(1);
! ?( N1 ^9 W9 y. ?8 e* j" a }
' W {- z! `3 D' O }: Z, P2 C$ z9 I# `/ b3 o/ _: D+ k) r
i=0;
, Z6 M* |7 Z6 u( d' u! U7 ? for(;;)
& P( N" P- \4 C {
4 [2 ]& i ~% P
- G% u9 d. _$ [ }% p* t, O8 q5 e
( z) b$ ]. N% @- [+ t Z
}
# c' `- V: \/ Z, U; o
. |, K5 [" q6 K% G
( k: T9 q$ u6 ^ V% L8 k7 S |
|