Cannot reset INT pin on W5500 after interrupt
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: Cannot reset INT pin on W5500 after interrupt
by Eugeny ·
What interrupt registers read at this time - before abd after their reset?
Let’s consider the possibilities why flags do not reset:
RE: Cannot reset INT pin on W5500 after interrupt
by BitBanger46 ·
After some debugging, I determined that the problem was caused by writing to the W5500 registers while in the interrupt routine. I discovered that, if the code that was executing was accessing the registers in the W5500 when an interrupt occurred, then it is possible for a conflict to occur. I changed the code in the interrupt routine to set a flag indicating that an interrupt occurred. The interrupt routine does not access any of the registers in the W5500. When the program that is executing sees the interrupt flag is set, it will read the interrupt status registers to determine the cause if the interrupt and reset the interrupt status bits. I am working on another approach which is to disable interrupts from the W5500 whenever the program that is executing accesses the W5500 registers. This too will prevent any conflicts.
RE: RE: Cannot reset INT pin on W5500 after interrupt
by Eugeny ·
The interrupt condition must be cleared in the ISR, otherwise after exiting the ISR, it will be (immediately) called again.
RE: Cannot reset INT pin on W5500 after interrupt
by Mohammed ·
I’ve found a precaution regarding the interrupt in the application note of W5100S which maybe applicable to W5500.
https://wizwiki.net/wiki/lib/exe/fetch.php/products:w5100s:application:w5100s_an_interrupt_v100e.pdf
It says that the interrupt may happen in the middle of SPI signaling and if there are any code to control
SPI signal in the Interrupt Handler like writing or reading from a register, the SPI frame will be damaged.
So, @BitBanger46 you are right regarding this. However, after some trials and error in my code I concluded that if the interrupt happens periodically and fast about every <= 1s, the SPI will break and code stopped working. If the interrupt happens to be for example every 1 min like my case it will be ok but still it is a bad practice and your suggestion by setting a flag is the best way.
RE: Cannot reset INT pin on W5500 after interrupt
by BitBanger46 ·
Thank you for the additional information about the problem with interrupts. It should be helpful to developers who are writing interrupt driven code.