WIZnet Developer Forum

W5500 and CC3200 SPI

Hello,

I am new to using SPI and I am trying to connect the CC3200 as the master. For now I am just trying to establish basic connectivity and get the W5500 to ping via the Ethernet cable. How can I go about doing this? I haven’t been able to find any example code online for this. From what example code I have seen for the CC3200, I have been able to send data to the wiznet, but I am unable to get a reply from the w5500 about if it was received, and I don’t know how to go about sending data from the wiznet back to the CC3200.

Thank you

Already answer!!

[url]W5500 and CC3200 SPI]

Hi,
for every MPU first of all you need to know how to set the SPI as a master, identify an I / O for use as SCS and using the bit-bang try reading a known register like the VERSIONR that always returns 0x55 and 0x00.
You must first be able to do all this.

The sequence to read a register in VDM with bit-bang is this:
Low SCS
SPIWriteByte Addr_high_part
SPIWriteByte Addr_low_part
SPIWriteByte BlockOP
Result = SPIReadByte
High SCS

The sequence to write a register in VDM with bit-bang is this:
Low SCS
SPIWriteByte Addr_high_part
SPIWriteByte Addr_low_part
SPIWriteByte BlockOP
SPIWriteByte Data
High SCS

The sequence to read from RX buffer in VDM with bit-bang is this:
Low SCS
SPIWriteByte Addr_high_part
SPIWriteByte Addr_low_part
SPIWriteByte (RXBlock <<3 )
Return_Data(0) = SPIReadByte
Return_Data(1) = SPIReadByte

Return_Data(n) = SPIReadByte
High SCS

The sequence to write into TX buffer in VDM with bit-bang is this:
Low SCS
SPIWriteByte Addr_high_part
SPIWriteByte Addr_low_part
SPIWriteByte ((TXBlock <<3 ) Or 4) // VDM write
SPIWriteByte Data_Byte(0)
SPIWriteByte Data_Byte(1)

SPIWriteByte Data_Byte(n)
High SCS

Where:
BlockOP = 0 for common register
BlockOP = (1 + 4 * Socket_number ) for socket register
TXBlock = (2 + 4 * Socket_number ) for a TX buffer write
RXBlock = (3 + 4 * Socket_number ) for a RX buffer read

To ping device you must set mac, gateway address, ip address and subnet mask registers.
Buffers are set to 2k by default.
Send a reset with 0x80 into MR register and then set these 4 registers…anything else, device must respond

I am supposed to write this code in the IDE for the CC3200 (Code Composer), correct? I assume I am supposed to use the WIZnet ioLibrary functions to perform these actions, but Code Composer can’t recognize the data types of the WIZnet ioLibrary such as uint8_t, unint16_t, etc.

hi,
no.
It just the sequence of SPI commands necessary to reading and writing.
You can hardly find the source ready unless you do not find in this forum or in that of your MPU someone who has already developed (as SteveS here [url]WIZ550io SPI problems]) .
As I said in my previous post you must have knowledge of your library and use the SPI sequence that I have presented to perform the four basic operations :

  • Reading a register
  • Writing of a register
  • Reading RX buffer at Addr location
  • Writing TX buffer at Addr location

The examples that are on the site as explained here [url]W5500 and CC3200 SPI] contain all the features that you need and are well commented but they are not written for your IDE, you have to take note of the sequences but you can not throw them directly into your editor and compile.
These are the problems… uint8_t is a Byte , unint16_t is a Word ( or a UShort ) and are the types that must be converted to be recognized by your compiler, I understand it’s a big job and you must first read and understand them before translating but the thing is possible.
I converted these sources for the PIC18 (8 bit) and PIC24 (16 bit) and I know what we’re talking.

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