12150|22

24

帖子

0

TA的资源

一粒金砂(高级)

楼主
 

看我做的AVR单片机以太网项目-step by step 2 [复制链接]

上周六20060811开始调试RS485/232转TCP开发板,电路板上电一次成功!

1.开始调试串口和RAM!!

最新回复

好帖子 很好  谢谢  详情 回复 发表于 2008-6-24 13:20
点赞 关注
 

回复
举报

24

帖子

0

TA的资源

一粒金砂(高级)

沙发
 

回复 楼主 的帖子

串口UART1已经调试通了
源先的PRINTF函数没有办法调用,只好自己写个,已经可以打印HEX数据了!
下面开始测试RAM!
unsigned char  readram(unsigned int iaddr)
{
unsigned char caddl,caddh;
unsigned char cdatatemp=0;



caddl=iaddr&0x00ff;
caddh=(iaddr&0xff00)>>8;
DDRA  = 0xFF;
DDRC  = 0xFF;
RDH;
WRH;
ALEH;
//1 data to addr
PORTA=caddl;
NOP();
ALEL;  //LATCH IT

DDRA  = 0x00;//PORT INPUT  
  
PORTC=caddh;

RDL;
//2 send wr
  
NOP();
  
cdatatemp=PINA;
RDH;
return cdatatemp;
  
}
void writeram(unsigned int iaddr, unsigned char ctemp)
{
unsigned char caddl,caddh;
unsigned char cdatatemp=0;

caddl=iaddr&0x00ff;
caddh=(iaddr&0xff00)>>8;
RDH;
WRH;
ALEH;
//1 写地址到端口A和C
DDRA  = 0xFF;
PORTA=caddl;
  
ALEL;//锁存A0-A7
  
DDRC  = 0xFF;
PORTC=caddh;
  
//数据到端口A
PORTA=ctemp;
  
  
WRL;//写信号
//2 send wr
NOP();
WRH;
return ;

}

