View previous topic :: View next topic |
Author |
Message |
semmoor
Joined: 09 May 2012 Posts: 46 Location: KSA
|
Ethernet(ENC28J60) Interfacing With PIC |
Posted: Mon Jul 07, 2014 3:48 am |
|
|
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
|
|
Posted: Mon Jul 07, 2014 5:20 am |
|
|
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
|
|
Posted: Mon Jul 07, 2014 5:30 am |
|
|
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
|
|
Posted: Mon Jul 07, 2014 2:21 pm |
|
|
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: 19520
|
|
Posted: Tue Jul 08, 2014 2:27 am |
|
|
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
|
|
Posted: Fri Jul 11, 2014 10:47 am |
|
|
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
|
|
Posted: Sat Jul 12, 2014 9:20 am |
|
|
thanks to all, it was really useful, i appreciate that. |
|
|
arulchozhan
Joined: 14 Aug 2015 Posts: 12
|
|
Posted: Thu Aug 27, 2015 12:49 am |
|
|
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 |
|
|
|