W5500 + ioLibrary + starting an aplication (C language problem)
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Ethernet Chips
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: W5500 + ioLibrary + starting an aplication (C language problem)
by ccardenas ·
Hi, I know this is old but maybe it will help someone.
I face kind of the same issue in the past. My c abilities are limited, The great thing is that the ioLibrary basically do everything for you. If you have SPI working is really easy to set the information you need. Take your time and check some of the files in the library so you can understand more.
In you main file include:
#include “wizchip_conf.h”
#include “w5500.h”
#include “socket.h”
Those are provided by the ioLibrary.
For DHCP you need sockets and your wiznet needs a mac address (you can fake it, at least for testing).
wiz_NetInfo wiz_net_info={
{0x11,0x22,0x33,0x44,0x55,0x66} // Source Mac Address
};
DHCP need to run a specific function every 1 sec. something like this.
/*
*/
void timer_one_second(void)
{
DHCP_time_handler(); //this function needs to be called every 1 sec (is used for timeouts, etc.)
}
inside your main function call:
setSHAR(wiz_net_info.mac); // set the mac address
Then you have to initialize DHCP:
DHCP_init(0,buffer); // initializes dhcp on socket 0, W5500 have 0-7 sockets;
After that in your main loop call:
DHCP_run();
That should make dhcp works.