void main(void)
{
unsigned int k=0;
init_devices();
//for(k=0;k<100;k++)sendchar1(0x55);
sendstring1("init system ok!
");
// printf("init system ok!
");
  
  sendstring1("now test system-ram  all is 32k !
");
// test_ram();
for(k=0x1100;k<=0x1200;k++)//90ff
{ sendstring1("addr = ");
        sendinthex1(k);
        sendstring1(" =");
        sendinthex1(readram(k));
        sendstring1("
");
}


sendstring1("---- test system-ram  end!
");
  
sendstring1("now test rtl8019as!
");
// test_net();
sendstring1("----test rtl8019as end!
");
}
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

板凳
 

回复 沙发 的帖子

打印处理函数!!
char char2hex(char t1)
{
if((t1>=00) &&(t1<=0x09))t1=t1+0x30;//'0'--'9'
else  
{
  
if((t1>=0x0a)&&(t1<=0x0f))//'A'--'F'
t1=t1-0x0a+0x61;
}
return t1;
}

void sendinthex1(int c)
{
char temph=0,templ=0;
char t1=0,t2=0;

temph=c/256;
templ=c%256;

t1=(c/256)/16;
//t1=t1>>8;
UDR1 = char2hex(t1);
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;

t1=(c/256)%16;
UDR1 = char2hex(t1);
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;

t2=(c%256)/16;//templ&0xf0;
//t2=t2>>8;
UDR1 = char2hex(t2);
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;

t2=(c%256)%16;//templ&0x0f;
UDR1 = char2hex(t2);
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;

}

void sendchar1(char c) // 发送  
{
UDR1 = c;
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;
}

void sendint1( int c) // 发送  
{
UDR1 = (c&0xff00)>>8;
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;

UDR1 = c&0xff;
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;


}


void sendstring1(unsigned char * txbuf) // 发送  
{
unsigned int j;
for (j = 0; *txbuf; j++, txbuf++)sendchar1(*txbuf);
//for(;*txbuf!='/0';txbuf++)

}
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

4
 

RAM读取错误图片!!

RAM读取错误图片!!
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

5
 

看我做的AVR单片机以太网项目-step by step 2 »

XMCRA = 0x40; //external memory
XMCRB=0X00;

#define txbuf1_head 0x1100
extern unsigned char txbuf1[256];

//define mappings
void mapping_init(void)
{
asm(
  ".area memory(abs)
"
  ".org 0x1100
"
  " _txbuf1:: .blkb 256
"
  ".text
"
);
}

ram 现在可以读了,马上可以测试RAM了!
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

6
 

以下程序的结果是这个汗!!!!!!

以下程序的结果是这个汗!!!!!!

//ICC-AVR application builder : 2006-8-14 16:03:08
// Target : M128
// Crystal: 16.000Mhz

//1.debug rs232
//

#include
#include
#include
#include

//MCU时钟频率
#define F_CPU   16000000
//默认的系统BAUD
#define baud    115200
      
#define MCUBAUD9600 1   

//declare memory mapped variables
#define txbuf1_head 0x1100

extern volatile unsigned char txbuf1[28415];
//define mappings
void mapping_init(void)
{

asm(
  ".area memory(abs)
"
  ".org 0x1100
"
  " _txbuf1:: .blkb 28415
"
  ".text
"
);
  
}


//#define ext_PORT1 ((volatile unsigned char *)0x1100)
//unsigned char *p=(unsigned char *)ext_PORT1;
unsigned char testramtable[4]={0x00,0x55,0xaa,0x00};
//int COM;

void Delay(void)
{

}
void Delay1ms(void)
{         
unsigned int  i;

for(i=0;i<=(unsigned int)(16*143-2);i++);
}

void Delayxms(unsigned char ms)
{         
unsigned char i;

for(i=0;i<=ms;i++)Delay1ms();
/*
unsigned short delay_count = F_CPU / 4000;
//#ifdef __GNUC__
    unsigned short cnt;//volatile
    asm   ("
"  
                  "L_dl1%=:
\t"
                  "mov %A0, %A2
\t"
                  "mov %B0, %B2
"
                  "L_dl2%=:
\t"
                  "sbiw %A0, 1
\t"
                  "brne L_dl2%=
\t"
                                          "dec %1
\t"  
                                          "brne L_dl1%=
\t":"=&w" (cnt):"r"(ms),
"r"((unsigned short) (delay_count))   );
//#else
    unsigned short delay_cnt = F_CPU/6000;
    //unsigned short delay_cnt = 2400;   //*KU* for 14.745600 MHz Clock
    unsigned short delay_cnt_buffer;

    while (ms--) {
                           delay_cnt_buffer = delay_cnt;
                         while (delay_cnt_buffer--);
                      }
                                  */
}


//unsigned char  readram(unsigned int iaddr);
void port_init(void);
void watchdog_init(void);
void uart1_init(void);
//void writeram(unsigned int iaddr, unsigned char ctemp);
void test_ram(void);
void test_net(void);
//void sendstring1(unsigned int * txbuf);
char char2hex(char t1)
{
if((t1>=00) &&(t1<=0x09))t1=t1+0x30;//'0'--'9'
else  
{
  
if((t1>=0x0a)&&(t1<=0x0f))//'A'--'F'
t1=t1-0x0a+0x61;
}
return t1;
}

void sendinthex1(int c)
{
char temph=0,templ=0;
char t1=0,t2=0;

temph=c/256;
templ=c%256;

t1=(c/256)/16;
//t1=t1>>8;
UDR1 = char2hex(t1);
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

7
 

回复 6楼 的帖子

t1=(c/256)%16;
UDR1 = char2hex(t1);
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;

t2=(c%256)/16;//templ&0xf0;
//t2=t2>>8;
UDR1 = char2hex(t2);
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;

t2=(c%256)%16;//templ&0x0f;
UDR1 = char2hex(t2);
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;

}

void sendchar1(char c) // 发送  
{
UDR1 = c;
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;
}

void sendint1( int c) // 发送  
{
UDR1 = (c&0xff00)>>8;
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;

UDR1 = c&0xff;
while(!(UCSR1A & 0x40));
UCSR1A |=0x40;


}


void sendstring1(unsigned char * txbuf) // 发送  
{
unsigned int j;
for (j = 0; *txbuf; j++, txbuf++)sendchar1(*txbuf);
//for(;*txbuf!='/0';txbuf++)

}

void port_init(void)
{
//PA AD0-AD7  地址
//PC AD8-AD15
PORTA = 0xFF;
DDRA  = 0xFF;

PORTC = 0xFF; //m103 output only
DDRC  = 0x00;

//PB4 NETRST O
  
PORTB = 0xFF;
DDRB  = 0x10;
  
PORTD = 0xFF;
DDRD  = 0x00;
// PE0 RXD0  
// PE1 TXD0
// PE4 NET_IRQ  i
// PE5 INFRA_IRQ  i
//  
PORTE = 0xFF;
DDRE  = 0x00;
  
PORTF = 0xFF;
DDRF  = 0x00;
  
PORTG = 0x1F;
DDRG  = 0x00;
}

//Watchdog initialisation
// prescale: 2048K cycles
void watchdog_init(void)
{
WDR(); //this prevents a timout on enabling
//WDTCR = 0x0F; //WATCHDOG ENABLED - dont forget to issue WDRs
/* reset WDT */

/* Write logical one to WDTOE and WDE */
//WDTCR |= (1< WDTCR=0X18;   //现在把WDTCH给关掉了
/* Turn off WDT */
WDTCR = 0x00;
//WDTCR=0X17;

}
//UART0 initialisation
// desired baud rate:115200
// actual baud rate:111111 (3.7%)
// char size: 8 bit
// parity: Disabled
/*
void uart0_init(void)
{
UCSR0B = 0x00; //disable while setting baud rate
UCSR0A = 0x00;
UCSR0C = 0x06;

// UBRRL = (fosc / 16 / (baud + 1)) % 256;  
// UBRRH = (fosc / 16 / (baud + 1)) / 256;  

UBRR0L = (F_CPU / 16 / (baud + 1)) % 256;//0x03;//0x08; //set baud rate lo
UBRR0H = (F_CPU / 16 / (baud + 1)) / 256;//0x00; //set baud rate hi
UCSR0B = 0x18;//0x98;
}
*/
//UART1 initialisation
// desired baud rate:115200
// actual baud rate:111111 (3.7%)
// char size: 8 bit
// parity: Disabled
void uart1_init(void)
{
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

8
 

回复 7楼 的帖子

#ifdef MCUBAUD9600
// UBRRL = (fosc / 16 / (baud + 1)) % 256;  
// UBRRH = (fosc / 16 / (baud + 1)) / 256;  
UCSR1B = 0x00; //disable while setting baud rate
UCSR1A = 0x00;
UCSR1C = 0x06;
UBRR1L = 0x67; //set baud rate lo
UBRR1H = 0x00; //set baud rate hi
UCSR1B = 0x18;
#else  
UCSR1B = 0x00; //disable while setting baud rate
UCSR1A = 0x00;
UCSR1C = 0x06;
UBRR1L = (F_CPU / 16 / (baud + 1)) % 256;//0x03;//0x08; //set baud rate lo
UBRR1H = (F_CPU / 16 / (baud + 1)) / 256;//0x00; //set baud rate hi
UCSR1B = 0x18;//0x98;
#endif  
}
/*
#pragma interrupt_handler int0_isr:2
void int0_isr(void)
{
//external interupt on INT0
}
*/


//call this routine to initialise all peripherals
void init_devices(void)
{
//stop errant interrupts until set up
CLI(); //disable all interrupts
XDIV  = 0x00; //xtal divider
port_init();
  mapping_init();
watchdog_init();
uart1_init();

//External RAM will reside between 8000h - FFFFh.
//There will be 2 wait states for both read and write.

// MCUCR = 0x80;
//EICRA = 0x03; //extended ext ints
//EICRB = 0x00; //extended ext ints
//EIMSK = 0x01;
//TIMSK = 0x00; //timer interrupt sources
//ETIMSK = 0x00; //extended timer interrupt sources
SEI(); //re-enable interrupts
//all peripherals are now initialised
  

  
  
}
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

9
 

回复 8楼 的帖子

/*
unsigned char  readram(unsigned int iaddr)
{
//unsigned char caddl,caddh;
unsigned char cdatatemp=0;
  
RDH;
WRH;
ALEH;
DDRA  = 0xFF;
DDRC  = 0xFF;
PORTC=iaddr>>8;
PORTA=(unsigned char)iaddr;
NOP();
ALEL;  //LATCH IT
DDRA  = 0x00;//PORT INPUT  
RDL;
//2 send wr
NOP();
cdatatemp=PINA;
RDH;
ALEH;
return cdatatemp;
  
}
void writeram(unsigned int iaddr, unsigned char ctemp)
{
//unsigned char caddl,caddh;
unsigned char cdatatemp=0;

RDH;
WRH;
ALEH;
DDRA  = 0xFF;
DDRC  = 0xFF;
PORTC=iaddr>>8;
PORTA=(unsigned char)iaddr;
ALEL;//锁存A0-A7
WRL;
PORTA=ctemp;
NOP();
WRH;
ALEH;
return;
}

#define RAMSTARTADDR  0X1100
#define RAMENDADDR    0X90FF
#define RAMLEN        32768
// 测试32KRAM
void test_ram(void)
{
//1.首先写RAM 0x55
//2.读RAM是否为0X55,如果不是打印出16BITS地址
//3.写RAM0XAA,
//4.读RAM是否为0XAA,如果不是打印出16BITS地址
//5.测试结束
unsigned char temp;
unsigned int i;

temp =0x55;
//for(i=RAMSTARTADDR;i<=RAMENDADDR;i++)writeram(i,temp);

for(i=RAMSTARTADDR;i<=RAMENDADDR;i++)
{//temp=readram(i);
//if(readram(i)!=0x55)printf("error addr is i=%x  
",i);
}

temp =0xaa;
for(i=RAMSTARTADDR;i<=RAMENDADDR;i++);//writeram(i,temp);

for(i=RAMSTARTADDR;i<=RAMENDADDR;i++)
{//temp=readram(i);
//if(readram(i)!=0xaa)printf("error addr is i=%x  
",i);
}
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

10
 

回复 9楼 的帖子

}
*/
//测试RTL8019AS
void test_net(void)
{

}

//

void main(void)
{
unsigned int k=0;
unsigned int i=0,j=0;
unsigned char DATA,u;  
//COM=1;
  MCUCR = 0x80; // 允许外部并行扩展接口
  init_devices();
  /*
  XMCRA = 0x44; //0x00 external memory
  XMCRB = 0x01; // 释放PC7,作为通用I/O引脚使用  
  DDRC = 0xff; // PC7,PC6用于输出,(不影响PC0-PC5地址线)  
  PORTC = 0x00; // PC7,PC6输出0,(不影响PC0-PC5地址线)  
*/

XMCRA = 0x4A; //external memory
//XMCRB = 0x01; // 释放PC7,作为通用I/O引脚使用  
// DDRC = 0xff; // PC7,PC6用于输出,(不影响PC0-PC5地址线)  
// PORTC = 0x00; // PC7,PC6输出0,(不影响PC0-PC5地址线)  
//printf("this is uart1
");

Delayxms(50);
//for(k=0;k<100;k++)sendchar1(0x55);
sendstring1("init system ok!
");
sendstring1("now test system-ram  all is 32k !
");
for(u=0;u<4;u++)
{
   
        sendstring1("----now write  ram  ");
        sendinthex1(testramtable);
        sendstring1("
");
         
        i=0;
        do{
        //        *(p+i)=testramtable;testok  
   txbuf1=testramtable;
        i++;
        }while(i>0x6eff);
         
        sendstring1("----write ok
");
        sendstring1("----now check write
");
         
         
         k=0x1100;
                i=0;
                do{  
                  //DATA = *(p+i);test ok
                  DATA=txbuf1;
                  //if(DATA!=testramtable)
                  
                  sendstring1("addr = ");
                  sendinthex1(k);
                  sendstring1(" =");
                  sendinthex1(DATA);
                  sendstring1("
");
                  k++;i++;  
                 }while(k<0x1110);
                //0x7fff);
                 
sendstring1("---- test system-ram  end!
");
}
//while(1){}

// sendstring1("now test rtl8019as!
");
// test_net();
//sendstring1("----test rtl8019as end!
");

}
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

11
 

回复 10楼 的帖子

12:38:29> init system ok!
12:38:29> now test system-ram  all is 32k !
12:38:29> ----now write  ram  0000
12:38:29> ----write ok
12:38:29> ----now check write
12:38:29> addr = 1100 =0000
12:38:29> addr = 1101 =006c
12:38:29> addr = 1102 =0082
12:38:29> addr = 1103 =0094
12:38:29> addr = 1104 =006a
12:38:29> addr = 1105 =0080
12:38:29> addr = 1106 =00f0
12:38:29> addr = 1107 =0048
12:38:29> addr = 1108 =0087
12:38:29> addr = 1109 =00c2
12:38:29> addr = 110a =0044
12:38:29> addr = 110b =004a
12:38:29> addr = 110c =0013
12:38:29> addr = 110d =00b0
12:38:29> addr = 110e =0080
12:38:29> addr = 110f =00c3
12:38:29> ---- test system-ram  end!
12:38:29> ----now write  ram  0055
12:38:29> ----write ok
12:38:29> ----now check write
12:38:30> addr = 1100 =0055
12:38:30> addr = 1101 =006c
12:38:30> addr = 1102 =0082
12:38:30> addr = 1103 =0094
12:38:30> addr = 1104 =006a
12:38:30> addr = 1105 =0080
12:38:30> addr = 1106 =00f0
12:38:30> addr = 1107 =0048
12:38:30> addr = 1108 =0087
12:38:30> addr = 1109 =00c2
12:38:30> addr = 110a =0044
12:38:30> addr = 110b =004a
12:38:30> addr = 110c =0013
12:38:30> addr = 110d =00b0
12:38:30> addr = 110e =0080
12:38:30> addr = 110f =00c3
12:38:30> ---- test system-ram  end!
12:38:30> ----now write  ram  00aa
12:38:30> ----write ok
12:38:30> ----now check write
12:38:30> addr = 1100 =00aa
12:38:30> addr = 1101 =006c
12:38:30> addr = 1102 =0082
12:38:30> addr = 1103 =0094
12:38:30> addr = 1104 =006a
12:38:30> addr = 1105 =0080
12:38:30> addr = 1106 =00f0
12:38:30> addr = 1107 =0048
12:38:30> addr = 1108 =0087
12:38:30> addr = 1109 =00c2
12:38:30> addr = 110a =0044
12:38:30> addr = 110b =004a
12:38:30> addr = 110c =0013
12:38:30> addr = 110d =00b0
12:38:30> addr = 110e =0080
12:38:30> addr = 110f =00c3
12:38:30> ---- test system-ram  end!
12:38:30> ----now write  ram  0000
12:38:30> ----write ok
12:38:30> ----now check write
12:38:30> addr = 1100 =0000
12:38:30> addr = 1101 =006c
12:38:30> addr = 1102 =0082
12:38:30> addr = 1103 =0094
12:38:30> addr = 1104 =006a
12:38:30> addr = 1105 =0080
12:38:30> addr = 1106 =00f0
12:38:30> addr = 1107 =0048
12:38:30> addr = 1108 =0087
12:38:30> addr = 1109 =00c2
12:38:30> addr = 110a =0044
12:38:31> addr = 110b =004a
12:38:31> addr = 110c =0013
12:38:31> addr = 110d =00b0
12:38:31> addr = 110e =0080
12:38:31> addr = 110f =00c3
12:38:31> ---- test system-ram  end!
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

12
 

回复 11楼 的帖子

下面主要测试外部RAM和RTL8019的读写!!!
1.外部RAM的测试已经完成

ATEMGA128-16读写外部32KRAM-70NS的完整测试程序!!  
http://www2.ouravr.com/bbs/bbs_c ... ge_no=1&bbs_id=1031

2.RTL8019AS读写成功!!!
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

13
 

这个是RTL8019没有初始化的寄存器读出的图片!!

 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

14
 

回复 13楼 的帖子

下面初始化RTL8019AS后再读取寄存器中的值,,以验证写入的正确性!这样就可以正常读写RTL8019AS!!!
1.先调用SHOWREG读取RTL8019AS的寄存器数值;
2.init_net()来初始化RTL8019AS
3.调用SHOWREG读取RTL8019AS的寄存器数值;
4.如果正确,则对RTL8019AS的读写就OK了!!!
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

15
 

下面是测试的图片!!!

 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

16
 

看到上述的PAGE3有问题 和PAGE2 的数值一样!!

看到上述的PAGE3有问题 和PAGE2 的数值一样!!
修改代码得到如下串口输出结果!!
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

17
 

看我做的AVR单片机以太网项目-step by step 2


红色的代表RTL8019的ID0 和ID1 只有RTL8019AS有的,属于特征代码,读到0X50/0X70代表RTL8019AS复位正常,可以工作!!
绿色部分: 0x6d,0x69,0x72,0x72,0x6f,0x72是我设置的网卡的MAC地址 是字符!
//本机MAC和IP设置
static char MYMAC[6] = { 'm','i','r','r','o','r' };

至此UART0/1,外部RAM读写,和网络接口都已经完成,下面开始移植UIP0.9!!!
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

18
 

看我做的AVR单片机以太网项目-step by step 2

测试UIP中的 RTL8019.H/.C,检测是否需要参数修改!!
首先建立一个项目,来调用UIP的RTL8019.H/.C  
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

19
 

看我做的AVR单片机以太网项目-step by step 2

整合UIP中的RTL8019.H/C作了一个完整测试的程序!程序输出如下:
11:55:05> now uart1 !
11:55:05> delay 1s!
11:55:06> now uart0!
11:55:06>  
11:55:06>  RAMTEST START !
11:55:06> -----POINTER  READ AND WRITE EXTERNAL 32K RAM----------
11:55:07> 0 READ AND WRITE NO WAIT  PC7 RELEASED !
11:55:07> init system ok!
11:55:07> now test system-ram  all is 32k !
11:55:07> ----now write  ram  0000
11:55:08> ----write ok
11:55:08> ----now check write
11:55:08> ---- test system-ram  end!
11:55:08> ----now write  ram  0055
11:55:08> ----write ok
11:55:09> ----now check write
11:55:09> ---- test system-ram  end!
11:55:09> ----now write  ram  00aa
11:55:09> ----write ok
11:55:09> ----now check write
11:55:10> ---- test system-ram  end!
11:55:10> ----now write  ram  0000
11:55:10> ----write ok
11:55:10> ----now check write
11:55:11> ---- test system-ram  end!
11:55:11> 1 READ AND WRITE 1 WAIT  PC7 RELEASED !
11:55:11> init system ok!
11:55:11> now test system-ram  all is 32k !
11:55:12> ----now write  ram  0000
11:55:12> ----write ok
11:55:12> ----now check write
11:55:12> ---- test system-ram  end!
11:55:12> ----now write  ram  0055
11:55:12> ----write ok
11:55:13> ----now check write
11:55:13> ---- test system-ram  end!
11:55:13> ----now write  ram  00aa
11:55:13> ----write ok
11:55:14> ----now check write
11:55:14> ---- test system-ram  end!
11:55:14> ----now write  ram  0000
11:55:14> ----write ok
11:55:15> ----now check write
11:55:15> ---- test system-ram  end!
11:55:15> 2 READ AND WRITE 2 WAIT  PC7 RELEASED !
11:55:15> init system ok!
11:55:16> now test system-ram  all is 32k !
11:55:16> ----now write  ram  0000
11:55:16> ----write ok
11:55:17> ----now check write
11:55:17> ---- test system-ram  end!
11:55:17> ----now write  ram  0055
11:55:17> ----write ok
11:55:17> ----now check write
11:55:18> ---- test system-ram  end!
11:55:18> ----now write  ram  00aa
11:55:18> ----write ok
11:55:18> ----now check write
11:55:19> ---- test system-ram  end!
11:55:19> ----now write  ram  0000
11:55:19> ----write ok
11:55:20> ----now check write
11:55:20> ---- test system-ram  end!
11:55:20> 3 READ AND WRITE 2+1 WAIT  PC7 RELEASED !
11:55:20> init system ok!
11:55:21> now test system-ram  all is 32k !
11:55:21> ----now write  ram  0000
11:55:21> ----write ok
11:55:21> ----now check write
11:55:22> ---- test system-ram  end!
11:55:22> ----now write  ram  0055
11:55:22> ----write ok
11:55:22> ----now check write
11:55:23> ---- test system-ram  end!
11:55:23> ----now write  ram  00aa
11:55:23> ----write ok
11:55:24> ----now check write
11:55:24> ---- test system-ram  end!
11:55:24> ----now write  ram  0000
11:55:24> ----write ok
11:55:25> ----now check write
11:55:25> ---- test system-ram  end!
11:55:25> ******POINTER  READ AND WRITE EXTERNAL 32K RAM*******
11:55:26>  
11:55:26> -----BUFFER READ AND WRITE EXTERNAL 32K RAM----------
11:55:27> 4  READ AND WRITE  NOWAIT PC7  NO RELEASED !
11:55:27> init system ok!
11:55:27> now test system-ram  all is 32k !
11:55:28> ----now write  ram  0000
11:55:28> ----write ok
11:55:28> ----now check write
11:55:28> ---- test system-ram  end!
11:55:28> ----now write  ram  0055
11:55:29> ----write ok
11:55:29> ----now check write
11:55:29> ---- test system-ram  end!
11:55:29> ----now write  ram  00aa
11:55:30> ----write ok
11:55:30> ----now check write
11:55:30> ---- test system-ram  end!
11:55:30> ----now write  ram  0000
11:55:31> ----write ok
11:55:31> ----now check write
11:55:31> ---- test system-ram  end!
11:55:31> 5  READ AND WRITE  1 WAIT PC7  NO RELEASED !
11:55:32> init system ok!
11:55:32> now test system-ram  all is 32k !
11:55:32> ----now write  ram  0000
11:55:32> ----write ok
11:55:33> ----now check write
11:55:33> ---- test system-ram  end!
11:55:33> ----now write  ram  0055
11:55:33> ----write ok
11:55:34> ----now check write
11:55:34> ---- test system-ram  end!
11:55:34> ----now write  ram  00aa
11:55:34> ----write ok
11:55:34> ----now check write
11:55:35> ---- test system-ram  end!
11:55:35> ----now write  ram  0000
11:55:35> ----write ok
11:55:35> ----now check write
11:55:36> ---- test system-ram  end!
11:55:36> 6  READ AND WRITE  2WAIT PC7  NO RELEASED !
11:55:36> init system ok!
11:55:37> now test system-ram  all is 32k !
11:55:37> ----now write  ram  0000
11:55:37> ----write ok
11:55:37> ----now check write
11:55:38> ---- test system-ram  end!
11:55:38> ----now write  ram  0055
11:55:38> ----write ok
11:55:38> ----now check write
11:55:39> ---- test system-ram  end!
11:55:39> ----now write  ram  00aa
11:55:39> ----write ok
11:55:39> ----now check write
11:55:40> ---- test system-ram  end!
11:55:40> ----now write  ram  0000
11:55:40> ----write ok
11:55:40> ----now check write
11:55:41> ---- test system-ram  end!
11:55:41> 7  READ AND WRITE  2+1WAIT PC7  NO RELEASED !
11:55:41> init system ok!
11:55:42> now test system-ram  all is 32k !
11:55:42> ----now write  ram  0000
11:55:42> ----write ok
11:55:42> ----now check write
11:55:43> ---- test system-ram  end!
11:55:43> ----now write  ram  0055
11:55:43> ----write ok
11:55:43> ----now check write
11:55:43> ---- test system-ram  end!
11:55:44> ----now write  ram  00aa
11:55:44> ----write ok
11:55:44> ----now check write
11:55:44> ---- test system-ram  end!
11:55:45> ----now write  ram  0000
11:55:45> ----write ok
11:55:45> ----now check write
11:55:45> ---- test system-ram  end!
11:55:45>  
11:55:46> *******BUFFER READ AND WRITE EXTERNAL 32K RAM***********
11:55:46> ---- RAM TEST OK!-----
11:55:46>  
11:55:47>  now test rtl8019as!
11:55:47> now show first rtl8019as reg !
11:55:47>  
11:55:47>  Realtek 8019AS Register dump
11:55:48>  REG  Page0 Page1 Page2 Page3
11:55:48> 0000    0021    0061    00a1    00e1   
11:55:48> 0001    0000    0008    000a    0034   
11:55:49> 0002    00ff    002a    0000    0000   
11:55:49> 0003    00c3    00a0    00ff    0008   
11:55:50> 0004    0003    0040    0032    0080   
11:55:50> 0005    0000    00b6    00ff    0000   
11:55:50> 0006    0000    0084    00ff    0000   
11:55:51> 0007    0080    00df    00ff    00ff   
11:55:51> 0008    00ff    0010    00ff    0000   
11:55:51> 0009    000f    0059    00ff    00fe   
11:55:52> 000a    0050    0042    00ff    00ff   
11:55:52> 000b    0070    0000    00ff    00fe   
11:55:52> 000c    0016    0010    00c4    00ff   
11:55:53> 000d    0000    004d    00e0    00fe   
11:55:53> 000e    0000    0000    0084    00ff   
11:55:54> 000f    0000    0001    0080    00ff   
11:55:54> now init rtl8019as!
11:55:54> now show second rtl8019as reg !
11:55:54>  
11:55:55>  Realtek 8019AS Register dump
11:55:55>  REG  Page0 Page1 Page2 Page3
11:55:55> 0000    0023    0063    00a3    00e3   
11:55:56> 0001    0000    006d    0046    0030   
11:55:56> 0002    00ff    0069    0060    0000   
11:55:57> 0003    0046    0072    00ff    000c   
11:55:57> 0004    0003    0072    0040    0080   
11:55:57> 0005    0000    006f    00ff    0020   
11:55:58> 0006    0000    006b    00ff    0000   
11:55:58> 0007    0080    0046    00ff    00ff   
11:55:59> 0008    00ff    0010    00ff    0000   
11:55:59> 0009    000f    0059    00ff    00fe   
11:55:59> 000a    0050    0042    00ff    00ff   
11:56:00> 000b    0070    0000    00ff    00fe   
11:56:00> 000c    0016    0010    00c4    00ff   
11:56:01> 000d    0000    004d    00e0    00fe   
11:56:01> 000e    0000    0000    00d8    00ff   
11:56:02> 000f    0000    0001    0091    00ff   
11:56:02> ----test rtl8019as end!

完整的输出如上.
现在可以移植UIP了! ^-^  哈哈!!!!!
 
 
 

回复

24

帖子

0

TA的资源

一粒金砂(高级)

20
 

看我做的AVR单片机以太网项目-step by step 2

delay.h,delay,c    延时函数
buffer.h,buffer,c    缓冲管理函数
uart128.h,uart128.c  双串口接口函数
global.h        全局变量定义
rtl8019.h,rtl8019.c 网络接口函数
helleworld.c   主程序
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/6 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表