[AVR单片机] XMEM

[复制链接]
2190|2
 楼主| lichuanfa 发表于 2007-8-14 16:20 | 显示全部楼层 |阅读模式


#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?
高手们指点指点
海天一色 发表于 2009-6-27 10:14 | 显示全部楼层
广告贴                                                   。
我是土匪 发表于 2009-7-14 15:02 | 显示全部楼层
求AVR 仿真器  价钱便宜 性能可靠
您需要登录后才可以回帖 登录 | 注册

本版积分规则

44

主题

275

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部