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 CCS Technical Support

Ethernet(ENC28J60) Interfacing With PIC

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



Joined: 09 May 2012
Posts: 46
Location: KSA

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

Ethernet(ENC28J60) Interfacing With PIC
PostPosted: Mon Jul 07, 2014 3:48 am     Reply with quote

I'm planning to interface Ethernet with a PIC MCU to control devices using the internet.

For example turning on a led connected to an MCU using the website.

but since this is my first time I have a question regarding this:

1_How can i make the website? should i learn a programming language for example HTML to be able to design the web page????

or this it's not necessary??

2_How to connect the MCU with the page??

3_ What IP ADDRESS should i write in the code and MAC ADDRESS?

for example this configurations are written by a user :

Code:



// network parameters
char myMacAddr[6]={0x00, 0x14, 0xA5, 0x76, 0x19, 0x3f}; // my MAC address
char myIpAddr[4] = {192, 168, 20, 60}; // my IP address
char gwIpAddr[4] = {192, 168, 20, 6}; // gateway IP address
char dnsIpAddr[4] = {192, 168, 20, 1}; // dns IP address
char ipMask[4] = {255, 255, 255, 0}; // subnet mask





where i do get all these values from if i want to configure my own Ethernet with the PIC18F4520??

sorry guys but i have never done an Ethernet interfacing before!!!!
ezflyr



Joined: 25 Oct 2010
Posts: 1019
Location: Tewksbury, MA

View user's profile Send private message

PostPosted: Mon Jul 07, 2014 5:20 am     Reply with quote

Hi,

Purchase one if the CCS Embedded Ethernet Development kits, and learn about embedded Ethernet in a step-by-step process. Trying to learn what you really need here on the forum will be an exercise in frustration for all involved.....

Good luck,

John
semmoor



Joined: 09 May 2012
Posts: 46
Location: KSA

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

PostPosted: Mon Jul 07, 2014 5:30 am     Reply with quote

thank you:

I only need to know where can i get these parameters are they available in my router configurations??

or PC just don't know??
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jul 07, 2014 2:21 pm     Reply with quote

CCS has several embedded ethernet kits:
http://www.ccsinfo.com/content.php?page=development-kits#tabs-2

Search for the following search string with Google. You will find the CCS
Exercise book for their 3.3V Embedded Ethernet Kit:
Quote:
"3.3v ethernet controller" "exercise book" type:pdf

X-out the advertisements, then you can see the document.

Browse through, see if it answers your questions, see if it's something
that want to buy. Your IP address questions are answered in Section 8.
Ttelmah



Joined: 11 Mar 2010
Posts: 19553

View user's profile Send private message

PostPosted: Tue Jul 08, 2014 2:27 am     Reply with quote

and the Mac address comes from the hardware.

Basically every ethernet chipset somewhere has the ability to store the Mac address, and this is programmed at the factory to a unique number.

Systems often allow you to change this (though you have to be very careful), so that (for instance) you can replace a modem unit, and have it present the same Mac address to the network. This is done because some ISP's bind their connection to the Mac address of the modem, and some network servers act in a similar way. Some cards 'spoof' the address, just changing what is presented, while others change the physically stored address (depends on what the hardware supports). Danger is that if the old modem/card is repaired, and then used as well, you run into the problem of duplicate Mac addresses. Rare to give problems if they are on separate networks, but many servers will give errors if duplicates exist on one network. Generally it is safer to stick with using the pre-programmed address, unless you need to change it.
bkamen



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

View user's profile Send private message

PostPosted: Fri Jul 11, 2014 10:47 am     Reply with quote

Ttelmah wrote:


Basically every ethernet chipset somewhere has the ability to store the Mac address, and this is programmed at the factory to a unique number.



That's USUALLY correct except in the cases of PIC's which are at a more generic level.

PIC MPU's with Ethernet (like the J60's) or the ENC28J60's do not come with MAC's pre-assigned.

So, you can either (for your home) make one up as long as it doesn't conflict with another one on your network.

IF YOU PLAN ON SELLING your design, you can cover yourself easily by buying Microchip's EEPROM's with built-in 48bit MAC addresses or if the design is big enough, getting your own official allocation.

You should read up on MAC's and how they're allocated and assigned, then it will all make sense to you. (Google it)

If I send a design into the wild (and it's a single unit) I use a MAC from a list I've created of dead ethernet cards that got recycled.

Cheers,

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
semmoor



Joined: 09 May 2012
Posts: 46
Location: KSA

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

PostPosted: Sat Jul 12, 2014 9:20 am     Reply with quote

thanks to all, it was really useful, i appreciate that.
arulchozhan



Joined: 14 Aug 2015
Posts: 12

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

PostPosted: Thu Aug 27, 2015 12:49 am     Reply with quote

hi any one have sample code for interfaceing enc28j60 to pic controller. am new to eathernet interface please any one help me. i have no idea about eathernet please any one help me
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