Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

control i/o ports of AVR using TCP/IP

Status
Not open for further replies.

yashmodi

Newbie level 6
Joined
Jul 28, 2005
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,400
networking avr with tcp/ip

i have ported UIP0.9 on an ATmega32 interfaced to RTL8019AS and implemented a simple web server that return a webpage with updated temperature readings...

......how can i control the I/O ports of the microcontroller using the same interface...??

read about cgi programming and tried to understand the included http port of uip using CGI but could not understand it much.....it would be gr8 if someone could help me out..
thnx...
yash
 

techie

Advanced Member level 3
Joined
Feb 5, 2002
Messages
839
Helped
58
Reputation
116
Reaction score
9
Trophy points
1,298
Location
Pakistan
Activity points
7,800
uip-avr schematic

You have to understand that UIP provides a simple TCP/IP connection just like any other TCP/IP stack. When a client opens a socket on the server, it can send any data it likes. The server can be programmed to respond to commands in packets from client and in turn switch any I/O ports.
 

artem

Advanced Member level 4
Joined
May 22, 2003
Messages
1,350
Helped
126
Reputation
252
Reaction score
32
Trophy points
1,328
Location
Turkey
Activity points
13,450
avr tcp

yashmodi, i was trying to answer that in details but subject requires more than 6 hours to give a detailed conclusion. In brief you should:
a. write function to set and read port outputs . Better to put it into cgi.c. You should add it to cgi function pointer table so it will be called from cgi script under name 'd'

b. write html containing html form and put it into fsdata.c source code .

c. update , let say index.html with link to this newly created form page (step b)

d. write script page to handle browser request , when invoked from form page (created in step b). It should also be put into fsdata.c soruce file
that script should contain reference to newly created cgi.c functions.

e. cgi.c function created in step 'a' will be invoked while running script created on step d. It should parse uip_appdata[] buffer to extract post GET request parameters and replay back with result (part of html page as a result)
Set the action option for form tag in html to cgi script filie name (for file created in step b)
<form name=xxx method=GET action=/cgi/your script name >


That is very brief and is not complete

Yet , remeber that file data in fsdata contains file name starting from first character in file data buffer till first null value character (serving as terminator), then rest is the file content .


Or , you can intercept the GET in httpd.c file and ignore script handling at all .
 

yashmodi

Newbie level 6
Joined
Jul 28, 2005
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,400
avr tcp/ip implementation

thnx a lot dude...will work on that and post a reply...kinda got a good idea...
 

Truclam

Junior Member level 1
Joined
Nov 11, 2005
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,489
how to tcp/ip programming with avr

Hi all,
I have a circuit about tcp/ip system.But I don't know how to transfer data from AVR microcontroller to other device on network.
Does anyone help me?Please give me a sample
if I want to transfer "12345" string from AVR to other device on network.
My email is : luongvinhphu1003@yahoo.com
Best regards.
 

LBdgWgt

Member level 5
Joined
Mar 6, 2006
Messages
83
Helped
5
Reputation
10
Reaction score
0
Trophy points
1,286
Activity points
2,066
avr send ping

Truclam said:
Hi all,
I have a circuit about tcp/ip system.But I don't know how to transfer data from AVR microcontroller to other device on network.
Does anyone help me?Please give me a sample
if I want to transfer "12345" string from AVR to other device on network.
My email is : luongvinhphu1003(at)yahoo.com
Best regards.

You need a TCP/IP stack program/codes to be placed inside the uC, and for testing you can try to send "ping" to check whether the uC responding or not.
uIP from Adam Dunkels support protocol such as ICMP (for replying "ping") and last time i tried to compile it, with also NIC RTL8019AS driver (integrated in uIP AVR by Louis Beaudoin), it needed around 8KB for the latest version (uIP 0.9) and for the previous persion (uIP 0.6) it was around 6 KB.

And then you can try to make your own application by making a program in PC using socket programming and your own uC.

Read the uIP manual, it was quite helpfull
Another helpfull tool is ethereal, it is a tool for capturing the TCP/IP packet in the network,and it is free.

hope this helps,
regards,
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top