This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28379D: Unable to interface Wiznet's W5100s SPI to ethernet module (wiz810sio specifically) with F28379D Launchpad/Daughter Card

Part Number: TMS320F28379D


Hello, 

I am working on developing an inverter. For it, I am using the F28379D daughter card as the real-time MCU. To monitor and control the inverter, I want to use ethernet as the communication protocol. Since the F28379D board does not have an on-board ethernet port, I am using Wiznet's 5100s (Wiz810sio specifically) SPI to ethernet module as the interface. However, I am unable to set it up with the Delfino board. It's not getting initialized properly and the ping test fails. The W5100s chip has a chip version register. Reading it didn't return the correct data either. Suspecting a faulty ethernet chip, I tested it on an Arduino Uno. The module worked perfectly fine when connected to the Arduino Uno. I was able to read the chip version correctly and the ping test worked too. After that I performed the following tests:

1) Loopback test on the F28379D board with the SPI data width set as 8-bit in one case and 16-bit in another. For both cases, the loopback test results were correct. 

                                         8 bit loopback test results

                                                                                                                                   8-bit loopback test results

                                         

                                                                                                                                   16-bit loopback test results

2) Once the loopback test results were verified, I ran the simple test to read the chip version register value of the W5100s module and recorded the results using Saleae's logic analyzer. Again I tried reading the register value by setting the SPI data width as 8-bit in one case and 16-bit in another case. I also tested at various bit rates and selected the STE line manually in a case. In all cases, the results were exactly the same. The chip register value should have been read as 0x51 but it was being read as 0x00. 

                            

                            

                            

                            

                                                                                                                                                      Logic Analyzer Result

3) Tried different W5100s modules and F28379D boards but got the same results as above. 

4) Suspecting the I/O voltage at 3.3V to be insufficient, I tested the W5100s on the ESP32 board which has a 3.3V I/O output as well. The W5100s chip worked perfectly on it and gave the correct results. 

5) Used W5100 module (WIZ812MJ) the old generation of the Wiznet chip. Surprisingly, this chip got initialized properly and the ping test worked with the F28379D board. However, for the project, I need to use the newer generation of the Wiznet module, i.e, the W5100s.  

At this point, I am unable to identify the error and resolve the issue. Any help would be appreciated.

Links: Datasheet W5100s: https://docs.wiznet.io/img/products/w5100s/w5100s_ds_v127e.pdf

Technical Document Wiz810sio: https://www.wiznet.io/wp-content/uploads/2019/01/WIZ810Sio-User-Manual-V1.0-002.pdf

Test code and logic analyzer complete results: https://drive.google.com/drive/folders/1nJsVZrn1WkpddDWpQZ-RhBXa-MySZ90u?usp=sharing

Hope to hear from you soon. 

Best,

Avyay Sah.

                                                                                                        

  • Avyay,

    First of all, kudos on thoroughly debugging this and providing a clear description of the problem!

    I suspect what is happening is that the clock polarity and phase are not set properly. Looking at the wiznet datasheet provided, the MOSI line is expected to toggle on the falling edge of SCLK, but on the analyzer plot it looks like the opposite is the case.

    We often see this issue where the each IC manufacturer defines the SPI "mode" differently. Please review the SPI chapter in the reference manual for F2837xD. I suspect you will need to change the SPI clock and phase settings.

  • Hi Gus,

    Thank you so much for the prompt reply and for finding my trivial error. I changed the SPI mode on the F28379D board and the W5100s chip is working now. I'll remember to zoom in and properly compare the timing diagrams in the future. 

    I have a doubt though. According to Wiznet's datasheet, (if I have read it correctly) SPI, Mode 0 is defined the same way for both W5100 and W5100s chips. 

    On the F28379D board, when I initialized the SPI bus as mode 0, i.e., SPI_PROT_POL0PHA0, how come the W5100 chip got initialized properly with the ping test returning a positive result whereas the W5100s chip failed the test? 

    Best,

    Avyay

  • I'm glad the issue is resolved.

    how come the W5100 chip got initialized properly with the ping test returning a positive result whereas the W5100s chip failed the test? 

    I am not familiar with either device, so I don't have any idea. If you are running the exact same code, I would say take another closer look at the datasheets. There could be some small difference you are overlooking.

  • Hi Gus, 

    No worries. Thanks a lot for your help. 

    Best,

    Avyay