I am trying to initialize the ENC28J60 on the custom board I received today. But when I try enabling the networkcontroller with networkController.enable(); I get this error:
#### Exception System.InvalidOperationException - CLR_E_INVALID_OPERATION (1) ####
#### Message:
#### GHIElectronics.TinyCLR.Devices.Network.Provider.NetworkControllerApiWrapper::Enable [IP: 0000] ####
#### GHIElectronics.TinyCLR.Devices.Network.NetworkController::Enable [IP: 0007] ####
#### SpeedCAN.Network::InitializeNetwork [IP: 0005] ####
Exception thrown: 'System.InvalidOperationException' in GHIElectronics.TinyCLR.Devices.Network.dll
An unhandled exception of type 'System.InvalidOperationException' occurred in GHIElectronics.TinyCLR.Devices.Network.dll
The schematic of this ENC28J60 is the same as my other designs with this same SC20100S SoC. I have also used this code before. I also checked if my CS, INT and RST pins are properly configured in the code.
Just started a new, empty project and all I added was the sample code from the docs which I adapted to my specific pins.
The InvalidOperationException still occurs, so I don’t think there is something wrong with the software. I think it’s a hardware problem, which I already thought from the beginning.
Do you at GHI now of something that can trigger this? e.g. did you have this while developing a prototype board?
My schematic is the same as my other boards, so that shouldnt be a problem. I’ll continue probing around the board with the oscilloscope and see if I can figure it out.
I found this useful topic outlining how to diagnose some issues on the ENC28J60 chip.
After a lot of probing and trying, I discovered one of the traces going to oscillator was broken so the ENC28J60 didnt have a oscillator connected! After fixing this trace, the ENC28J60 worked flawlessly and the exception didnt occur.
Thanks for your help, @Gus_Issa.
I hope others will find this topic useful, it already ranks at the top of google for the error