A thriving discussion! Awesome. Thanks for all the input so far guys. OK, here we go...
Graynomad:
ATtiny1634, 20 pins, 2 USARTs, 1k SRAM, 16k flash
Ah, thanks! I was on the fence about the 2313's RAM. It should be enough for what I want it to do, but if I need more, I know where to look. Not sure whether I want to chicken out and take advantage of two hardware serials per chip, or stick to the discipline of trying to synchronize multiple devices just for the sake of it. Something to think about...
You have about 100k Bytes/second you need to pump, which is only about 160 instructions per byte at 16MHz. ... Hm, my calculator says 64.8KB/s (assuming 8-N-1) if you go ahead and use traditional SS SPI (no packet prefixes).
115.2Kb/s / 8 * 4 = 57.6KB/s raw data, potentially -- again, in theory, if all ports are at 100%. In full-duplex, that would be 115.2KB/s. Plus any preamble or other overhead.
tylernt:
SirNickity, you mentioned a parallel bus to the Wiznet -- I'm not sure that's where the parallel bus should be. The ATTiny 2313 has pins PB0 through PB7 that (I presume) could be used as an 8-bit parallel bus to the Atmega. On the Atmega, PD0 though PD7 could be used (leaving hardware SPI port B free for the Wiznet).
More info on that: I bought a standalone WizNet module -- the WIZ811MJ -- which is a snap-in module kinda like the Zigbee stuff. Basically a life-support board for the raw IC. The WizNet W5100 IC itself can use either SPI or a parallel interface (controlled by a signal pin), and the parallel bus is indeed broken out on the module. It uses 8 data bits (naturally), and a 14-bit address bus though, which means the big AVR would probably need to be something with more pins, like an ATmega1284. (Using shift registers here would defeat the point of going parallel.)
I haven't completely thought this through yet, but it should be possible to signal time-slices (using a write-enable and read-enable signal to the tiny) so the tiny writes its data byte to the bus while the mega writes the address bits for the WizNet, then tells the WizNet to read the data bus. This prevents having to transfer the data from tiny to mega, then from mega to WizNet. Plus, if the mega is going to echo the data to its local upstream serial port, it can grab the byte while it's already there on the bus. Make sense?
tylernt:
Further, with an additional clock pin, data could be sent in bursts of several bytes at a time from each ATTiny in turn to cut down on overhead. Don't use interrupts; have the Atmega poll each ATTiny round-robin and let them buffer between bursts.
Again, I haven't completely fleshed this out in my head, but I was thinking the same thing. If the tiny signals data-available via a HIGH pin, I can read that, set its write-enable pin HIGH, wait for the data to appear on the bus, write the address bits and signal the WizNet to read the byte, strobe the tiny (for the next byte) until the data-available pin goes LOW (or a maximum of say 8 bytes to keep bus contention low), then drop write-enable, set read-enable if there's data to be sent TO the tiny, follow pretty much the same procedure in reverse, then on to the next tiny, etc. The WizNet supports auto-increment on the address bus, so with strobing, multiple bytes can be sent pretty fast.
The tiny can just poll constantly since it won't have much else to do. I wouldn't even have to use serial interrupts. It could just poll the signal pins, poll the UART, goto 10.
I would have to write this as a short program and see what the instruction count looks like, but it seems reasonable. You guys seem to have the cycle counts right at the tip of your tongue. (Respect.) 8) Remember, clock speed can be 14.745 or 18.432MHz for serial compatibility. On a side note, neither of these seems to support an even divisor below 9600. Not sure that's a big problem in reality. I guess I could set a system clock divider on the tiny for low-speed comms.
tylernt:
Say... if the ATTiny/Atmega clocks are all synchronized, does that mean bits/bytes can be transferred in a single clock cycle instead of two?
Exactly. XD One of the reasons this practical project dovetails nicely with the synchronized clock exercise.
mrburnette:
Just a warning... As you are working in a commercial company as an employee, you must have permission to install any custom designed hardware on their network. In some companies, you may need AVP or VP level written approval.
That's a good point, and thanks for bringing it up. My intended use is more for field, lab, or initial configuration work rather than a fixed install. I.e., this isn't going in an equipment rack. We have actual terminal servers and routers for that. At my desk, though, I have a stack of routers and switches. The routers stay there for labs and configuration proving. On the switches, I'm upgrading the firmware and clearing the configs so they can be put back in stock. Also checking one for possible RMA. That's the kind of stuff I want to use this device for. The Ethernet end will probably go directly into my laptop, although I do have a jack with an appearance of the "public" Internet network. On one hand, there's not much liability for that network -- it's the Internet. OTOH, my device isn't meant to be secure, so I would have to be exceedingly careful about having it exposed to the wild if there's anything behind it that I wouldn't want similarly exposed.