Initial SPI communication 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: Initial SPI communication problem
by Coccoliso ·
Hello ashrpat,
[quote=“ashrpat”]
Master is configured so that its SPI clock ideal state is HIGH. It puts data on MOSI pin at falling edge. Also master samples the data in the middle of data output time (ie. at rising edge) .
W5500 operates in SPI mode 0 or 3. It puts data on MISO at falling edge and samples data at rising edge.I am getting some data.I got correct data only one time. [/quote]
I initially had my same problem and the only possible configuration to achieve a speed of OscDiv4 (40MHz xtal) is as follows:
While the initialization sequence that I have used is the following:
Unfortunately not development directly in assembler, I develop with Swordfish and Firewing compilers and assembler generated is quite cryptic but in both cases with their standard SPI libraries this approach works.
If you are able to read the source library BASIC you find it here:
[url]http://www.firewing.info/pmwiki.php?n=FirewingUser.W5500[/url]
Source file driver for the SPI is in “W5500-Regs.bas”
… I hope you can take advantage of it.
RE: Initial SPI communication problem
by ashrpat ·
Thanks for the reply. i am trying use Wiz550io without using any library. can you please clarify the following?
should SPI be configured in different mode for write and read? I am not getting proper data in writing and reading using same SPI mode. Wiznet has frequency of 25MHz. At what oscillator frequency should master operate?
RE: Initial SPI communication problem
by Coccoliso ·
With any PIC SPI interface (both PIC18, PIC24) the most important thing is setting the SPI :
Clock: spiIdleLow, spiRisingEdge
Sample: spiSampleEnd
and the source that you posted does not seem that you have done so.
ONLY IN THIS WAY I could synchronize myself properly with the data read from this module.
The PIC24 version works clocked at 80MHz
The PIC18 version works clocked at 10MHz with PLL enabled (40MHz)
In both cases the SPI works with a frequency divided by 4.
The device that I used as the PIC18 is the PIC18F2682.
However to write BASIC libraries for this device I left from the examples in C ++ that you can find in the WIZNET site where you downloaded the datasheet. In the examples of DHCP and DNS, even if they uses only UDP, there are all the necessary functions to initialize and read through SPI including the protocol (SW/HW) for reading and writing in the W5500 registers.
RE: Initial SPI communication problem
by hjjeon0608 ·
Hi,
I think you are wrong at address phase.
If you want to read data at 0x000F, write 00 first and then 0f.
First 8bit is MSB and last 8bit is LSB.
Try to change your code.