TCP Server Sending Wrong Data Sometime
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: TCP Server Sending Wrong Data Sometime
by Eugeny ·
Print bytes you put into the TX buffer onto the screen / diagnostic console - literally - when you put byte to the TX buffer also print it onto the screen. It may happen there’s something corrupting characters during data move (e.g. interrupt routine not saving accumulator). Then check packets from the W5500 to see what data is in packets.
RE: TCP Server Sending Wrong Data Sometime
by Philipp K ·
If this problem is not completely deterministic, maybe the SPI frequency is too high? Because with an increased frequency, the probability for errors also increases; furthermore the data that is transmitted from the host MCU to the W5500 doesn not have a checksum. You could try reading back your TX data after writing it to the buffer and see if the data matches
RE: TCP Server Sending Wrong Data Sometime
by Mxyxixptlick ·
The W5500 datasheet says the device is stable up to SPI clock rates of 33.3MHz (Section 5.5.4 SPI Timing).
RE: RE: TCP Server Sending Wrong Data Sometime
by Philipp K ·
I know that, but I can’t see where OP mentioned that he does not exceed that frequency. Furthermore the chip’s SPI isn’t necessarily the only thing that might have trouble with a high clock frequency; Depending on the host MCU or the layout, other issues might arise too.
RE: TCP Server Sending Wrong Data Sometime
by Mxyxixptlick ·
You made a valid point; I was providing more detail. Sadly, RTFM is a dying art.
RE: TCP Server Sending Wrong Data Sometime
by Philipp K ·
I thank you for that
When I get this sort of issue, I mostly try drastically lowering the frequency, to verify whether it is an issue.
I think, that fact that 0x0C = 0000 1100 and 0x1E = 0001 1110 and that he said
might support this idea, because it looks like something is skewed.
You’re absolutely right.
RE: TCP Server Sending Wrong Data Sometime
by Mtuan ·
Thanks for all of your helps.
I lowered my spi baud rate, and it helped a little not totally. However, it does not make sense unless my board is very noisy.
RE: TCP Server Sending Wrong Data Sometime
by Philipp K ·
Did you try to implement a readback to see if the data makes it all the way to the chip?
Could you find any pattern as to under which circumstances this happens?
And out of curiousity: What was your frequency before and after, if I may ask?
RE: RE: TCP Server Sending Wrong Data Sometime
by Mtuan ·
Yes, I did. I verified data before updating S0_TX_WR pointer, and I found that occasionally few bytes of Tx data was loaded incorrectly when error occurred.
Not in pattern, but most of the time, error appeared to be coincidentally happened when the computer broadcast “Whohas”
I was running at 500Khz bit clock, and reduced to 50Khz…This does not help much - I think
There are a few more ICs (i.e. EEPROM, Encoder, and Switches) connected in the spi bus, but they should not be active because their CSx pins having pulled up resistors by default.
I’ve also seen that S0_SR having a few weird states such as 0x01, 0x02, 0x03 during disconnect and re-open the socket.
RE: TCP Server Sending Wrong Data Sometime
by Mxyxixptlick ·
Are there other SPI-connected devices in your system? If so, have you set their CS pin as an output and forced it to be HIGH?
RE: TCP Server Sending Wrong Data Sometime
by Philipp K ·
Where those the same bytes that ultimately were received wrong too?
Neither should be an issue
Only Pull-Up resistors? Or do you actively drive the pins high when de-selecting the devices? Did you verify the levels?
Do you maybe have oscilloscope screenshots of the SPI waveforms?
RE: TCP Server Sending Wrong Data Sometime
by Mtuan ·
I drive the chip select pin (CS) low when communicate with the device, so I know for sure that others do not go low, except W5500 CS pin. Level had been verified too.
Monitoring S0_SR=0x14 listen mode
CH1: CLK, CH2:MOS, CH3: SOMI, CH4: CS
(Note: clock line has jitters due to the broken GND connector on the probe)