Guys,
I have experiment with ENC28J60...
I put address on AVR as 10.0.0.20....I can ping it, but when I open the browser, it can not load the page, what's missing here ?
Thanks
Guys,
I have experiment with ENC28J60...
I put address on AVR as 10.0.0.20....I can ping it, but when I open the browser, it can not load the page, what's missing here ?
Thanks
I use wireshark and here's the messages :
Frame 15: 82 bytes on wire (656 bits), 82 bytes captured (656 bits) on interface 0
Ethernet II, Src: QuantaCo_71:47:e0 (c8:0a:a9:71:47:e0), Dst: Broadcast (ff:ff:ff:ff:ff:ff)
Internet Protocol Version 4, Src: 10.0.0.20, Dst: 10.255.255.255
User Datagram Protocol, Src Port: 56497 (56497), Dst Port: 1947 (1947)
Data (40 bytes)
What's missing? A whole load of information.
Your wireshark data tells us little - http is tcp not udp.
Why don't you tell us what code you are using?
My guess is the enc is working, so look elsewhere for the problem.
I try from tuxgrapics, it was working before but it's not working now, I don't change the code on the board....but may be the setting on my computer is changing....
Any ideas...?
another message :
Frame 344: 175 bytes on wire (1400 bits), 175 bytes captured (1400 bits) on interface 0
Ethernet II, Src: QuantaCo_71:47:e0 (c8:0a:a9:71:47:e0), Dst: IPv4mcast_7f:ff:fa (01:00:5e:7f:ff:fa)
Internet Protocol Version 4, Src: 10.0.0.20, Dst: 239.255.255.250
User Datagram Protocol, Src Port: 56591 (56591), Dst Port: 1900 (1900)
Hypertext Transfer Protocol
Here's the IP setting :
static uint8_t mymac[6] = {0x54,0x55,0x58,0x10,0x00,0x24};
static uint8_t myip[4] = {10,0,0,20};
What is the ip address of your computer?
Could the problem be in my computer network setting ?
my computer IP address : 10.0.0.3
At this rate, we'll be here all night. You could just cut n paste the output of ipconfig.
Then you could show us wireshark dumps of the http request.
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::9dc1:cc05:77e1:5803%11
IPv4 Address. . . . . . . . . . . : 10.0.0.20
Subnet Mask . . . . . . . . . . . : 255.0.0.0
Default Gateway . . . . . . . . . : 10.0.0.1
Wireless LAN adapter Wireless Network Connection:
Connection-specific DNS Suffix . : BigPond
Link-local IPv6 Address . . . . . : fe80::8cb5:63e1:c0e0:7c69%10
IPv4 Address. . . . . . . . . . . : 10.0.0.3
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.0.138
Interface: 10.0.0.3 --- 0xa
Internet Address Physical Address Type
10.0.0.138 00-26-44-a0-e1-e6 dynamic
10.0.0.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
255.255.255.255 ff-ff-ff-ff-ff-ff static
Interface: 10.0.0.20 --- 0xb
Internet Address Physical Address Type
10.0.0.20 54-55-58-10-00-24 static
10.255.255.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
255.255.255.255 ff-ff-ff-ff-ff-ff static
Why is your lan ip address the same as the enc lan address? I'd suggest that might be a problem. No wonder the ping works.
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::9dc1:cc05:77e1:5803%11
IPv4 Address. . . . . . . . . . . : 10.0.0.20
Subnet Mask . . . . . . . . . . . : 255.0.0.0
Default Gateway . . . . . . . . . : 10.0.0.1
Wireless LAN adapter Wireless Network Connection:
Connection-specific DNS Suffix . : BigPond
Link-local IPv6 Address . . . . . : fe80::8cb5:63e1:c0e0:7c69%10
IPv4 Address. . . . . . . . . . . : 10.0.0.3
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.0.138
Then you could show us wireshark dumps of the http request......................==> how can I do that ?....still wondering..
Sorry, ip support is closed for the night. Suggest you contact Google or read the wireshark manual.
I attached what I had captured
Is that what you mean ?
Useless. See #13. You cant have you pc ip address the same as the enc ip address. Change one of them. Or else give up.
Why is your lan ip address the same as the enc lan address? I'd suggest that might be a problem. No wonder the ping works.....
So I change my LAN to a different IP address, let me try.... thanks
I change my computer to 10.0.0.22.....orange LED on ENC28J60 is blinking all the time....but can not ping....
The packets :
I can see this :
1024 552.599945 10.0.0.22 10.0.0.20 ICMP 74 Echo (ping) request id=0x0001, seq=143/36608, ttl=128 (no response found!)
Frame 1024: 74 bytes on wire (592 bits), 74 bytes captured (592 bits) on interface 0
Ethernet II, Src: QuantaCo_71:47:e0 (c8:0a:a9:71:47:e0), Dst: 54:55:58:10:00:24 (54:55:58:10:00:24)
Internet Protocol Version 4, Src: 10.0.0.22, Dst: 10.0.0.20
Internet Control Message Protocol
I try requesting from Firefox :
The response :
Frame 1042: 70 bytes on wire (560 bits), 70 bytes captured (560 bits) on interface 0
Ethernet II, Src: QuantaCo_71:47:e0 (c8:0a:a9:71:47:e0), Dst: 54:55:58:10:00:24 (54:55:58:10:00:24)
Internet Protocol Version 4, Src: 10.0.0.22, Dst: 10.0.0.20
Transmission Control Protocol, Src Port: 55839 (55839), Dst Port: 80 (80), Seq: 0, Len: 0
Does cross cable matter ?
Does the AVR have any form of debug available (UART, LCD, LEDs, morse code beeps, whatever?). It should be able to tell you if it is "seeing" anything.
Also you say that in the AVR you have set:
static uint8_t mymac[6] = {0x54,0x55,0x58,0x10,0x00,0x24};
so if you see this Mac address in the wireshark traffic such as you mention in #23/#24 doesn't that at least prove something? If the detail of what the Mac address has "got out" of the AVR and on to the wires then in some sense it is communicating.
However when I download your ENC28J60 packets2.txt in post #22 and search for "54:55" I don't see anything in that traffic using that Mac address?
Remember that TCP on IP on Ethernet are layers of the OSI 7 layer networking model. I would explore the communication at every level from the electrical signalling (scope) upwards to see at which layers the connection seems to be made and at which it might be broken. Wireshark will help you with the higher layers but you want to start at the bottom and for example just verify that Ethernet packets are making it from one Mac address to the other. Worry about the IP and TCP and anything else above these later - if the low level comms does not work nothing above it that relies on it will either.
Isn't life a whole lot less complicated with a WIZ812MJ ? ;-) The only real reason for messing about either ENC28J60's and the like is when you are looking at bulk quantities in mass produced devices. If this is just some one-off project experimentation I would stick to the easy to use solutions.
Yes I'm using UART :
The code :
init_ip_arp_udp_tcp(mymac,myip,MYWWWPORT); usart_pstr("BEFORE WHILE"); NEXT_LINE; while(1){
It's working until this level, UART message :
ENC28J60 Test application! ENC28J60 Initialization finished! ENC28J60 init! BEFORE WHILE
I haven't put anything yet inside the loop....
I want to try it later on......
Any other clues guys ?
Thanks
I try with ping, why isn't it ping from 10.0.0.22 ?? 10.0.0.3 is my computer via wifi and 10.0.0.022 is my computer via LAN to ENC28J60...
Pinging 10.0.0.20 with 32 bytes of data:
Reply from 10.0.0.3: Destination host unreachable.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 10.0.0.20:
Packets: Sent = 4, Received = 1, Lost = 3 (75% loss),
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Link-local IPv6 Address . . . . . : fe80::9dc1:cc05:77e1:5803%11
IPv4 Address. . . . . . . . . . . : 10.0.0.22
Subnet Mask . . . . . . . . . . . : 255.0.0.0
Default Gateway . . . . . . . . . : 10.0.0.138
Wireless LAN adapter Wireless Network Connection:
Connection-specific DNS Suffix . : BigPond
Link-local IPv6 Address . . . . . : fe80::8cb5:63e1:c0e0:7c69%10
IPv4 Address. . . . . . . . . . . : 10.0.0.3
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.0.0.138
Isn't life a whole lot less complicated with a WIZ812MJ ? ;-),
Is it the same with W5100 for Arduino ? I have that module somewhere in my shelf.....Is it SPI as well do you have the example ? thanks
This ENC28J60 was working before, with different Atmega board....
Does it need pull up resistor on CS? And is it compatible with 5v Spi? I put 5v with my atmega....
Gyys, any clues starting debugging from ? starting from here ? enc28j60Init(uint8_t* macaddr)
This experiment was working and suddenly not, I really don't understand....
void enc28j60Init(uint8_t* macaddr) { // initialize I/O //DDRB |= 0b00010110; //DDRB = 0x16; // ss as output: ENC28J60_CONTROL_DDR |= 1<<ENC28J60_CONTROL_CS; DDR_B.b4 = 0x01; ENC28J60_CONTROL_CS_H; // ss=0 //ENC28J60_CONTROL_CS_L; // ss=0 DDRB |= 1<<PB1 | 1<<PB2; // mosi, sck output cbi(DDRB,PINB3); // MISO is input // cbi(PORTB,PB1); // MOSI low cbi(PORTB,PB2); // SCK low // // ³õʼ»¯ SPI // Ö÷»úģʽ£¬Fosc ¶þ·ÖƵ //8MHz SPI start SPCR = (1<<SPE)|(1<<MSTR); SPSR |= (1<<SPI2X); //8MHz //8MHz SPI end //SPCR = 0x53; /* Enable SPI function in mode 3 fck/128 */ //SPCR = (1<<SPE)|(1<<MSTR)|(1<<SPR0); //SPSR = 0x00; // perform system reset enc28j60WriteOp(ENC28J60_SOFT_RESET, 0, ENC28J60_SOFT_RESET); _delay_ms(50); // check CLKRDY bit to see if reset is complete // The CLKRDY does not work. See Rev. B4 Silicon Errata point. Just wait. //while(!(enc28j60Read(ESTAT) & ESTAT_CLKRDY)); // do bank 0 stuff // ³õʼ»¯½ÓÊÕ»º³å // 16-bit transfers, must write low byte first // set receive buffer start address NextPacketPtr = RXSTART_INIT; // Rx start enc28j60Write(ERXSTL, RXSTART_INIT&0xFF); enc28j60Write(ERXSTH, RXSTART_INIT>>8); // set receive pointer address enc28j60Write(ERXRDPTL, RXSTART_INIT&0xFF); enc28j60Write(ERXRDPTH, RXSTART_INIT>>8); // RX end enc28j60Write(ERXNDL, RXSTOP_INIT&0xFF); enc28j60Write(ERXNDH, RXSTOP_INIT>>8); // TX start enc28j60Write(ETXSTL, TXSTART_INIT&0xFF); enc28j60Write(ETXSTH, TXSTART_INIT>>8); // TX end enc28j60Write(ETXNDL, TXSTOP_INIT&0xFF); enc28j60Write(ETXNDH, TXSTOP_INIT>>8); // do bank 1 stuff, packet filter: // For broadcast packets we allow only ARP packtets // All other packets should be unicast only for our mac (MAADR) // // The pattern to match on is therefore // Type ETH.DST // ARP BROADCAST // 06 08 -- ff ff ff ff ff ff -> ip checksum for theses bytes=f7f9 // in binary these poitions are:11 0000 0011 1111 // This is hex 303F->EPMM0=0x3f,EPMM1=0x30 enc28j60Write(ERXFCON, ERXFCON_UCEN|ERXFCON_CRCEN|ERXFCON_PMEN); enc28j60Write(EPMM0, 0x3f); enc28j60Write(EPMM1, 0x30); enc28j60Write(EPMCSL, 0xf9); enc28j60Write(EPMCSH, 0xf7); // // // do bank 2 stuff // enable MAC receive enc28j60Write(MACON1, MACON1_MARXEN|MACON1_TXPAUS|MACON1_RXPAUS); // bring MAC out of reset enc28j60Write(MACON2, 0x00); // enable automatic padding to 60bytes and CRC operations enc28j60WriteOp(ENC28J60_BIT_FIELD_SET, MACON3, MACON3_PADCFG0|MACON3_TXCRCEN|MACON3_FRMLNEN); // set inter-frame gap (non-back-to-back) enc28j60Write(MAIPGL, 0x12); enc28j60Write(MAIPGH, 0x0C); // set inter-frame gap (back-to-back) enc28j60Write(MABBIPG, 0x12); // Set the maximum packet size which the controller will accept // Do not send packets longer than MAX_FRAMELEN: enc28j60Write(MAMXFLL, MAX_FRAMELEN&0xFF); enc28j60Write(MAMXFLH, MAX_FRAMELEN>>8); // do bank 3 stuff // write MAC address // NOTE: MAC address in ENC28J60 is byte-backward enc28j60Write(MAADR5, macaddr[0]); enc28j60Write(MAADR4, macaddr[1]); enc28j60Write(MAADR3, macaddr[2]); enc28j60Write(MAADR2, macaddr[3]); enc28j60Write(MAADR1, macaddr[4]); enc28j60Write(MAADR0, macaddr[5]); // no loopback of transmitted frames enc28j60PhyWrite(PHCON2, PHCON2_HDLDIS); // switch to bank 0 enc28j60SetBank(ECON1); // enable interrutps enc28j60WriteOp(ENC28J60_BIT_FIELD_SET, EIE, EIE_INTIE|EIE_PKTIE); // enable packet reception enc28j60WriteOp(ENC28J60_BIT_FIELD_SET, ECON1, ECON1_RXEN); usart_pstr("ENC28J60 Initialization finished!"); }
The enc28j60 is rather sensitive to spi speed. This is all documented, but you do have to make an effort to find it. Start debugging!
What speed do u reckon fclk÷8?
How should I know? You haven't told me what your fclk is. I think you need to spend some time with yourself and work through the problem rather than ask questions we can't answer because you can't be bothered.
I think you need to spend some time with yourself...
Hmmm...
But it was working with this setting with different board??
with this setting I will get 16Mhz SPI speed, correct me if I'm wrong :
SPCR = (1<<SPE)|(1<<MSTR)|(0<<SPR1)|(0<<SPR1); //fck/2 SPSR |= (1<<SPI2X); // fck/2 * 2 = 8Mhz x2 = sck = 16Mhz
I can see the board on different interface, the IP is 10.0.0.30....
but I need it to be connected on 10.0.0.20, which is LAN, how can I move it ?
Interface: 10.0.0.3 --- 0xa
Internet Address Physical Address Type
10.0.0.30 54-55-58-10-00-24 static
10.0.0.138 00-26-44-a0-e1-e6 dynamic
10.0.0.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
255.255.255.255 ff-ff-ff-ff-ff-ff static
Interface: 10.0.0.20 --- 0xb
Internet Address Physical Address Type
10.255.255.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
255.255.255.255 ff-ff-ff-ff-ff-ff static
Interface: 192.168.89.1 --- 0x14
Internet Address Physical Address Type
192.168.89.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
255.255.255.255 ff-ff-ff-ff-ff-ff static
Interface: 192.168.145.1 --- 0x15
Internet Address Physical Address Type
192.168.145.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
Thanks
But it was working with this setting with different board??
Doesn't that make the question obvious?
"What was the difference between that board and this?"
bianchi77 wrote:
But it was working with this setting with different board??
Doesn't that make the question obvious?
"What was the difference between that board and this?"
the previous board ENC28J60 is on the module, now it's mounted on the board...
Yes but clearly there are some other electrical difference otherwise the same code with the same chip would work identically. If you haven't changed the code it must be something in the electronics that is different. Find out what that is and change it back and the thing WILL work.
How many beards do you have?
I have some boards, unsoldered....
Is it possible that my network setting isn't right, because I can see "Unidentified network" on my computer....??
How can I set my gateway ? I connect the board via a switch...
Just for once in your life try to approach this like an engineer and apply an engineering technique to it.
As I say you have two circuits. With the same code one works. the other doesn't. That says that there's some electrical difference so you get out you electrical difference investigation tools (multimeter, logic probe, oscilloscope, logic analyser, LED+resistor, etc) and you probe each circuit while they attempt to do the same thing and analyse what is different between one and the other. When you find that difference you should be very close to finding the reason why one of them is not working. Presumably there's a wire loose/misplaced or a solder bridge missing or a dry joint or a track broken or something?
Ok, I will, how about "no network access" on windows 7 property, does it matter ? thanks
Here's the windows shot
But the enc28j60 only does 10mbit.
I'm thinking my network setting on my computer is not right, because the other board was working ok, and I forgot already with my network setting...
I'm thinking my network setting on my computer is not right, because the other board was working ok, and I forgot already with my network setting...
So you are traying to connect from your Windows PC to two different boards both using an ENC28j60. Now, from your own investigation (this in itself may be the wrong wording for your way of troubleshooting) one board is working while the other does not. Why in heaven are you then concluding that the error resides within your Windows PC?
Because I changed my ip setting for something else and I have reset it..