9 years, 9 months ago.

Interrupts?

Hi there, I'm using a wiz812mj with the w5100 chip on a Nucleo board.

I'd like to know when someone tries to connect to the device through interrupts rather than having to continuously poll for connections. Is this supported by the library? Is it just a case of getting the MCU to watch the interrupt of the 812mj?

Many thanks, Darius

Question relating to:

This is WIZnet Ethernet Interface using Hardware TCP/IP chip, W5500, W5200 and W5100. One of them can be selected by enabling it in wiznet.h. ethernet, tcp/ip, w5100, W5200, W5500, Wiznet

1 Answer

9 years, 4 months ago.

Hi Darius

The interrupt events of W5100 are occured when W5100 has <IP Conflict>, <Destination unreachable>,<PPPoE Connection Close> and Socket events. ( Socket events : SEND_OK, TIMEOUT, RECV, DISCONNECT, CONNECT )

Currently, you can't use W5100 interrupt function in this library. In this library, W5100 handles socket events using polling method.

If you want to use interrupt function of W5100, you can use as below.

- IR(Interrupt Register) Address : 0x0015

- IMR(Interrupt Mask Register) Address : 0x0016

- S0_IR(Socket 0 Register) Address : 0x0402

- S1_IR(Socket 0 Register) Address : 0x0502

- S2_IR(Socket 0 Register) Address : 0x0602

- S3_IR(Socket 0 Register) Address : 0x0702

include the mbed library with this snippet

 uint8_t interrupt_info_socket0;
 uint8_t interrupt_info_socket1;
 uint8_t interrupt_info_socket2;
 uint8_t interrupt_info_socket3;
 
 eth.reg_wr<uint8_t>(0x0016,0xEF);   // All interrupt enable
 interrupt_info_socket0 = eth.sreg<uint8_t>(0,0x0002);
 interrupt_info_socket1 = eth.sreg<uint8_t>(1,0x0002);
 interrupt_info_socket2 = eth.sreg<uint8_t>(2,0x0002);
 interrupt_info_socket3 = eth.sreg<uint8_t>(3,0x0002);

For more information for interrupt information, refer to data sheet of W5100. http://www.wiznet.co.kr/Admin_Root/UpLoad_Files/BoardFiles/W5100_Datasheet_v1.2.5.pdf