WIZ820io Ethernet and 2nd power supply with teensy 3.0

Status
Not open for further replies.

manitou

Senior Member+
Hardware isn't my speciality. I'm trying to get wiznet WIZ820io to work with teensy 3.0. I've run it on UNO, maple, and DUE without problems, but they have enough power to drive it (150ma+). For the teensy hooked to USB, i provided a breadboard power adaptor to provide power to the wiznet.
https://www.sparkfun.com/products/114
I measured output voltage (3.3v) and even checked current flow (150ma), and I have a commn ground. LEDs are working on the wiznet module, but the SPI logic isn't working??? I have a simple test to just read some of the ROM on the wiznet and it just returns 0's. As noted, same code/module works on UNO/maple/DUE.

what hardware magic am i missing??
 
I have made some progress with the teensy 3.0 and the WIZ820io (W5200) ethernet module. I am using a 3.3v breadboard power supply for the wiznet chip (it can draw up to 175ma). I share ground with the teensy GND pin. I use only one of the wiznet Grnd and 3.3v pins. Teensy pins 10-13 are connected to CS,MOSI,MISO, and SCK of the wiznet module. Since I don't have a header on the teensy Reset, I hook teensy pin 7 to the wiz reset pin and use the sketch to control RESET on the wiznet. By changing the duration of HIGH to 100us on pin 7 and using a delay of 500ms before starting the wiznet initialization, I managed to get good values via SPI from the wiznet module. I added the W5200 mods to the 1.12 IDE Ethernet library.

The W5200 can run up to 33mbs (megabits/sec) as compared to 0.33 mbs for the W5100. The W5200 supports auto-increment on SPI read/writes. I used a simple SPI read/write test to the wiznet buffer area to test SPI speed using Paul's SPI library (AVR emulation). I was able to get 6mbs when clocking the SPI at 24MHz. I got errors for SPI speeds of 4MHz and less -- it appears the data is shifted by 4 bits??

I ran some simple UDP tests (8-byte echo latency, 10 1000-byte packe writes, and 20 1000-byte packet lossless reads) at various SPI speeds. The results of these Ethernet tests along with similar tests on the maple, UNO, and DUE are in the file wizperf.txt at the following github site

https://github.com/manitou48/DUEZoo

The maple and DUE results include SPI+DMA results. I hope to test a teensy version using the SdFat SPI library (FIFO and 16-bit frames) with the wiznet library.

I plan on using a logic analyzer to investigate the problems at 4Mhz and slower ...
 
Interesting observations. I've had my own problems with the WIZ820. I have also updated my Ethernet library to work with the W5200 based WIZ820io and got it to be recognized on the network via Bonjour and send and receive OSC messages. Somehow, however, it was very slow compared to the same setup using the WIZ812. Power supply problems did cross my mind but I dismissed them. I guess I may have to give that a closer look!
I did not use a Teensy 3 but a Teensy++2.
 
I hacked a version of w5100.cpp to include the SdFat SPI routines which utilize 16-bit frames and the SPI FIFO. With the SPI clocked at 24MHz, the w5200 buffer read/write test achieved 21.6 mbs (megabits/sec) and UDP write's ran at 14.2 mbs. More results including UDP tests in file wizperf.txt at

https://github.com/manitou48/DUEZoo
 
Hi!
I'm trying to use the WIZ820io module with the Teensy 3.0 just as you did! (@manitou)

I already sorted out the connections and the power supply, but now I'm missing the tweaked library. I took a quik look at https://github.com/manitou48/DUEZoo but couldn't figure out how to do it.

Can you help me?

Thanks!
 
Ok! I get what I have to do, but I cannot find a folder hardware/arduino/sam in arduino 1.0.3. I'm using windows 7. Anybody could help me?

Anyway, I'll give a try to arduino 1.5 beta and see if teensyduino installs.

Hi!
I'm trying to use the WIZ820io module with the Teensy 3.0 just as you did! (@manitou)

I already sorted out the connections and the power supply, but now I'm missing the tweaked library. I took a quik look at https://github.com/manitou48/DUEZoo but couldn't figure out how to do it.

Can you help me?

Thanks!
 
That folder is part of Arduino 1.5.2. You won't find it in 1.0.3.

Thanks!

I installed arduino 1.5.2 and found it.

Now my problem is divided in two:

1. I didn't find yet how to install teensyduino on the 1.5.2, so I can't use the ethernet.h an .cpp files with teensy 3.0

or

2. I don't know how to install those files on arduino 1.0.3 patched with teensyduino. When I put them on the ethernet folder, the first problem when compiling on the function read_data.

Are you able to use the wiz820io with teensy 3.0? how?

Thanks again
 
teensyduino is not compatible with 1.5.2 :p

No I have not worked wit the Teensy 3 yet. However, I don't understand why you would need to go into the hardware folder anyway. The Ethernet Library is a "standard" library. There should be no need to copy anything to the "hardware" folder.
Perhaps you can post a more detailed error report from your compilation attempt.
 
teensyduino is not compatible with 1.5.2 :p

