PYNQ: PYTHON PRODUCTIVITY

What is the pin number for dedicated ISP on Arduino shield?

I’m reading spi.c from pynq repository PYNQ/spi.c at master · Xilinx/PYNQ · GitHub
to design an application using Arduino header on PYNQ-Z2. My goal is to use the dedicated 6-pin spi header image. However, it has no pin number.

Attached is the pin number for spi on Arduino header for your reference. (I’m not using these pins due to some design constraints. )
image

Any idea which are the pin numbers for that or, I should use some different “code” for that pins?Like, ICSP-4, ICSP-3…
image

Thanks in advance.

There are no pin numbers for the dedicated SPI port as the pins aren’t multiplexed instead there is a separate SPI controller. You can get access to it by calling spi_open_device(0).

Peter

1 Like

Awesome. I go have a test to see how it goes and update here. Many thanks for that.

1 Like

If go to this post, Dedicated SPI pin numbers for PYNQ-Z1 IOP app - #6 by rock, it might indicate that the device number is ‘1’ instead.

By the way, when calling “spi_transfer()” it seems there is no place to specify the slave register address to read from , in case Z2 is master. Anything I’ve missed here?
Thanks.

I might have got the number wrong - it was based on a quick glance through the block diagram/xparameters.h. SPI doesn’t have a dedicated mechanism for providing addresses. You should look at the datasheet of the part you are connecting to to see how to perform register accesses. Most involve transferring enough bytes for the address and data with a read/write flag somewhere but the specifics will depend on the device.

Peter

I tested out and it is 0. many thanks.