#include <avr/io.h> #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <string.h> #include <avr/eeprom.h> #include <avr/sleep.h> #include <avr/wdt.h> #include <setjmp.h> #include <avr/interrupt.h> #include <math.h>
#define nop asm ("nop");
/* 定义外部ram指针 */ unsigned char *eram;
int main ( void ) { unsigned char i,j; unsigned char *p1,*p2; p1=( unsigned char * )0x2000; p2=( unsigned char * )0x2001;
// unsigned char test;
/* 地址大于1100时自动访问外部ram */ MCUCR |= (1<<SRE);
// XMCRA |= (1<<SRW00); // XMCRB |= (1<<XMM0);
*p1=10; nop; *p2=15; nop; i=*p1; j=*p2; nop;
while (1) {;} return 0; } 为什么i和j总是读出相同的值15? 高手们指点指点
|