renatoaloi / EtherEncLib

Ethernet ENC28J60 Library for Arduino
GNU General Public License v3.0
26 stars 14 forks source link

unstable See Rev. B7 Silicon Errata issues 12 and 13 #10

Open lutzha opened 9 years ago

lutzha commented 9 years ago

// Reset the transmit logic problem. See Rev. B7 Silicon Errata issues 12 and 13 writeOp(ENC28J60_BIT_FIELD_SET, ECON1, ECON1_TXRST); writeOp(ENC28J60_BIT_FIELD_CLR, ECON1, ECON1_TXRST); writeOp(ENC28J60_BIT_FIELD_CLR, EIR, EIR_TXERIF | EIR_TXIF); // send the contents of the transmit buffer onto the network writeOp(ENC28J60_BIT_FIELD_SET, ECON1, ECON1_TXRTS); // wait for transmission to complete or fail { unsigned long timer = millis(); while (((eir = readReg(EIR)) & (EIR_TXIF | EIRTXERIF)) == 0) { if (millis() - timer > 1000) { /* Transmit hardware probably hung, try again later. / /_ Shouldn't happen according to errata 12 and 13. */ writeOp(ENC28J60_BIT_FIELD_CLR, ECON1, ECON1_TXRTS); return false; } } } writeOp(ENC28J60_BIT_FIELD_CLR, ECON1, ECON1_TXRTS);

renatoaloi commented 9 years ago

Hi! Nice info! I am freeing some time here to finish the lib enhancements...

That reset transmit logic always troubled me. Thanks for the help! Nice code! Are you using it that way?

Is This code solve colision packet problem?

Thank you for your contribution! Renato Aloi

lutzha commented 9 years ago

i take it from microchip forum, it works after little changes. now stable since 4h ;)