lios
June 20, 2014, 10:33pm
1
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)
???
Hi,
For using theh client mode of a socket,
Set a socket mode : Set Sn_MR_TCP bits in Sn_MR with socket number 0
Set a souce port num of the socket: Set a random number to S0_PORTR
Open the socket : Set OPEN bit in S0_CR
Set the server port number : Set the listen port number as 80 to S0_DPORTR
Connect to the server : Set CONNECT bit of S0_CR
Wait to be connected : Check S0_IR’s CONNECT bit or S0_SR becomes SOCK_ESTABLISHED
When connected : Sending request & Parsing the reply from the server
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
Edward
October 4, 2018, 12:39am
4
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.
Thanks
Edward
kko
February 13, 2019, 5:22am
5
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…
Edward
February 13, 2019, 7:05am
6
Hi.
please refer to below link. and then please go to Drivers / Protocol Libraries section.
Thanks