W5100 and codevision beginer

hello to all

im using the codevision compiler for AVR chips, and in the site have an example with mega328p and W5100 chip as ethernet web server

this exampole works and im running now!

but i wand to crete an application to use as web client so the avr can web request to a site

please im beginer with this and i need a help of the register configuration

as server the mode register is 0x80 , and from datasheet i see that this sets bit 7 - S/W Reset

so to use as client
must set Socket 0: Command Register Address as 0x04 (connect)


For using theh client mode of a socket,

  1. Set a socket mode : Set Sn_MR_TCP bits in Sn_MR with socket number 0
  2. Set a souce port num of the socket: Set a random number to S0_PORTR
  3. Open the socket : Set OPEN bit in S0_CR
  4. Set the server port number : Set the listen port number as 80 to S0_DPORTR
  5. Connect to the server : Set CONNECT bit of S0_CR
  6. Wait to be connected : Check S0_IR’s CONNECT bit or S0_SR becomes SOCK_ESTABLISHED
  7. When connected : Sending request & Parsing the reply from the server
  8. When not connected : Check S0_IR’s TIMEOUT bit or S0_SR becomes SOCK_CLOSED → Retry 1~6 with different from the previous Sn_PORT value.

Thank you.

Hello! In the first message it was written about a working example for w5100+atmega 328p for codevision. Can you send me a link for it? I cannot find it on the web-site

Dear AnnaRukavitsyna

I’m sorry. we don’t have codevision example.
We have just AVR studio example. (w5100 evb board configured with ATmega128.)

If you want to AVR studio example, I will send it.


Could you pls send this example to me?
I trying to do client now but no success. I tried server before and it was working nice.
There is problem with setting DIPR and DPORT after CR_OPEN. Sometimes its saves sometimes not. And i don’t know why…


please refer to below link. and then please go to Drivers / Protocol Libraries section.