Shop OBEX P1 Docs P2 Docs Learn Events
What's the max throughput of the W5100 in SPI mode? — Parallax Forums

What's the max throughput of the W5100 in SPI mode?

agsags Posts: 386
edited 2011-01-23 21:46 in Accessories
Someone must have figured this out, but a search didn't turn anything up. What is the maximum sustained bitrate when using the WizNet in SPI mode and a UDP socket? A very rough calcuation I've done is:

bit-banging the SPI signals (in PASM) means 2 instructions per SPI clock
4 Prop clocks per instruction
80 MHz Prop clock

80M/(2x4) = 10Mbps

This is a maxium, assuming there's nothing else going on in the cog reading the WizNet, and also deals with just the reading of data, ignoring the need to maniuplate the various WizNet registers (RSR, RD, CR, etc.). It also assumes the processing of the data in any other cog doesn't stall the reading cog.

So, a rough guess might be something closer to 1Mbps. Does that make sense and/or has it been tested in real life?

Thanks,

Al

Comments

  • DynamoBenDynamoBen Posts: 366
    edited 2011-01-23 20:49
    Last time I did the math I got about 2Mbs. (doesn't include any of the SPIN overhead)

    The read SPI code takes 3.55us and the write takes 3.60us. Each sends 32bits, 8 of which are data.
  • agsags Posts: 386
    edited 2011-01-23 20:56
    That sounds in the ballpark. Let's see if I can figure out a useful way to put all those bits to some good use...

    Thanks!
  • Timothy D. SwieterTimothy D. Swieter Posts: 1,613
    edited 2011-01-23 21:46
    I believe Ben is quoting from the comments in the ASM driver. While I was developing the drivers Ben (and others on the forum) enlightened me on the speed of using a counter to big-bang the SPI and thus the speed that it is capable of. For the driver portions, the SPI couldn't go any faster because of Prop speed limitations. But when you want to talk throughput, you should consider the overhead portion and to try and optimize this part. And of course if you really need speed, switch to the indirect driver which can offer faster transfer rates from the Prop to WIZnet.
Sign In or Register to comment.