No I have not worked wit the Teensy 3 yet. However, I don't understand why you would need to go into the hardware folder anyway. The Ethernet Library is a "standard" library. There should be no need to copy anything to the "hardware" folder.
Perhaps you can post a more detailed error report from your compilation attempt.


I tried to find the hardware folder because it said on the readme.txt at duezoo...

When I switched the files at the Ethernet on the libraries folder I got the following error:

D:\work\arduino-1.0.3\libraries\Ethernet\utility\socket.cpp: In function 'uint16_t recvfrom(SOCKET, uint8_t*, uint16_t, uint8_t*, uint16_t*)':
D:\work\arduino-1.0.3\libraries\Ethernet\utility\socket.cpp:259:52: error: invalid conversion from 'uint8_t* {aka unsigned char*}' to 'uint16_t {aka short unsigned int}' [-fpermissive]
In file included from...

But now I will make a test, later I'll let you know if it worked. Thanks!
 
No, it didn't. I tried using the Ethernet and SPI libraries from 1.5.2 on 1.0.3, but it tried to import variants.h. Later I'll read the code for the ethernet library and try to solve it.

I didn't find yet somebody that was able to run the wiz820io with the teensy 3.0, but I'm still looking. Maybe I have to take a look at the SPI as well.
 
Has anyone got the WIZ820io to work with the Teensy3 ?
With "to work" I mean established a network connection. I've gotten the WIZ820io to work with a basic sketch establishing a DHCP connection using the the library files manitou provided on an Arduino UNO out of the box and over the X-Mas timeframe remember I had it also working on a Teensy++2.

However, on a Teesny3 it appears not to be working. I am not at my home machine so can't post the sketch right now, but will do so if needed.
I follwed manitou's description using pin 7 and the sketch to reset the WIZ820io. After compiling/uploading I can see it restarting and the led on the Teensy3 flickering indicating some communication (I assume) but then that stops and no Ethernet connection is made.
 
Last edited:
Are you powering WIZ with separate power (plus common ground)? I think it consumes more than teensy 3.0 can supply. You might also try using static IP instead of DHCP. I think I got more consistent results with static IP. On Maple and teensy I often had stalls and such -- I don't know if it was my breadboard wiring, or if my WIZ unit was capricious. I did get both UDP and TCP to work, at least for simple performance tests .... I often just did simple SPI read/write's to the WIZ's RAM, but even those tests would sometimes fail.
good luck
 
Manitou,

Thanks for the feedback. Yes I am powering the WIZ820io from a different 3.3V power supply connected to the Teesny3 with a common ground. I've seen your posts on the maple forum and have not yet tried connect the PDWN pin to GND.

I can try it with a static IP but doubt this will make much of a difference. I am more suspecting a SPI peculiarity on the Teensy3 side, because with a regular Arduino UNO it woked in the first attempt and I bet if I try it with my Teensy++2 it'll work as well. I had a prototype Adapter PCB made at OSH Park to connect the Teesny++2 to the WIZ820io a little time before X-Mas 2012 and before you posted your library mods I had modified the Ethernet and Bonjour library mmyself and got ArdOSC working with the WIZ820io.

However, on the the Teesny3 side I've not been so lucky yet. That set-up is also still on a breadboard.
 
FWIW, I've added wizfat.ino to https://github.com/manitou48/teensy3
The sketch is a hack for doing various udp/tcp tests against a linux box with ttcp and a rate-controlled UDP test code. It also has code for writing/reading WIZ RAM (and examining the low bytes command-and-control area)
 
Connecting PDWN on the WIZ820io to to GND has remedied the problem. At least so far.
A DHCP connection is generated and the script feeds back the Teesny3 IP address.
Now it's on to get Bonjour and OSC working again.
 
Wix820 and Teensy 3.1

Has anyone got the Teensy 3/Wiz820 combo to do anything but get a DHCP request? I can successfully get the request and addressing information, but
if I try to connect to the Ethernet server, it just sits and hangs. I am using a Teensy 3.1 with the Teensyduino 1.17 library and have connected
the PWDN to ground as well. On the other hand, the same sketch using the same Teensyduino version works great with the Wiz812.
 
I've got the Teensy3.x/WIZ820 combo acting as an UDP server, using either DCHP or static IP addressing. I also just recently added EthernetBonjour code that allows me to interrogate the setup using avahi-discover or avahi-browse.

I've got my own board that also has 1-wire and I2C running for my TeensyNet Project.

I made my board using D23 for the WIZ820io reset (this was before Paul and the gang started using D9), so I had to modify some of the ethernet library code to support that, as well as increasing the size of the UDP buffer to a more usable size. I'll fix that with my next ineration of the board.
 
I also created my own Frankenduino adapter board that uses the WIZ820io and can confirm that this works wit the Teensy 3 out of the box.
Please post you sketch so we have something to work with.

Since Teensyduino 1.17 the Ethernet library contains an auto detect so it will automatically detect whether you have a W5100 or w5200 based Ethernet module connected.
 
Last edited:
Status
Not open for further replies.
Back
Top