Jump to content
  • 0

Why is the Pmod HYGRO only able to read from the top pins of the ZYBO Z720?


ilovefpga

Question

I am coding C++ in Vitis 2019.2 on the Zybo Z720 and I am only able to get temperature readings from pin 1-6 of the Pmod port. Currently trying to get the Pmod HYGRO to be able to read from both top 6 pins and bottom 6 pins, how do I do that? Attached are the code used and readings which I got from the top 6 pins and bottom 6 pins respectively. 

pmodpins.png.ca949d4e2dc9afdb3102f7c616885700.png

This is my Vitis code

Hygrocode.png.0a6a044b9ecc8b28109bb28614f5e7ad.png

Readings from top 6 pins of the Pmod port (accurate reading)

Hygroworking.png.178bbedca163a9a1cbe7a95cd725ea85.png

Readings from bottom 6 pins of the Pmod port (error reading)

Hygrofail.png.a69ac47eb4e2403fb4afbda7ce6ef96a.png

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

HUGE DISCLAIMER! You'll have to write your own I2C driver using the iic functions in Xilinx's embeddedsw repo (XIic_MasterRecv, XIic_MasterSend etc.).

image.thumb.png.e8c5388b135168ca2b609735df313f8f.png

Add the two AXI IIC IPs to your block design and let Run Connection Automation do its job or you can manually make the IIC ports external. Then go to our XDC Repo and get the Zybo-Z7-Master constraints file. 

Right click on Constraints and select Add Sources. 

image.png.99ca333156c2e45ce27d83b4c4746290.png

Click on Add Files and look for the .xdc file wherever you downloaded/saved it on your PC. Make sure Copy Constraints files into project is checked, this makes it so if you modify this .xdc file (which you will) you'll still have a fresh unmodified original which can then be imported into other projects.

image.png.5f5b1a9392de58f15b587c3ecd41df0f.png

Uncomment the lines corresponding to the Pmod port which you'll want to use, in this example I'm using JD but because of the HYGRO and AQS pmod pinout you'll only need to uncomment jd[2], jd[3] and jd[6], jd[7].

image.png.a3deed2a072f538fedf10a5e4157e9dd.png

This is the pinout for the PmodAQS and you might want/need to also use the IO/INT or WAKE/RST pins so make sure to read through its Reference Manual.

image.png.a9eb13d8b5d8c6171423988ac9dcb762.png

Make the following changes in the XDC, Validate Design, Generate Bitstream and you're good to go.

image.png.8cfb7992e109c86f07090ed942e9a585.png

 

image.png

Link to comment
Share on other sites

  • 1

image.png.c787552191ef15297fec4d90c115fc50.png

This is the pinout of the PmodHYGRO, to be able to use it on both top and bottom rows of a Pmod port you're going to need to use two AXI IIC IPs, or just one AXI IIC together with the I2C controller inside the ZYNQ processing system, with their interface IIC constrained to the Pmod port (one top row and the other bottom row) you're going to plug it into (double check to make sure you've nailed the pinout correctly). The PmodHYGRO IP also has an AXI TIMER inside it so maybe you're gonna want to add that to your block design as well (although you might be able to manage without it, not sure, since the ZYNQ also has some timers inside).

Link to comment
Share on other sites

  • 0

Hi @thinkthinkthink sorry for the late reply, this is my current block diagram. Do you mind further explaining  about using the two AXI IIC IPs to be able to use both top and bottom rows of the Pmod port. Would I then be able to use Pmod HYGRO on the top Pmod port and Pmod AQS on the bottom Pmod port? (trying to free up one extra port for another AD1)

1790117609_Screenshot2021-10-26130950.png.efb2caf34c87c3f86526f6f91be2394b.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...