Go Down

Topic: RESET CPU (Read 3791 times) previous topic - next topic

tretas

Boas,

Sou velho mas ... isso já tinha percebido eu ... só não sei é o que alterar, será este codigo deste post ?

Quote

I've given up on these patches, instead  I  'pulled' the central repository off github and a am applying the patches to my own copy, but only after testing each one, then merging in my own patches.

There is another 'stupid' bug in w5100.cpp:
Code:
initSS();
  writeMR(1<<RST);
  writeTMSR(0x55);
  writeRMSR(0x55);

for (int i=0; i<MAX_SOCK_NUM; i++) {
    SBASE = TXBUF_BASE + SSIZE * i;
    RBASE = RXBUF_BASE + RSIZE * i;
  }

If people READ the chips data sheet they would see that it takes 10ms for the chip to 'software' reset (W5100 V1.2.4 P.64), as such the code should be:

Code:
initSS();
  // Issue a software reset to the W5100 chip.
  writeMR(1<<RST);
  //wait 100ms for the chip to physically reset(it takes 10ms but manufacturer request 100ms).
  delay(100);
  // Continue with the setup of the internal registers.
  writeTMSR(0x55);
  writeRMSR(0x55);

fortunately the W5100 chip has some default values, so as the reset is stamping on them, they are being reinitialized to the default,
There may be a chance this bug is stamping on the setting up of the sockets.....

I'm still trying to get an answer back off the manufacturer as to *if the  RST bit is 'testable' because if it was, then I would drop in a subroutine, both BEFORE & after the reset, (which would negate the need for the stupid delay(300)
With a TESTABLE state that could be returned up the stack. Currently when initializing a library on the arduino they mostly return 'void'.



Arduino Mega 2560
Arduino Nano
Arduino UNO Rev3
Raspberry PI Model B
EasyPIC v4

bubulindo

Onde encontrares isto:

Code: [Select]
nitSS();
  writeMR(1<<RST);
  writeTMSR(0x55);
  writeRMSR(0x55);


Trocas por isto:

Code: [Select]
initSS();
  // Issue a software reset to the W5100 chip.
  writeMR(1<<RST);
  //wait 100ms for the chip to physically reset(it takes 10ms but manufacturer request 100ms).
  delay(100);
  // Continue with the setup of the internal registers.
  writeTMSR(0x55);
  writeRMSR(0x55);
This... is a hobby.

tretas

Boas

Obrigada foi mesmo isso que tinha feito, como confirma o meu post acima

Cpts

Zé tretas
Arduino Mega 2560
Arduino Nano
Arduino UNO Rev3
Raspberry PI Model B
EasyPIC v4

Go Up