InvalidOperationException when ReadValue from ADC and freeze

I use reading from adc (every 200ms) and enc28. When enc is on and the cable is connected, reading from the ADC sometimes throws an exception InvalidOperation. And sometimes there is a complete freeze (!) of the SCM20260N module. Besides that, once there was an exception InvalidOperation at EthENC28.Enable().
I did a lot of tests and found out that if enc is not used, then there are no exceptions when reading the ADC and there is no freezing of the module.

I excluded the use of the ADC from the project, but the module freezes also occur, but more rarely and not regularly. Enc28 initialized but no cable connected. I hope you find what is the cause of the hang and fix it in

Hi, we did quick test with ENC, ping /t from PC and put reading adc in a loop with delay 200ms as you said.

So far it seem good. I know this is random but could you send us a simple project that we can reprodue? what adc channel, what pin?.. It could be channel 1 is fine but channle 2 cause problem, so we need to know more detail and, how often does the crash happen? 1 min or 1 hour.??

Is this happening with a custom board?

Sorry for the long silence - I rested and sunbathed :slight_smile:
I have custom board.
When there was the first crash, I found out that it was an unhandled exception when reading from the ADC. Now I use try…catch for ReadValue for SC20260.Adc.Controller3.PF8.
But then I got a complete freeze up to 5 times during the working day. And on other days, not a single time. In addition, sometimes the socket connection was interrupted.
Simple project will send soon.

We had this exact freezing problem when using enc28.

It was easy to reproduce by using a tool to rapidly ping the module, then we could reproduce in a minute or two.

We eventually switched away from the enc28 for this reason.

Fine. We are not the only ones with this problem.
Explain which tool you used and what you used instead of enc28

There is instructions and more details in this thread:

We switched away from ENC28 to use the built in ethernet of the SC20100 combined with a DP83848 PHY. We are still experiencing some crashes, but much less frequent and seemingly not related to ethernet. We are still investigating. Currently relying on watchdog to keep our modules operational.

Thanks. I also came to the conclusion about the need to use a watchdog timer in this situation.
I hope GHI will solve this problem. With the G120 module there were no such problems with enc28