CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

The ARP problem in which sending or receiving data using UDP

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
kahjoo



Joined: 28 Apr 2006
Posts: 2
Location: Malaysia

View user's profile Send private message Send e-mail

The ARP problem in which sending or receiving data using UDP
PostPosted: Tue Jul 04, 2006 3:09 am     Reply with quote

Hi,

I've using the ENC28J60 and CCS compiler to compile the example file with the TCP/IP source code given by the CCS. We are planed to build a two devices that can be talk to each other either by using TCP or UDP. The two devices can be said are point to point and not going through any server, meant we want it to be when the two devices are connected to the LAN and they can talk to each other. However, the two devices can be only talk to the assigned remote IP and PORT number and will not be changes.

For currently, I'm testing the code using the UDP. I taking the code from the Example 12, and I found that the program need to received packet from server and then can send the data out. However, due to our application, I need the MCU can sending or receiving data anytime. So I found out example from the forum and test it out through my PC, and it works, but the problem was sometime the MCU are not sending out the ARP to request the MAC address, and cause the MCU cannot get the MAC address and sending out the data or receiving the data. Is there better way to solve this problem?

Another question is when I make this program and program it into two different devices, with different IP and MAC address, but assigned the each other remote IP, can it be work by using the attached program? Or any good idea of doing it? Thanks.
Quote:

c:\program files\picc\tcp-ip\pic examples source\ex12.c

Regards

Kah Joo

+++++++++++++++++
Posted code changed to file directory.
Reason: Forum Rule #10
10. Don't post the CCS example code or drivers

-- Forum Moderator
+++++++++++++++++

_________________
Everything can be done, do you willing to do it!!!
artur_saraiva



Joined: 10 Aug 2009
Posts: 2

View user's profile Send private message

PostPosted: Tue Sep 22, 2009 9:03 am     Reply with quote

Example 12 work fine? I'm testing the file but isn't working. I don't understand what the problem is.
Does it need to define a function MACInit ? ENCSPIInit ? More defines ? I'm testing send UDP packets using udp.exe from microchip to pic18F + enc28j60 ethernet controller. I get listening the port, but I don't receive anything. Can you help me?

Edit..

The function StackInit() makes the program don't run in next line of program text...im testing line to line sending msg rs232 from pc.

How ARP works in code "text"? I don't understand.
ARP is for know the ip and mac address from pc ?

In opensokect(), the atribute null from variable type remoteNode
is right ?


Last edited by artur_saraiva on Tue Sep 22, 2009 10:26 am; edited 1 time in total
bkamen



Joined: 07 Jan 2004
Posts: 1611
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Tue Sep 22, 2009 12:21 pm     Reply with quote

Kahjoo:Don't bother with TCP/IP then. It's just more overhead. Just use the ethernet addresses and be done with it. Look at MAC.c for a start.


Artur: Your email didn't really come across too clear. Can you explain a little more carefully?
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
artur_saraiva



Joined: 10 Aug 2009
Posts: 2

View user's profile Send private message

PostPosted: Wed Sep 23, 2009 4:21 am     Reply with quote

Hi bkamen,

I'm using the ex12.c (comunication via UDP) from the tcp/ip stack and I want to know if this example works fine? I'm using pic 18f4520 + enc28j60 (ethernet controller) but i don't receive anything.

I'm doing some prinft's via rs232 to see where the program stops running and i've notice that it stops in StackInit() function.

I don't understand how ARP works in the code, is it to get the IP and the MAC address from the pc?

In UDPRxTask() it uses de UDPOpen function but it has NULL in the atributes, should it be remotenode (IP address and MAC address) or am I wrong?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group