EmbeddedRelated.com
Forums
Memfault Beyond the Launch

Ethernet on AVR

Started by Meindert Sprang December 18, 2003
Just a quick question: what would be a good choice of ehternet chip to
attach to an AVR? My first thought is a Crystal, but maybe there are better
option?
My AVr of choice would be a ATmega162.

Meindert


Meindert Sprang wrote:
> Just a quick question: what would be a good choice of ehternet chip to > attach to an AVR? My first thought is a Crystal, but maybe there are better > option?
The CS8900 got a minor problem in 8-bit mode. Sometimes it stops raising interrupts. Could be easily fixed be polling the chip from time to time. With the RTL8019AS take care, that you can't use the upper 8k internal RAM. Another problem is, that the AVR cannot "stetch" memory cycles if the chip raises IOCHRDY. This can be fixed by emulating the external memory interface by port bits, but that's much slower than using AVR's native memory interface. For 100 Mbps we use the LAN91C111. Sometimes it doesn't free it's internal packet buffers. May be caused by the 8-bit mode, because I never found any similar problem report about the Linux driver. Could be fixed by resetting the MAC. All three chips are supported by the Ethernut's Open Source TCP/IP stack, running on an ATmega128 http://www.ethernut.de/ Regards, Harald -- For spam do not replace spamtrap with my name
"Meindert Sprang" <mhsprang@NOcustomSPAMware.nl> wrote in message
news:3fe1dc48$1@news.nb.nu...
> Just a quick question: what would be a good choice of ehternet chip to > attach to an AVR? My first thought is a Crystal, but maybe there are
better
> option? > My AVr of choice would be a ATmega162. >
My choices are: SMC LAN91C96 for 10 Mbit/s and SMC LAN91C111 for 10/100 Mbit/s, though they may be a little on the expensive side for an AVR project. Tauno Voipio tauno voipio @ iki fi
Meindert Sprang wrote:

> Just a quick question: what would be a good choice of ehternet chip > to attach to an AVR? My first thought is a Crystal, but maybe there > are better option? > My AVr of choice would be a ATmega162.
In addition to those mentioned by Harald, there is the W3100 from Wiznet http://wiznet.co.kr I use it with a ATmega161. It is 100Mbit and has a hardware TCP/IP stack. It is limited to four connections. However, I have had some problems with strange things going on, if a TCP-socket is closed while there is still unacknowleged data. I haven't spend the time to track this down. Also the documentation leaves out a few things, which you should know, when you try to optimize chip access. Nevertheless, I'm quite satisfied with this little beast. A real bonus is indirect addressing (with optional auto-inc). So, you only need 4-byte address-space. A real bad thing for some applications might be, that you don't have much influence on the packet handling (e.g. AFAIK you can't flush the buffer). BTW: Tech-Support-Forum on their Website was quite fast and good. /Jan-Hinnerk
Meindert Sprang wrote:
> Just a quick question: what would be a good choice > of ehternet chip to attach to an AVR? My first > thought is a Crystal, but maybe there are better > option? > My AVr of choice would be a ATmega162.
Check out http://www.edtp.com for some good prototyping resources. They offer proto boards for PIC and AVR with RTL8019AS, CS8900, and ASIX 10/100, along with driver code to get you going. They used to offer a suite of NIC proto boards with headers pinned to match the AVR proto board. I imagine if you asked, they'd still sell them. Richard
"Meindert Sprang" <mhsprang@NOcustomSPAMware.nl> wrote in message
news:3fe1dc48$1@news.nb.nu...
> Just a quick question: what would be a good choice of ehternet chip to > attach to an AVR? My first thought is a Crystal, but maybe there are
better
> option? > My AVr of choice would be a ATmega162. > > Meindert >
I'm successfully using the RTL8019 with an ATmega162, with my own UDP/IP stack (with lots of pointers from ethernut, uip and TCP/IP Lean). For the prototype I used one of edtp's packet whackers on top of an STK500 to develop my software while my hardware was being built. Software and hardware hit the ground virtually at the same time. This was a really painless way to get stuff running. The Realtek chip was less than half the price of the crystal product down under, YMMV. Be aware that the next step upwards on the migration path after the ATmega 162 is the ATmega 64 unless you want to fake the data bus. There's no halfway step with an external databus. I'd be interested in comparing notes at some time, Meindert. HTH, Cheers Alf Katz alfkatz@remove.the.obvious.ieee.org --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.550 / Virus Database: 342 - Release Date: 10/12/2003
"Meindert Sprang" <mhsprang@NOcustomSPAMware.nl> wrote in message
news:3fe1dc48$1@news.nb.nu...
> Just a quick question: what would be a good choice of ehternet chip to > attach to an AVR? My first thought is a Crystal, but maybe there are
better
> option? > My AVr of choice would be a ATmega162.
Thanks for all the suggestions so far. Especially to Richard for pointing me to http://www.edtp.com . I ordered their AVR board. Meindert

Memfault Beyond the Launch