|
|
EDA365欢迎您登录!
您需要 登录 才可以下载或查看,没有帐号?注册
x
1 Q* }* X9 b+ s0 U- _- m/ C- d
2 E+ o) m2 |* W% L$ ^; m) [4 S; ` v0 f( ~
28335,仿真器是100v3,做EXRAM写入外部SRAM实验提示上图错误,折磨我两天了,试过打开cl2000.exe,试过修改主函数为最简单的写入函数,试过降低写入值,都没能解决,求大神帮帮我这个新手!7 P! F5 K3 H" Y
下面是主函数:7 D7 h8 Y* L# `* e7 @ v
#include "DSP2833x_Device.h" // DSP2833x HeadeRFile Include File2 H0 H0 {" i- @ S
#include "DSP2833x_Examples.h" // DSP2833x Examples Include File
% z+ O7 c C3 S9 ~# p
+ R1 _; b5 L. r* E& W( {5 s5 r4 Q) r6 ? G4 Y% }, q+ u; {- n x
( N& u- i* L5 [! {/ U3 wUint16 *ExRamstart = (Uint16 *)0x180000;! O* F# a& @0 q( V
0 I+ t9 e) w7 D7 d" e1 W
- O* s1 L, l. x( H
. j1 m8 S! M3 g: S) m3 f& s
void main(void)" R" V0 F3 Q( e1 \+ ~( N: n
{
# z/ w- a2 A% Y Uint16 i;" b8 X+ G4 F4 Y) Y. ?. X
// Step 1. Initialize System Control:
+ |$ K. n( S) a. p( }: w( e// PLL, WatchDog, enable Peripheral clocks3 Y/ |0 a! y) q) n) f+ x7 D
// This example function is found in the DSP2833x_SysCtrl.c file.
4 m' c5 M5 M# T) B, @ InitSysCtrl();
( L8 V6 u/ r! R1 t% b
3 `1 N! V, ?) |& u, m9 {4 O, @9 \// Step 2. Initalize GPIO:% \* P' n( b8 p5 `2 ]& J. e
// This example function is found in the DSP2833x_Gpio.c file and/ h; F% P- W1 E/ K: u3 |, R# y
// illustrates how to set the GPIO to it's default state.
: _0 }6 r" R, |7 |% D// InitGpio(); // Skipped for this example) x& V5 R) y _5 S* D* ^" X
InitXintf16Gpio(); //zq
6 a8 U7 B( v0 J2 J# r' t4 D- @1 t
3 h) p$ I& O2 x6 p) k3 K// Step 3. Clear all interrupts and initialize PIE vector table:% b/ \" ~, H% |9 H
// Disable CPU interrupts
9 X( s5 u/ z/ y. A. F DINT;& F) p3 j: q% K% r6 q0 {
, Z# a* D1 `& K- k# E// Initialize the PIE control registers to their default state.6 n0 j9 t4 Q) w
// The default state is all PIE interrupts disabLED and flags
9 H1 l7 H7 \8 m6 r! q1 ]// are cleared.9 b! n: h' m3 L6 Y+ {$ F. f7 [; ^
// This function is found in the DSP2833x_PieCtrl.c file.
y) O: h" i" w. {' T) m InitPieCtrl();
* t. Z! z9 X4 I8 e3 N: J0 b6 @8 M( v1 g! \( M5 i# Q
// Disable CPU interrupts and clear all CPU interrupt flags:4 R6 Z; b% a5 C. `# T! g, o4 g
IER = 0x0000;
( `5 L% z$ J1 t IFR = 0x0000;- _3 o& ?& L8 J: j
! u/ Y# t" Y/ V* c- _8 }# ]
# `. i7 Y% D8 S* D7 {" c9 a2 F
// Step 4. Write Data to SRAM:
" I# { u' |7 c; J, y1 q) N& G, S! B, [( |$ o
for(i = 0; i < 0xFFFF; i++)- }; l) I, V) o0 [& B# V2 C4 F3 R
{3 `" S( Z/ [# a" |3 z5 d
*(ExRamStart + i) = 0x5555;
$ E* J/ J7 h( _$ J) y6 X& i4 j$ G+ F if(*(ExRamStart + i) != 0x5555)/ X0 B. d( r3 v% |
{
. s& Y) N$ w1 W; c* |/ } while(1);
' S1 [# @2 ^/ R } A7 @4 L" P, Y
}2 [: I; `0 @2 Z/ G' ]
' b: K; H$ j& ~, q {! Z for(i = 0; i < 0xFFFF; i++)
; F1 A. z4 H" }+ w- L/ }' {' U {
- M" G6 Z. m$ E) M *(ExRamStart + i) = 0xAAAA;4 K) Z3 |" \* c3 [. |
if(*(ExRamStart + i) != 0xAAAA)
2 j& l8 f( _0 c1 A( k- O- d* h8 | {$ d/ I& G. u d
while(1);
- w! z* c/ |) ^2 c+ v+ C }
0 j" j) G$ K% h7 k1 s( ] }
4 k+ A0 t$ N, F8 C ]
; W/ |' Q3 F! K, z g) Z9 H# N for(i = 0; i< 0xFFFF; i++)
- r' ]9 U$ V( L" M {% u+ I9 H5 S# {/ `" Q7 [0 H
*(ExRamStart + i) = i;
4 b. n7 |1 R" p: [# e) A if(*(ExRamStart + i) != i)+ Y6 _5 d' P) E! X! `' |* y' W
{4 j& z# j# @2 o9 Y: T3 _: L
while(1);
4 n' s4 u: d& @* @ }, a* F+ |& ^8 w. j
if(*ExRamStart == 0x4000)
' M. ], }$ \8 G+ X: Z {
( x4 }' M( M& \7 E4 ~1 K while(1);
" }$ z: `+ g2 L7 B- Y }9 s: V! {4 ^ b8 L5 X
}
& `, D1 Y# v- n7 V" J$ A. o i=0;8 B& ~4 Q) V0 t2 S4 S# ?7 f( k
for(;;)1 M: x+ M0 G, x+ U; F
{" z) O( v9 j& l. R
) ^, `- e( f% `
}
1 `& c& ?/ a }, L" u
' |0 h; h" O z7 G}
$ O8 d# `: t5 u8 d3 ~1 v3 W v! A2 J6 g7 {, D
) k, ^) ~1 G+ _6 [: T |
|