Interrupts don't fire if reading status register
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: Interrupts don't fire if reading status register
by Mike ·
If I add a 20us delay in the loop, it works fine.
[code]/* psuedo code: this works /
while(1)
{
uint8_t status = socket_get_status();
switch(status)
{
/ … */
}
} [/code]
Anyone have an idea why?
RE: Interrupts don't fire if reading status register
by Mike ·
[quote]Check the mask value of IMR regsiter.
When the mask value set as ‘1’ ans the coresponding bit also set as ‘1’ , Interrupt oucurrs.
Others, no interrupt oucurrs.[/quote]
Since the interrupts do occur when not reading the status register, or after adding a delay to the loop, the mask is set correctly. If it wasn’t I wouldn’t receive interrupts under any condition.
Again, since I am getting interrupts under certain conditions, it is obvious that the hardware is wired correctly.
And again, since I am getting interrupts under certain conditions, it is obvious this is set correctly.
The only difference is a 20us delay added in the loop, and it makes all the difference. Is the W5100 unable to pull the interrupt pin if it’s register are being read?
RE: Interrupts don't fire if reading status register
by Mike ·
[quote]I wonder how to process Sn_IR register and what is your ISR routine.
Sn_IR represents the interrupt of socket such as CONNECT,DISCON,RECV,SENDOK and TIMEOUT.
if Sn_IR is not zero and Sn_IR mask bit is set, n bit of IR become set and Interrupt pin hold low until IR is not zero.
Although IR is not zero, another interrupt can be occurred without changing the interrupt pin.
So, Once interrupt is detected, you should process all IR bit and clear all Sn_IR.[/quote]
This is exactly what I’m doing. I modeled it after the examples and the information in the datasheet.
I ask that you please take the time to test yourself. Create a simple loop to repeatedly read the status register, and see if it prevents the interrupts from firing. Knowing if you experience the same problem will be very helpful.
Thanks.
RE: Interrupts don't fire if reading status register
by hjjeon0608 ·
Hi,
I am trying to test your condition.
After test I will post ASAP.
Best regards.
RE: Interrupts don't fire if reading status register
by hjjeon0608 ·
Hi,
I tested done.
But interrupt is always fine.
So, I think reading status register has nothing to do with interrupt.
Let’s try to find problem.
Best regards.
RE: Interrupts don't fire if reading status register
by Mike ·
Thank you for taking the time to test. Were you using the SPI interface? I suspect that is critical to reproducing the problem.
RE: Interrupts don't fire if reading status register
by hjjeon0608 ·
Hi,
I tested interrupt in SPI interface.
And post your schematics and I/O function code.
Then we will check and reply.
Best regards.
RE: Interrupts don't fire if reading status register
by Mike ·
Let’s start with the schematic. Here it is. Do you see any potential problems?
RE: Interrupts don't fire if reading status register
by peter ·
I made a few comments about the schematic.
Thanks.
RE: Interrupts don't fire if reading status register
by Mike ·
[quote]1. To use system bus interface mode, pull down the SEN pin.
2. You can’t use both MCU system bus I/F mode and SPI I/F mode simultaneously.[/quote]
Yes, we are aware of this. The “DNI” (Do Not Insert) is only there in case we change our minds, so we don’t have to refabricate a PCB.