Skip to content

Conversation

@irinakim12
Copy link

@aallan aallan added enhancement New feature or request paused Waiting for internal availability labels Apr 6, 2021
@aallan
Copy link

aallan commented Apr 6, 2021

This looks good. We'll just have to grab a module and confirm that it's working and then we'll merge it in. This will probably get allocated to an intern over the summer, as we're going to be adding a lot of example code for various breakouts.

.gitignore Outdated
.DS_Store
*.pdf
spi/w5500_spi/mpu9250_spi.fzz
spi/w5500_spi/mpu9250_spi_bb.png
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to add these to .gitignore, just delete them from your local directory 😃

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deleted the .gitignore on my local.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You've also (accidentally?) deleted it from this repo too, which you don't want to do.

#include "loopback.h"


/* Example code to talk to a wiznet MEMS accelerometer and gyroscope.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh? 😉

GPIO 3 (pin 5) MOSI/spi0_tx -> SDA on wiznet board
GPIO 4 (pin 6) MISO/spi0_rx-> ADO on wiznet board
GPIO 5 (pin 7) Chip select -> NCS on wiznet board
GPIO 6 (pin 9) SCK/spi0_sclk -> SCL on wiznet board
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You seem to have spi0_sclk mentioned twice?

return rx;

}
static void wiznet_write(uint8_t reg){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix indentation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fix indentation

#endif
setSn_IR(sn,Sn_IR_CON);
}
if((size = getSn_RX_RSR(sn)) > 0) // Don't need to check SOCKERR_BUSY because it doesn't not occur.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird indentation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed indentation. Check the one more time, please

//////////////////////////////////////////////////////////////////////////////////////////////
// Data Transaction Parts; Handle the [data receive and send] process
//////////////////////////////////////////////////////////////////////////////////////////////
if((size = getSn_RX_RSR(sn)) > 0) // Sn_RX_RSR: Socket n Received Size Register, Receiving data length
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird indentation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed indentation. Check the one more time, please

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation still seems a bit all over the place, but I think that might be because you're mixing tabs and spaces? 🤷

// first, then subsequently read from the device. The register is auto incrementing
// so we don't need to keep sending the register we want, just the first.
uint8_t rx = 0, tx = 0xFF;
spi_read_blocking(SPI_PORT, &tx, &rx, 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird indentation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed indentation. Check the one more time, please


[NOTE]
======
This is a very basic example, and it send and receive data from the WIZ850io(W5500).After you get off the communication command(S"n"_CR) on the WIZ850io, make sure the communicationcommand is clear."n" is socket number.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space in "communicationcommand"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I fixed this line

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it going on? Is it stopped?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See Alasdair's comment above: "This will probably get allocated to an intern over the summer, as we're going to be adding a lot of example code for various breakouts."

@aallan
Copy link

aallan commented Jun 25, 2021

@matiasilva I don't think the hardware for this is on your desk yet. But when it arrives can you take a look at this PR?

@aallan aallan removed the paused Waiting for internal availability label Jun 25, 2021
@aallan
Copy link

aallan commented Jul 1, 2021

@matiasilva We're also getting a couple of these boards, https://dokkodai.tistory.com/198, also based on the W5500, sent to us at the office. Hopefully the code should work on both, if not we probably have to generalise it before merging the PR.

@aallan
Copy link

aallan commented Jul 20, 2021

Passed to @aayushijhaveri.

@aayushijhaveri
Copy link

Just tried running the code on the W5500 board from https://dokkodai.tistory.com/198 and it looks like it is working fine. It's printing out the Mac address, IP address etc.

@aallan
Copy link

aallan commented Jul 20, 2021

Needs to be redrawn using Fritzing to match other diagrams,

image

there is a Wiz8250io part in the current Fritizing package AFAIK.

Copy link

@aallan aallan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extensive changes needed.

@@ -0,0 +1,59 @@
= Attaching a W5500 via SPI

This example code shows how to interface the Raspberry Pi Pico to the WIZ850io(W5500) board. The particular device used can be interfaced via SPI, we are using SPI, and interfacing at 3.3v.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to mention the alternative board that we've now tested with, and any alternative arrangements needed, e.g. wiring etc?

[NOTE]
======
This is a very basic example, and it send and receive data from the WIZ850io(W5500).After you get off the communication command(S"n"_CR) on the WIZ850io, make sure the communication command is clear."n" is socket number.
It is also use the polling approach in the example.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs reworded.

* 3.3v (pin 36) -> VCC on IZ850io(W5500) board
* GND (pin 38) -> GND on IZ850io(W5500) board

The example here uses SPI port 0. Power is supplied from the 3.3V pin.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs reworded using standard language.


[NOTE]
======
There are many different manufacturers who sell boards with the WIZ850io(W5500). Whilst they all appear slightly different, they all have, at least, the same 6 pins required to power and communicate. When wiring up a board that is different to the one in the diagram, ensure you connect up as described in the previous paragraph.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Repetitive wording.

| *Item* | *Quantity* | Details
| Breadboard | 1 | generic part
| Raspberry Pi Pico | 1 | http://raspberrypi.org/
| WIZ850io(W5500) board| 1 | https://eshop.wiznet.io/shop/module/wiz850io/
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to reference alternatives. It's essentially a generic part.

//! \version 1.0.3
//! \date 2013/10/21
//! \par Revision history
//! <2015/02/05> Notice
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a frozen version. Instead of inserting this static version should be use the external library directly?

//! * Redistributions in binary form must reproduce the above copyright
//! notice, this list of conditions and the following disclaimer in the
//! documentation and/or other materials provided with the distribution.
//! * Neither the name of the <ORGANIZATION> nor the names of its
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Broken version of BSD 3 clause. Needs fixing if we're including the code in the repo.

//! \version 1.0.2
//! \date 2013/10/21
//! \par Revision history
//! <2015/02/05> Notice
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tempted to say that we should not include this code in the example, instead provide instructions to pull it from its own repo into a preconfigred place. Including it in this fashion seems unwise.

WIZCHIP.IF.SPI._write_byte((AddrSel & 0x0000FF00) >> 8);
WIZCHIP.IF.SPI._write_byte((AddrSel & 0x000000FF) >> 0);
}
else // burst operation
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird comments?

//! \author MidnightCow
//! \copyright
//!
//! Copyright (c) 2013, WIZnet Co., LTD.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same again for this file.

@aallan
Copy link

aallan commented Jul 28, 2021

So @aayushijhaveri has picked up this PR and done some more work on it. So closing this PR in favour of #147. We'll talk about W5500 example support over there. Many thanks!

@aallan aallan closed this Jul 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants