hi
i have some problems with w5100 when i want to program it.
1.when i write in Gateway_IP register, after that i cant see the content of it. but when i use an infinite loop for writing and reading the register it works and I see the content . so have you ever had this problem? is it normal or my programming isn’t correct ?
2. i have written in below registers for Ping command is it enough or i have to wrote in other registers ?
Gateway Address Register
Source Hardware Address Register
Subnet Mask Register
Source IP Address Register
Interrupt Mask Register
Set up RX Memory Size Register and TX Memory Size Register
You need to give background: when you write, what you write, what hardware platform you use.
It is not correct that you can not read GAR back, but it may happen because you do something in wrong time.
[quote=“kavireloot”]2. i have written in below registers for Ping command is it enough or i have to wrote in other registers ?
Gateway Address Register
Source Hardware Address Register
Subnet Mask Register
Source IP Address Register
Interrupt Mask Register
Set up RX Memory Size Register and TX Memory Size Register
Initialize W5100 with S/W reset.[/quote]
This is wrong.
- Initialize W5100 with S/W reset.
should be the first step, not the last. When you perform reset on the chip all settings you set before are cleared. You also should ensure you set PB bit in MR register for ping to work.
Logically it is correct. How do you define constants and arrays?
W5100_MODE=?
MODE_RST=?
W5100_SHAR=?
Phy_Addr=?
W5100_GAR=?
Gateway_IP=?
W5100_SUBR=?
Sub_Mask=?
W5100_SIPR=?
IP_Addr=?
W5100_IMR=?
W5100_RMSR=?
W5100_TMSR=?
W5100_RTR=?
W5100_RTR=?
W5100_RCR=?
What is the code of Write_W5100()?
Where failure in this code occurs giving you unexpected result, what is wrong result and what is expected result?
Well, I do not see SPI clock in the code, thus it is not possible to check if SPI communication is correct. However as you say you get AA back, we assume SPI protocol works. There’s one issue though. You write 80 into mode register, signalling W5100 to reset, but do not wait for its reset completion. Before doing anything else you should ensure that bit 7 is 0 = reset complete.