Go Down

Topic: Standalone arduino ethernet problem (Read 132 times) previous topic - next topic

blekeys

Hi, I'm new in forum and I'm not sure if it's the right topic but I have some questions about standalone arduino and ethernet connection.

I'm using AtMega328P-PU chip and when ı connect HanRun HR911105A ethernet module that uses enc28j60 microcontroller. Connections between standalone arduino and ethernet connection is right, ı double checked it.
For power the circuit, I use one of my arduino unos without processor on it. When I correctly update my code to atmega, I can't ping it. I'm really sorry about my english. If you want to help but you dont understand, please let me know ı really dont know what to do. Thanks

spycatcher2k

So you give neither a wiring diagram or code & expect an answer!

With the information you have supplied so far, I expect the answer to be : Green Smurf
-=-
http://www.uk-pcb.co.uk - UK Based PCB Fab & Assembly Company
Design & Assembly work undertaken - Arduino repairs & testing - PM for details. Arduino & C# PC programming.

DrAzzy

There are a lot of ways that something in the wiring could be wrong - in addition to the code.

Have you tested the code with a normal Arduino board and the same ethernet module? You should try this to rule out some weird problem with your standalone arduino setup.
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

blekeys

So you give neither a wiring diagram or code & expect an answer!

With the information you have supplied so far, I expect the answer to be : Green Smurf
I'm sorry I'm uploading the schematic but it's just an ethernet module and basic arduino circuit. Atmega328p, 16 Mhz crystal, 2 22pF capacitor. First, I tried powering the circuit from 5v Dc adaptor. I used LM1117 3.3v transistor for ethernet. Then I tried to eliminate the current and voltage problem using an arduino. Powered the circuit from arduino's 5v output and ı supplied ethernet module from arduino's 3.3v output.

I'm uploading the code as well. I can ping when ı connect arduino and ethernet module, so ethernet module works but on standalone arduino, I can't ping it.
Code: [Select]

#include <UIPEthernet.h>
#include <UIPServer.h>
#include <UIPClient.h>
#include <EEPROM.h>
EthernetServer server = EthernetServer(1010);
EthernetServer serverokunan=EthernetServer(2020);
EthernetServer serverokunan2=EthernetServer(2030);
EthernetServer clientipconfiguration=EthernetServer(3030);

EthernetClient client;
EthernetClient okunanclient;
EthernetClient okunanclient2;
EthernetClient clientconfiguration;

//IPAddress dnsServer(192,168,2,1);
//IPAddress gateway(192,168,1,1);
//IPAddress dns(192,168,001,001);
//IPAddress subnet(255,255,255,0);
  //   Ethernet.begin(mac,myIP,gateway,subnet);
 

 
void setup()
{
    uint8_t mac[6] = {0x00,0x01,0x02,0x03,0x04,0x05};
  IPAddress myIP(192,168,1,188);
   Ethernet.begin(mac,myIP);
  server.begin();

}


void loop()
{
 size_t size;
   if ( client = server.available())
    {
      if (client)
        {
         
            while((size = client.available()) > 0)
           {
                 uint8_t* msg = (uint8_t*)malloc(size);
                 size = client.read(msg,size);

                   
             
                        }
                      }
                  }
}
                 

DrAzzy

You need a 0.1uf capacitor between Vcc and Gnd, and between AVcc and Gnd - these need to be *right next to the atmega328p*. Without them, the chip may reset itself or hang unexpectedly (or may appear to function).
ATtiny core for 841+1634+828 and x313/x4/x5/x61/x7/x8 series Board Manager:
http://drazzy.com/package_drazzy.com_index.json
ATtiny breakouts (some assembled), mosfets and awesome prototyping board in my store http://tindie.com/stores/DrAzzy

blekeys

You need a 0.1uf capacitor between Vcc and Gnd, and between AVcc and Gnd - these need to be *right next to the atmega328p*. Without them, the chip may reset itself or hang unexpectedly (or may appear to function).
I really appriciate your help, I'll try it immidiately and let you guys know :)

Go Up