Problems with io6Library

I am trying to use the io6Library with a PIC24 and MPLAB X IDE.

I followed the " How to use" steps on the github page but cannot get the chip ID read out:
ctlwizchip(CW_GET_ID,&chip_id); // Check WIZCHIP ID value for read test

Do I need to call wizchip_init() or ctlwizchip(CW_SYS_UNLOCK,&syslock) before reading the chip ID?
When these functions I can see some SPI communication with an logic analyzer.
If ctlwizchip(CW_GET_ID,&chip_id) is called, I cannot see any SPI communication.

Anyone who can help me or point me in the right direction?

Thank you!


The CW_GET_ID means static strings of _WIZCHIP_ID_ defined in wizchip_config.h.

There are examples of W6100EVB. This is Loopback one of W6100 examples.

Thank you.

Thanks taylor for your reply.

I included the wizchip_conf.h but I can’t see any SPI activity on the SPI pins.

Thanks for the link, I will try one of the examples.

Unfortunately I didn’t manage to get the loopback example to run.

The output in the terminal looks like this:

Register value after W6100 initialize!
Mac address: 01:02:03:61:00:46
IP address :
SM Mask :
Gate way :
DNS Server :
GW6 : 0102:0361:0046:6110:0B00:0000:0000:0000
LLA : 0102:0361:0046:6110:0B00:0000:0000:0000
GUA : 0102:0361:0046:6110:0B00:0000:0000:0000
SUB6 : 0102:0361:0046:6110:0B00:0000:0000:0000


I copied everything from the main file into my main.c file and also the function calls:

ctlwizchip(CW_SYS_UNLOCK,& syslock);
printf(“Register value after W6100 initialize!\r\n”);

I attached some screenshots of the SPI communication, does this look right?


Thanks for your help.

The output in my serial monitor looks like this:

I am not sure why the IP address can’t be set.

Does someone know where the problem is or point me in the right direction?

Thank you!

I found the problem:
I am using a 16bit MCU while the library is written for a 32bit MCU.

In the w6100.h file I had to add some type casting for the address registers:
#define SIPR (W6100_IO_BASE + ( (uint32_t) 0x4138 << 8) + WIZCHIP_CREG_BLOCK)

Now I can read out chip ID, network parameters and also the loopback example works.