WIZnet Developer Forum

Problems with io6Library

Hi,
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!

Hello,

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:

PHY OK.
Register value after W6100 initialize!
Mac address: 01:02:03:61:00:46
IP address : 1.2.3.97
SM Mask : 1.2.3.97
Gate way : 1.2.3.97
DNS Server : 168.126.63.1
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

NETCFGLOCK : 0

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

W6100Initialze();
ctlwizchip(CW_SYS_UNLOCK,& syslock);
ctlnetwork(CN_SET_NETINFO,&gWIZNETINFO);
printf(“Register value after W6100 initialize!\r\n”);
print_network_information();
while(1)
{
loopback_udps(0,ethBuf0,50000,AS_IPV4);
loopback_tcps(1,ethBuf3,50003,AS_IPV4);
loopback_tcps(2,ethBuf4,50004,AS_IPV6);
loopback_tcps(3,ethBuf5,50005,AS_IPDUAL);
}

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

Capture1


Thanks for your help.

The output in my serial monitor looks like this:
Capture

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.

Copyright © 2017 WIZnet Co., Ltd. All Rights Reserved.