Fix for ratty behaviour of Wiznet 5200 with the OpenKontrol Gateway

Ciseco’s OpenKontrol Gateway has a Wiznet 5200 Ethernet card.On power-up the Wiznet module failed to initialise properly and resulted in the Wiznet module hanging.In this project we see how to fix it .
ORIGINAL POST
By Richard Mudhar
components
Hardware Components
OpenKontrol Gateway
X 1
Open Kontrol Gateway (OKG)
X 1
Wiznet W5200
X 1
details

DSCN2116.jpg

Using OKG with Wiznet W5200

The Wiznet W5200 is an advanced Ethernet chip which has an integrated TCP/IP stack. It’s almost identical to the Wiznet W5100 which is used in official Arduino Ethernet boards. The Wiznet W5200 works with the standard Arduino Ethernet library with a small change. To use the OKG with the Wiznet W5200 as an emonBase to receive data from an emonTx via RFM12B and post to emoncms follow these steps:

  1. Assemble the OKG baseboard following the Ciseco instructions on the OpenMicros – assembling the OKG. For emonBase operation, the position of the jumpers doesn’t matter. When you’re done, the board should look like this:
  2. Assemble the Wiznet Ethernet board following the Ciseco instructions on the OpenMicro website OpenMicros – assembling the OKG Wiznet board
  3. Implement the Wiznet reset line fix
  4. Replace the Arduino Ethernet library (in the Arduino IDE libraries folder) with an updated library that supports the Wiznet W5200 and has modifications to enable RFM12B compatibility download from OpenEnergyMonitor GitHub
  5. Download the JeeLabs JeeLib library and install it in your Arduino folder. Make sure you delete or move any other JeeLib / Ethernet library folders currently in your Arduino library folder (renaming is not sufficient).
  6. Download the OKG Wiznet to emoncms examples. Be sure you set the RFM12B network and frequency, emoncms server and emoncms read-only API key. There are currently two examples:
    1. OKG_Wiz5200_RFM12B_emoncms: A fixed data structure example for use with one emonTx and one emonGLCD.
    2. OKG_Wiz5200_RFM12B_emoncms_multinode: flexible example for posting data to emoncms, it relays data to emoncms from as many as 30 nodes. (rfm12 library maximum).

Wiznet Reset Fix

On the OKG with Wiznet, The reset line is connected to the Atmega328 reset line. On power-up the Wiznet module failed to initialise properly, probably due to a race condition between the Atmega328 and the Wiznet chip. This resulted in the Wiznet module hanging.

The fix is to reset the Wiznet after the Atmega is booted and stable. To do this, we have to separate the Wiznet reset from the Atmega reset. To do this cut off the Wiznet reset header pin as shown:

 

Solder a wire from the reset pad on the OKG Wiznet adapter PCB, to the fourth connection down on the left side of the left Xbee header. This connects the Wiznet reset to Digital 7:

The latest OKG code examples include a routine to reset the Wiznet via software.

 

 

 

DSCN2116.jpg

Using OKG with Wiznet W5200

The Wiznet W5200 is an advanced Ethernet chip which has an integrated TCP/IP stack. It’s almost identical to the Wiznet W5100 which is used in official Arduino Ethernet boards. The Wiznet W5200 works with the standard Arduino Ethernet library with a small change. To use the OKG with the Wiznet W5200 as an emonBase to receive data from an emonTx via RFM12B and post to emoncms follow these steps:

  1. Assemble the OKG baseboard following the Ciseco instructions on the OpenMicros – assembling the OKG. For emonBase operation, the position of the jumpers doesn’t matter. When you’re done, the board should look like this:
  2. Assemble the Wiznet Ethernet board following the Ciseco instructions on the OpenMicro website OpenMicros – assembling the OKG Wiznet board
  3. Implement the Wiznet reset line fix
  4. Replace the Arduino Ethernet library (in the Arduino IDE libraries folder) with an updated library that supports the Wiznet W5200 and has modifications to enable RFM12B compatibility download from OpenEnergyMonitor GitHub
  5. Download the JeeLabs JeeLib library and install it in your Arduino folder. Make sure you delete or move any other JeeLib / Ethernet library folders currently in your Arduino library folder (renaming is not sufficient).
  6. Download the OKG Wiznet to emoncms examples. Be sure you set the RFM12B network and frequency, emoncms server and emoncms read-only API key. There are currently two examples:
    1. OKG_Wiz5200_RFM12B_emoncms: A fixed data structure example for use with one emonTx and one emonGLCD.
    2. OKG_Wiz5200_RFM12B_emoncms_multinode: flexible example for posting data to emoncms, it relays data to emoncms from as many as 30 nodes. (rfm12 library maximum).

Wiznet Reset Fix

On the OKG with Wiznet, The reset line is connected to the Atmega328 reset line. On power-up the Wiznet module failed to initialise properly, probably due to a race condition between the Atmega328 and the Wiznet chip. This resulted in the Wiznet module hanging.

The fix is to reset the Wiznet after the Atmega is booted and stable. To do this, we have to separate the Wiznet reset from the Atmega reset. To do this cut off the Wiznet reset header pin as shown:

 

Solder a wire from the reset pad on the OKG Wiznet adapter PCB, to the fourth connection down on the left side of the left Xbee header. This connects the Wiznet reset to Digital 7:

The latest OKG code examples include a routine to reset the Wiznet via software.

 

 

 

COMMENTS

Please Login to comment
  Subscribe  
Notify of