One byte transfer in burst mode
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: One byte transfer in burst mode
by becky ·
Hello,
Please refer to the link above.
This code is to control WIZnet CHIP through DMA communication using STM32F103.
Considering that a Socket INVALID ERROR occurs, your code does not seem to send or receive data properly.
RE: RE: One byte transfer in burst mode
by Deusex25 ·
Hi Becky.
Thanks for help.
My code modification is right in this example. There was a hardware issue. Now it is solved.
I managed to get it working with variant I have suggested:
uint8_t WIZCHIP_READ(uint32_t AddrSel) //This function is altered for SPI Burst operations
{
uint8_t ret;
uint8_t spi_data[4];
WIZCHIP_CRITICAL_ENTER();
WIZCHIP.CS._select();
AddrSel |= ( W5500_SPI_READ | W5500_SPI_VDM_OP );
if(!WIZCHIP.IF.SPI._read_burst || !WIZCHIP.IF.SPI._write_burst) // byte operation
{
WIZCHIP.IF.SPI._write_byte((AddrSel & 0x00FF0000) >> 16);
WIZCHIP.IF.SPI._write_byte((AddrSel & 0x0000FF00) >> 8);
WIZCHIP.IF.SPI._write_byte((AddrSel & 0x000000FF) >> 0);
ret = WIZCHIP.IF.SPI._read_byte();
}
else // burst operation
{
spi_data[0] = (AddrSel & 0x00FF0000) >> 16;
spi_data[1] = (AddrSel & 0x0000FF00) >> 8;
spi_data[2] = (AddrSel & 0x000000FF) >> 0;
WIZCHIP.IF.SPI._read_burst(spi_data, 4);
ret = spi_data[3];
}
WIZCHIP.CS._deselect();
WIZCHIP_CRITICAL_EXIT();
return ret;
}
There is a little advantage in speed, as there is no gap between address + control bytes and receiving data byte.
Besides this I do not need to register reg_wizchip_spi_cbfunc. The only functions I have to register are reg_wizchip_cs_cbfunc and reg_wizchip_spiburst_cbfunc.