Hi~
What is the BIT16EN pin set to?
and could you please tell me the used interface?(For example, use the indirect bus)
What do you show when you read the S0_TTLR?
If you don’t write S0_TTLR, you can read 0x80.
Dear Irina!
Thank you for your replay and support!
I used direct bus and set BIT16EN pin to HIGH level
Also I read 0x80 from S0_MR
Now I have problems with initialization of UDP mode
But I can ping the device
I do the following:
nRESET pin hold in low 10
After nRESET release(going to HIGH) wait 10 ms
Write to S0_CR (address 0x202) = 0x0010 ;
Write to MR (address 0x000) = 0x0000 ;
Write to IMR (address 0x004) = 0x70FE ;
Write to SHAR (address 0x008) = 0x0008 ;
Write to SHAR2 (address 0x00A) = 0xDC01 ;
Write to SHAR4 (address 0x00C) = 0x0203 ;
Write to GAR (address 0x010) = 0xA9FE ;
Write to GAR2 (address 0x012) = 0x0001 ;
Write to SUBR (address 0x014) = 0xFFFF ;
Write to SUBR2 (address 0x016) = 0x0000 ;
Write to SIPR (address 0x018) = 0xA9FE ;
Write to SIPR2 (address 0x01A) = 0x0003 ;
Write to RTR (address 0x01C) = 0x0FA0 ;
Write to RCR (address 0x01E) = 0x0007 ;
Write to MTYPER (address 0x30) = 0x00FF ;
Write to TMS01R (address 0x20) = 0x400 ;
Write to RMS01R (address 0x028) = 0x0C00 ;
Write to S0_IMR (address 0x204) = 0x0011 ;
Write to S0_DIP (address 0x214) = 0xA9FE ;
Write to S0_DIP2 (address 0x216) = 0xD955 ;
Write to S0_DPORTR(address 0x212) = 0x1388 ;
Write to S0_MR (address 0x200) = 0x0002 ;
Write to S0_PORTR (address 0x20A) = 0x1388 ;
Write to S0_CR (address 0x202) = 0x0001 ;
After that I just read S0_SSR (adress 0x208) on cycle and check its value on 0x0022
CS High level time is 210 ns during write and cyclic read
But INT value always on High level
And S0_SSR always 0x0001 - ARP
I checked that after writing to S0_CR, S0_CR cleared
You must be set ‘1’ as bit 0, so you can see interrupt of the SOCKET 0.
Write to S0_IMR (address 0x204) = 0x0011 ;
This value is the operation status of TCP.
You said, you want to use the UDP mode ,is it right?
If right, you have to set the RECV/TIMEOUT/SENDOK
And S0_SSR always 0x0001 - ARP
It is the status that ARP-request is transmitted in order to acquire destination hardware address.
This status is observed when SEND command is performed at the SOCK_UDP.
If hardware address is successfully acquired from destination(when ARP-response is received), it is changed to SOCK_UDP. If It’s failed and ARP timeout occurs(Sn_IR(TIMEOUT)= ‘1’), in case of UDP mode it goes back to previous status(SOCK_UDP)
You can see the network packet using the wireshark program.
If you use this program, you can confirm the status.
(For example, failed ARP-response…)
Hi~
Could you please try to test the next operation?
Write to S0_CR(address 0x202) == 0x0001(Socket open operation as UDP) → S0_SSR: SOCK_UDP
Read to S0_CR(address 0x202) → 0x0000
Write to S0_CR(address 0x202) == 0x0020(Send operation)
→ You can see the ARP request via wireshark program. And when completing the SEND process, S0_IR (SENDOK) becomes ‘1’.
After checking S0_IR(SENDOK) = ‘1’, the host can give SEND command to the next data.
I saw the attached figure. W5300(169.254.217.3) send the UDP packet to 169.254.217.85, is it right?
I thank it operates as well.
UDP is different from TCP.
It initializes SOCKET 0 and Opens according to protocol type set in S0_MR(P3:P0)
when it sets S0_CR as OPEN command , S0_SSR according to S0_MR(P3:P0)
Therefore if you operate the UDP, SOCK_INIT of S0_SSR isn’t exist .
But the previous was done successfully , thanks to Irina
Now Ive noticed that I can not send more then one byte
The flow the same, except I send sequentually Word by Word to Tx_Fifo the data(92 Words).
Wireshark shows that UDP sending is absent, but when I store one Word to Fifo, It shows UDP sending with one sent Word and another more, wich I havent send
Please, help
You means,
TX fifo size of Socket 0 is 64Kbytes, Tx_RSR size of Socket 0 is 255byte, is it right?
Could you tell me the S0_TX_FSR value?
It sets IP address and port number of the peer, saves the transmitting data in the internal
TX memory through Sn_TX_FIFOR, and tries to transmit the data to the peer.
Read S0_TX_FSR2 (address 0x226) and check on value more than 192 bytes
If true
Write to FIFO 96 words and after that write to WRSR registes 192
and after that write SEND command
else
Read S0_TX_FSR2 (address 0x226) and check on value more than 192 bytes again until true will reached
After you send the data, could you check the Sn_IR(SENDOK) is ‘0’?
And the host can’t write data through S0_TX_FIFOR as the size bigger than S0_TX_FSR.