|
Есть спецы работавшие с RTL8019AS? Пытаюсь заюзать его на Mega128. Собрал макетное устройство. RTL нормально инициализируется (могу прочитать ID), и даже генерит прерывание по входящим пакетам, но во никак не получается прочитать заголовок и содержимое входящих пакетов из встроенного ОЗУ (читаются одни байты со значением 0xff). Значение регистра RSR в момент прихода пакета содержит 33 (то есть нет ошибок, установлен бит признака того что пришел broadcast пакет - это правильно, их я и отсылаю макетному устройству со своего компа).
Перепробовал все (даже включал promisques mode) - не помогает ;(((
Ниже поясняющий кусок кода того, как я пытаюсь прочитать данные из встроенного в RTL ОЗУ:
// we don't want to be interrupted by NIC owerflow
clrbit(EIMSK, RTL_SIGNAL_BIT);
// Get the current page pointer. It points to the page where the NIC
// will start saving the next incoming packet.
nic_write(NIC_CR,NIC_CR_STA|NIC_CR_RD2|NIC_CR_PS0);
__mpu_clocks_delay(WAIT5);
curr=nic_read(NIC_PG1_CURR);
nic_write(NIC_CR,NIC_CR_STA|NIC_CR_RD2);
// Get the pointer to the last page we read from. The following page is the one
// where we start reading. If it's equal to the current page pointer, then there's
// nothing to read. In this case we return a null pointer.
bnry=nic_read(NIC_PG0_BNRY)+1;
if (bnry>=NIC_STOP_PAGE) bnry=NIC_FIRST_RX_PAGE;
if (bnry==curr) {
setbit(EIMSK,RTL_SIGNAL_BIT); // enable interrupt 5
return 0; // nothing to receive
}
// read the NIC specific packet header (fcs?)
nic_write(NIC_PG0_RBCR0,sizeof(nic_pkt_header));
E-mail:
info@telesys.ru
nic_write(NIC_PG0_RBCR1,0);
nic_write(NIC_PG0_RSAR0,0);
nic_write(NIC_PG0_RSAR1,bnry);
buf=(unsigned char *)&hdr;
nic_write(NIC_CR,NIC_CR_STA|NIC_CR_RD0);
__mpu_clocks_delay(WAIT5);
for (i=0;i
Ответы