Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not printing the received data in AxiIIC #1

Open
abdur-rehman-khalid opened this issue Dec 6, 2021 · 2 comments
Open

Not printing the received data in AxiIIC #1

abdur-rehman-khalid opened this issue Dec 6, 2021 · 2 comments

Comments

@abdur-rehman-khalid
Copy link

I'm communicating with I2C GYROSCOPE sensor using this code. All the code works well, but it's not printing the received data values.

from pynq import Overlay
from pynq import MMIO
import time
from time import sleep, time

import pynq.lib as lib

class IIC:
    
    overlay = None
    i2c = None
    def init_hw(self, filepath):
        self.overlay = Overlay(filepath)
        self.overlay.download()

    def __init__(self, bitstream_file):
        # Initializing bitstream
        self.init_hw(bitstream_file)
        self.i2c = lib.AxiIIC(self.overlay.ip_dict['axi_iic_0'])

i2c = IIC("/home/xilinx/pynq/overlays/iic_test/iic.bit").i2c

add = 0x68
buf = [117]
i2c.send(add, buf, 1, 0)

test = []
i2c.receive(add, test, 3, 0)
print(test)

In this code, by sending the 0x75 and in response receiving the 0x71. But it only prints the length of not the received bytes.

image

You can see the in bridge results through the Saleae Logic Analyzer

image

@EnricoGiordano1992
Copy link
Member

What is your "I2C GYROSCOPE"? Can you share the ID or the model (or a link to eBay or similar)?

And do you have a working code (in another language or platform) that you can provide in order to check the right behavior?

@abdur-rehman-khalid
Copy link
Author

Thanks Enrico for responding, I'm working on FPGA designs for these major protocol layouts like UART, I2C and SPI. My area is only in Python designs and I'm working on to create the libraries for these layouts in it. That's why, I've not the code in other languages for this core. We can collaborate to write the better class for this Axi IIC layout rather than relying on PYNQ builtin classes as you have did with UART core.

I'm using the MPU-9250 Gyroscope just for testing the I2C behaviour on this layout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants