CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Has anyone succeeded with Wiznet W5100 using CCS

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
cbarberis



Joined: 01 Oct 2003
Posts: 172
Location: Punta Gorda, Florida USA

View user's profile Send private message Send e-mail

Has anyone succeeded with Wiznet W5100 using CCS
PostPosted: Sat Jun 30, 2012 5:06 pm     Reply with quote

Hello, I have been trying to talk to a Wiznet W5100 device with no success, I have read the data sheet and everything seems quite straightforward. I have followed the pin connections on the application notes from Wiznet and wrote some simple code just to write to some of the registers. Actually, I used PCM programmer simple test code to write to the gar0-gar3 registers. http://www.ccsinfo.com/forum/viewtopic.php?t=40693&highlight=w5100

I am using an arduino ethernet shield board which contains a W5100 and breakout connectors (very similar to the other module SparkFun Has)
http://arduino.cc/en/Main/ArduinoEthernetShield

I am talking to it via a explorer16 board with a PIC24F I am just using the SPI2 port a RST and a Chip select to talk to the W5100. I am using the hardware SPI mode 0 which is what is recommended for the W5100. I have looked at the spi signals with a logic analyzer and all the write frames seem just fine and contain the right data, I have also looked at the read frames, they also appear to be ok except, the MISO is always zero. So apparently the writes are correct but I don't believe I am writing to the device, or perhaps just not reading. I have gone back thru the data sheet and app notes but cannot see anything that stands out. I am sure I am doing something incorrect or it is something stupid I have overlooked. Has anyone here been successful in using this device with a PIC? and if so, please shed some light my way. Thank you!!
temtronic



Joined: 01 Jul 2010
Posts: 9174
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Jun 30, 2012 5:29 pm     Reply with quote

If you haven't already done so, I'd download the sparkfun documentation and compare your board to theirs, then look at the software they have and see if yours is 'close'. Since your is 'similar', you might see what is different. Perhaps just a wiring issue, bad solder joint,maybe the pinout is 'backwards'....real hard to tell 'over the Net' what's going on.
I know it 'looks right' but maybe 'ring out' the circuit.
Obvious issues like power supply decoupling, filtering, ground loops, correct Vdd, signal swing to Vdd, improper reset logic if applicable?
Also check the listing of your code to be sure the correct pins are being used...maybe a 'compiler bug' thinking data is coming on ie: PB2 when it should be PB3.

hth jay
cbarberis



Joined: 01 Oct 2003
Posts: 172
Location: Punta Gorda, Florida USA

View user's profile Send private message Send e-mail

PostPosted: Mon Jul 02, 2012 5:42 am     Reply with quote

I have looked at all the documentation and downloaded the schematics for the board I have. Out of desperation I have even tried running PCM programmers code on a PIC18F and although his code is running as it should I still cannot read-back any of the registers that I have supposedly written, I have also tried it on another W5100 device (in case the previous was defective) with the same results. I am also running both my PIC and W5100 on a 3.3V supply so there is no signal translation issues.
temtronic



Joined: 01 Jul 2010
Posts: 9174
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jul 02, 2012 6:23 am     Reply with quote

I think you're going to have to google some more. I looked for Wiznet W5100 PIC C code and got 34,000+ hits (your q is #2) so there seems to be a lot of interest in it. Much of it is Ardunio or AVR C code, but perhaps scanning a few of them you can see a 'test' program or similar code.
Not having that chip here means I can't cut code/debug/test and others here will be the same. It's very hard to say what is wrong when you can't test in front of you.

hth
jay
Ttelmah



Joined: 11 Mar 2010
Posts: 19369

View user's profile Send private message

PostPosted: Mon Jul 02, 2012 8:10 am     Reply with quote

Are you connecting 5v to the board?.
I notice that part of the reset circuit pulls up to the 5v line, rather than 3.3v. Wonder if this is not pulled up, whether the chip remains permanently reset?.

Best Wishes
cbarberis



Joined: 01 Oct 2003
Posts: 172
Location: Punta Gorda, Florida USA

View user's profile Send private message Send e-mail

PostPosted: Mon Jul 02, 2012 2:52 pm     Reply with quote

After going nuts and waisting over 12 hours on this, I finally found what the problem was(is) As usual, I give great credence to schematics and the schematic that I downloaded from the manufacturer of the arduino EtherShield is totally incorrect, (this is their latest for this board) as it turns out both the MISO and MOSI spi lines were going to a different connector. Unfortunately, this piece of garbage board does not have a component silk screen and there is no documentation showing component references. So after going from point to point with an ohmmeter and making lots of notes I was able to hardwire to the correct points and now the SPI communications works as they should. BEWARE OF THOSE CHEAP BOARDS MADE IN ITALY!!

Once again I like to thank you all for your advice.
temtronic



Joined: 01 Jul 2010
Posts: 9174
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Jul 02, 2012 6:03 pm     Reply with quote

yeesh..reverse engineering an SMT board ain't my idea of fun !! You have more patience than me, then again I'm pushing 60 and been doing this for, yikes, 40 years.....vacuum tubes were a lot more fun....
I recall that Microchip's schematic of their Picstart Plus was wrong. Just 2 little wires crisscrossed....oh what joy....
I am very happy you stuck with it.
cbarberis



Joined: 01 Oct 2003
Posts: 172
Location: Punta Gorda, Florida USA

View user's profile Send private message Send e-mail

PostPosted: Mon Jul 02, 2012 9:05 pm     Reply with quote

You are pushing 60???
Man.......i went by that number not too long ago!!
Maybe I should not post this as many may consider me feeble minded and a technological dinosaur
cbarberis



Joined: 01 Oct 2003
Posts: 172
Location: Punta Gorda, Florida USA

View user's profile Send private message Send e-mail

PostPosted: Sun Jul 15, 2012 10:53 am     Reply with quote

My W5100 saga continues with the interface of the Wiznet W5100. Although, I have now the W5100 up and running and communicating via SPI, I can also ping it from anywhere in my network and get the correct response. Additionally, I seem to be receiving characters on the receive buffer of the W5100.
I am using a UDP terminal program and I can send a string i.e.; "12345" my receive data is picked up by the W5100 and the correct number of characters (if I change the string length it always reads the correct length) is received, but so far I have not been able read the above characters from the W5100 receive buffer.
I found an application written for the PIC18 by Fred Eady (circuit Cellar- ethernet boot camp) using this same W5100 chip. I had to modify the C code and header files extensively to use it with the CCS compiler and furthermore I also found some errors on this code. I realize that using the UDP protocol every data packet received consists of an eight data byte header plus the message. So far I have not been able to read the data message from the W5100 rx buffer.
I wish now that I would have used the Microchip ethernet controllers as most the libraries are out there and it would probably would have been a much simpler task. I have done a lot of searching through the Arduino libraries but unfortunately these are mostly written in C++ and it becomes quite difficult to translate them back to the CCS C compiler.
Has anyone here ever done a simple UDP data exchange (receive/transmit) with this device?? If so, any guidance would be greatly appeciated!!
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Jul 16, 2012 2:23 pm     Reply with quote

Quote:

BEWARE OF THOSE CHEAP BOARDS MADE IN ITALY!!


the core problem is neither of cheapness or Italy Very Happy Very Happy

I venture to say that the TRUE problem is incompetent circuit designers
and an inexperienced layout person.

this is a timeless problem that that i am sure Italy nor any other country -
has cornered the market on.
thefloyd



Joined: 02 Sep 2009
Posts: 46

View user's profile Send private message

PostPosted: Thu Sep 13, 2012 1:15 pm     Reply with quote

cbarberis, have you succeeded at all getting a PIC speaking to a network via this chip?

I'm about to attempt this journey as well. I saw the circuit cellar article as well, would you mind sharing your modified code? Glad to give back any fixes or enhancements I can contribute as well.
cbarberis



Joined: 01 Oct 2003
Posts: 172
Location: Punta Gorda, Florida USA

View user's profile Send private message Send e-mail

PostPosted: Fri Sep 14, 2012 7:51 am     Reply with quote

To answer your question; Yes, i finally (after 3 months) did get it to work albeit the UDP functionality that I wanted is buggy at best. It turns out that there is some errors and bugs with the actual device, specially when using UDP transfer mode. I must say, I thought this device was a lot tougher than I thought to write a driver for, and it was supposedly going to make it easier in developing an ethernet application. BTW, the code posted on Circuit Cellar by Fred Eady never did work for me! I am currently traveling overseas, if you send me your contact info I can supply you with my version of the driver. I would strongly suggest that you look into the W5200 rather than the W5100, there is already a PicTail board available and all the drivers for Microchip are also available from Wiznet. The W5200 does not have all the bugs that I mentioned and it is a much better device.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group