ATMEGA164P + Wiznet W5500 Development module PING Issue
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: ATMEGA164P + Wiznet W5500 Development module PING Issue
by Eugeny ·
After performing soft reset you must read MR in loop checking its bit 7 to become 0. You can continue with GAR only after you ensured MR’s bit 7 is reset, otherwise you may “write” to the chip while it is in reset mode, thus not setting registers properly.
RE: ATMEGA164P + Wiznet W5500 Development module PING Issue
by allsetgo ·
Hello
I am trying to read the MR register. Here is the issue.
I have uploaded the pics
pic 1.
MOSI (blue) and SCLK (yellow) - the waveform is for writing to MR register. As seen the MOSI line send &H00, &H00, &H04, &H80
pic2.
CS(blue) SCLK (yellow)- It shows the chip select is low when SCLK is present
pic3.
MISO (blue) and SCLK (yellow)- the problem is the MISO line always shows this weird waveform whether I am reading or writing to the registers.
pic4
MOSI (blue) SCLK (yellow)- this is what I send to read the MR register. MOSI line send data correctly &H00, &H00, &H00, &H80 (dummy data)
The MISO line is not responding. That means the w5500 registers are not updating.
Any recommendation. Please help
RE: ATMEGA164P + Wiznet W5500 Development module PING Issue
by allsetgo ·
Looks like pic 2 didn’t upload
CS & SCLK
RE: ATMEGA164P + Wiznet W5500 Development module PING Issue
by lawrence WIZnet ·
hello, allsetgo
In W5500, you must set CS low during SPI Frame.
Never set CS low and high each byte in SPI Frame.
If CS goes high during SPI frame, It is reset.
Thank you
lawrence
RE: RE: ATMEGA164P + Wiznet W5500 Development module PING Issue
by allsetgo ·
Thanks Lawrence
The PING works. I will get in touch if I have problem with setting up the TCP
RE: ATMEGA164P + Wiznet W5500 Development module PING Issue
by lawrence WIZnet ·
Glad to hear that!!
Sure! anything you want, feel free to ask!
Thank you,
Lawrence
RE: ATMEGA164P + Wiznet W5500 Development module PING Issue
by allsetgo ·
Hi Lawrence
Here is my issue with setting up the TCP. I am using W5500 in TCP server mode.
Here is the sequence in addition to above code.
My PING IS working i.e. my module is part of the network.
I am using SOCKET0
Start
The Initialize and LISTEN mode works well. But I am not able to ESTABLISH a connection. My Sn_SR stays in Listen Mode.
Can you help me in how to send connection request from Client.
All I do is open my Mozilla browser and type the Ethernet Module IP that I have set 192.168.1.200
It says unable to Connect
Also, how does the Socket Port plays role here. If I set it to 5000, how should I sent request to connect to 192.168.1.200 over port 5000 in my browser.
RE: ATMEGA164P + Wiznet W5500 Development module PING Issue
by lawrence WIZnet ·
Hello, allsetgo
I want to know about 2 things.
First,
In TCP connection from web browser, you do not need to do anything because PC will do connect automatically.
But, you have to add PC network address “192.168.1.x” in Ethernet Adapter.
Second,
The network condition. Do you connect W5500 and PC directly or though hub or switch?
In both case, you should catch the packet with wireshark.
wireshark is open tool and it will show you the connection packet.
If you feel hard to use it, please let me know. I will guide you.
At the end,
If you connect “192.168.1.200” “port=500” in browser, you must type “192.168.1.200:5000” in browser.
Thank you
lawrence
RE: RE: ATMEGA164P + Wiznet W5500 Development module PING Issue
by allsetgo ·
Hi Lawrence
Thanks again. I connect W5500 module and PC via a hub. As you recommended
typing “192.168.1.200:5000” established the connection.
I am trying to perform a read operation now on W5500 module.
I read the size of the data sent which turns out to be correct. i.e reading
RSn_RX_RSR
Next I read my Sn_RX_RD for socket 0 i.e (offset addr = [0x0028}, Control
= &H08)
this reads out to be 0
My question is how should I read the RX buffer
Since Sn_RX_RD=0 my start address for socket 0 RX buffer is 0x0000 ?
now if I perform a read from address 0x0000 and read the no of bytes as per
the size I received RSn_RX_RSR gives me wrong data.
i.e. I set addr=[0x0000], control=[0x18]
I have never used wireshark before. Any help would be great.
RE: ATMEGA164P + Wiznet W5500 Development module PING Issue
by lawrence WIZnet ·
hello, allsetgo
Sn_RX_RD is not automatically updated with new pointer value.
After read the RX buffer, user must write Sn_RX_RD with the data size user read from buffer.
And do Sn_CR[RECV]. Then Sn_RX_RD value changed.
When user want to read data from RX buffer, easy way is using ioLibrary, especaily, “int32_t recv ()” function in ioLibrary
I am not sure about how you program it.
But I recommand to use iolbrary. it is way easier.
GitHub - Wiznet/ioLibrary_Driver: ioLibrary_Driver can be used for the application design of WIZnet TCP/IP chips as W5500, W5300, W5200, W5100 W5100S. (download link).
please refer the recv() in socket.c in Ethernet folder in ioLibrary
And also in W5500 datasheet, Figure12,13 and Figure20, there is the physical memory address for accessing.
To read RX memory, user must directly access to physical memory and read it.
If I tell you whole receiving processor at here, it will make more confusing you.
Please refer the ioLibrary → Ethernet → socket.c / w5500
And also anything feel free to ask
Thank you
lawrence
RE: ATMEGA164P + Wiznet W5500 Development module PING Issue
by allsetgo ·
Hi Lawrence
I am using W5500 development brd with my custom ATMEGA164P board. I use BASCOM AVR for coding.
I was able to read the data correctly and the no. of bytes sent.
I now need help with Sending data. When I read Sn_TX_RD it reads different values all the time
RE: ATMEGA164P + Wiznet W5500 Development module PING Issue
by allsetgo ·
Hi Lawrence
I am using W5500 development brd with my custom ATMEGA164P board. I use
BASCOM AVR for coding.
I was able to read the data correctly and the no. of bytes sent.
I now need help with Sending data. When I read Sn_TX_RD it reads different
values all the time
Call Wiz5500_readvalue_16bit(sock_tx_fsr , &H08)
Print Hex(read_val_16h) ; “:” ; Hex(read_val_16l) ’ Reads 0x0800
Call Wiz5500_readvalue_16bit(sock_tx_RD , &H08)
Print Hex(read_val_16h) ; “:” ; Hex(read_val_16l) ’ Reads random
data such as 0x8368 and keeps changing even if I do not issue the send
command
Call Wiz5500_readvalue_16bit(sock_tx_WR , &H08)
Print Hex(read_val_16h) ; “:” ; Hex(read_val_16l) ’ Reads same value
as Sn_TX_RD
Call Wiz5500_writevalue_socket(Addr , &H14 , Data) ’ here addr I
used was same as what I read from Sn_TX_RD i.e 0x8368
Call Wiz5500_writevalue_socket(w5500_cr , &H0C , &H20) ’ Sn_CR= SEND
Do Loop
Sub Wiz5500_readvalue_16bit(reg , Value)
Adres = RegReset Wiz5500_cs
Spiout Adresh , 1
Spiout Adresl , 1
Spiout Value , 1
Spiin Read_val_16h , 1
Spiin Read_val_16l , 1Set Wiz5500_csEnd Sub
Sub Wiz5500_writevalue_socket(reg , Value1 , Value2 )
Adres = RegReset Wiz5500_cs
Spiout Adresh , 1
Spiout Adresl , 1
Spiout Value1 , 1
Spiout Value2 , 1Set Wiz5500_csEnd Sub