Go Down

Topic: Standalone arduino ethernet problem (Read 286 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 :)

steve_mcdonald

I've used several of these setups in production - ENC28j60 with standalone ATMEGA - all working fine.  Looking at your schematic,
1. I notice you have an LED across the output of your 3v3 VREG which will drop the output to the forward voltage drop on the LED (somewhere around 1v8 - 2v2). 
2. Your reset button is not wired correctly.  The reset on the ATMEGA needs to be wired to ground Pin 1 when it is pushed.  You don't need a reset connection to the ENC28j60 device, but if you want one I suggest you put it under code control from the ATMEGA.
3. C5 is redundant and can be removed, but won't do any harm.  Note when you place two capacitors in parallel, the capacitance adds so you have 20uF across the output.  You don't need that much with the 1117 device.
4. The diode on the input to the 1117 is dropping 1v2 or more.  If the 5v supply is actually 4v98 or so, then you're driving the 1117 with 3v78 or thereabouts and there is insufficient overhead for the 1117 to maintain it's output voltage with. 

Other posters have suggested filter caps at the ATMEGA power pins - that's is a good idea in general, and I support that suggestion at both supply pins as mentioned. 

I hope this helps.  As I have done several of these I am happy to assist further.

Go Up