|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
- b% |4 w) a* L, @
, B" W7 f: z2 Y' s0 q28335,仿真器是100v3,做EXRAM写入外部SRAM实验提示上图错误,折磨我两天了,试过打开cl2000.exe,试过修改主函数为最简单的写入函数,试过降低写入值,都没能解决,求大神帮帮我这个新手!
; G! {7 E1 M8 R' l) I5 n! `1 Y下面是主函数:
h: ^ }1 W$ u r7 L R! s' r#include "DSP2833x_Device.h" // DSP2833x HeadeRFile Include File( N; j* M* l: o! u% }
#include "DSP2833x_Examples.h" // DSP2833x Examples Include File( A, Z! ~! p: d; l+ s, [
5 ?2 ^4 G8 x! H0 d; ]6 I; ?
* z9 T6 S( I+ Y0 q, V( c: Y" N' q8 O% P7 H3 j
Uint16 *ExRamstart = (Uint16 *)0x180000;' d! D) ]/ r( x/ t* B3 V
3 c x9 B h& _0 h: t* o' f+ w% f, E, c& [4 H2 w
' L, j' J6 j% J, @# t
void main(void)% }) E6 n/ `" }4 T Z' K# F8 n
{
% {' l) K3 S! D8 S' G# ~& L' ` Uint16 i;
- L$ x) p# y" q7 ]1 a8 d- U// Step 1. Initialize System Control:
; N7 j0 c5 f" L% l// PLL, WatchDog, enable Peripheral clocks" q) p9 F6 O- W+ q& m1 K; g( g
// This example function is found in the DSP2833x_SysCtrl.c file.
/ O) w% d( J! Y InitSysCtrl();
9 F. v3 D* y M }3 S7 x3 f- |% o2 G, \$ m7 C2 d% G
// Step 2. Initalize GPIO:# O" T( |# f4 h; S' p% O: }" R
// This example function is found in the DSP2833x_Gpio.c file and
3 |$ z. W: D/ v Z5 J// illustrates how to set the GPIO to it's default state.
/ t+ O4 {+ T$ U% B9 y4 ^2 h// InitGpio(); // Skipped for this example0 ^! n9 d$ v! w0 v/ @0 N: F
InitXintf16Gpio(); //zq, \' E3 R6 W( [
7 [* I/ J0 h8 n/ D! A7 Y( S1 r// Step 3. Clear all interrupts and initialize PIE vector table:
4 z' x3 Q4 V0 t2 L) Y// Disable CPU interrupts
; N4 d# P6 }: B. G$ w% l; N DINT;* k5 b2 g5 N% Q' r1 k# |, v! o) h8 B
( R6 F9 y8 Q4 y; F// Initialize the PIE control registers to their default state.9 Q8 X9 }, I1 J0 o: o% P
// The default state is all PIE interrupts disabLED and flags
! h: y7 n& A1 q$ g# j7 g// are cleared.& z" v# n9 V" [ A0 l
// This function is found in the DSP2833x_PieCtrl.c file.
v1 G+ _& X' k InitPieCtrl();4 e- m0 b Z# r" H! |
; R. @" ]' c t5 d2 K. o// Disable CPU interrupts and clear all CPU interrupt flags:( B* _1 \3 x2 m% W$ L
IER = 0x0000;
8 K& V# f3 @1 R( I IFR = 0x0000;: W; f. [/ d: l7 e, ]
+ n- O. H, M Y, x$ w5 c, S& b$ g6 e/ H" @+ @) B7 y! e/ u
// Step 4. Write Data to SRAM:7 {$ X7 t1 W5 v' v5 a. N4 h& a
1 U! L Y& b/ S. N for(i = 0; i < 0xFFFF; i++)1 y6 f0 T& \# p. Y
{
# A! l7 ~4 z3 \6 W" R% R/ O *(ExRamStart + i) = 0x5555;# t; d8 ^8 r) u: l* U
if(*(ExRamStart + i) != 0x5555)2 C( D2 ~4 m3 T
{
) Z2 ~% k# C3 y4 \ while(1);- s' T5 d' J( k3 Q2 U- \) ~
}
7 c" F( L* U$ I% }- g% R }5 z5 }8 i2 w: Y% u
% s9 K, h; m$ N6 t# B
for(i = 0; i < 0xFFFF; i++)
. h$ N2 }+ S! C( o8 F( S {9 Z* I9 r+ N" I9 c$ B+ Z
*(ExRamStart + i) = 0xAAAA;
7 B( P" T: m9 M) q. d( L if(*(ExRamStart + i) != 0xAAAA)9 E0 Y, o& w* N1 \: z
{+ @3 b5 r3 J# i5 L" i& }
while(1);
# T6 e2 a9 F$ S- y' c q8 T! q6 c }8 j6 D1 f( Y @# O6 m1 F+ m
}: H0 t$ L! }, w1 J( S5 d+ x0 U
* g$ R+ X7 p# z/ V for(i = 0; i< 0xFFFF; i++)
; `7 O: u$ w) r$ |9 s& y {, F- p1 i0 D r% o4 _& R, U* r
*(ExRamStart + i) = i;
6 I3 a" V9 C( k3 a# {9 }. a if(*(ExRamStart + i) != i)
4 A) r4 H, d$ a2 y8 G* y# v) ^1 C {& m: c% s; z' |
while(1);
0 t* } N7 p2 \ }& q/ ~/ v! s" S+ Q) [
if(*ExRamStart == 0x4000)
: H( z/ v! }: ^7 Y% k {
/ ^/ X; D: U* A4 Q5 E while(1);& A" E; C( k8 d7 B; d
}2 |+ Q4 O3 u6 m3 S8 e0 u, e
}& T8 |! o w, h. @1 S2 w/ D" `. z
i=0;( I7 k. \1 K ~; R$ M
for(;;)2 ^' g; _" [* U, X6 o% o
{
8 ?' K0 W1 k+ F# a; f% Q
- f. P* F- O6 k$ @& k% a9 f7 W }
4 R7 [" S- ^% N5 } K; K: I* u9 y5 Y d; R+ w! v
}
! u' n, b3 N2 O( F* R' J/ {$ r) s# B: G( k2 x. ], H' \
3 d' Y: _1 y5 N+ ]* W9 f
|
|