http://www.maxim-ic.com/app-notes/index.mvp/id/186
Specifically:
http://www.maxim-ic.com/datasheet/index.mvp/id/3748
The above describes the Maxim DS2502-E48 chip, which contains a legal MAC address.
> For the further use, I'd like to programm a unique MAC address to every controller at the time of flashing.
Do you know you're meant to buy a "Company Unique identifier" from the IEEE? You can of course use "something random" with the risk of generating a duplicate MAC address to something else on the network. Using the Maxim chip gets you a legal address without that worry.
The only "tricky bit" is getting a one-wire protocol driver running so you can talk to it.
Otherwise you have to allocate some bytes somewhere in the FLASH in the chip somewhere, and have a way of initially setting that to the unique board Serial number or a MAC address. Then, whenever the software is updated in the part, the on-board or off-board programming software has to guarantee to save the old serial number before erasing the FLASH, and to put it back afterwards.
If you have multiple FLASH blocks and have a reason to run an EEPROM emulator in one of them, then you can save the serial number in there.
Of course if you have a reason to have an off-board SPI or I2C EEPROM then you can save it in there.
> "just" have to implement ethernet, arp, ip, icmp and UDP.
Why reinvent those wheels? Why reinvent all the 30 year old known networking bugs? Everybody who does this from scratch seems to get the same things wrong, time and time again.
At least have a look at FNET (one of the "Sticky Subjects" at the top of this forum). I've downloaded and looked at the code, and it is very good.
Tom