arang Posted February 19 Share Posted February 19 Hi, I have a i2c device that uses a 16 bit memory address. Is there an option in waveforms protocol to specify it? I see I2C protocol viewer uses 8 bit address! Thanks Link to comment Share on other sites More sharing options...
0 JColvin Posted February 19 Share Posted February 19 Hi @arang, I believe that only 7-bit addressing is supported, at least as per the post from the developer here: which is also still the case in the latest beta version (3.21.29, https://forum.digilent.com/topic/8908-waveforms-beta-download/) at time of writing. I have not heard any plans to change this. Thanks, JColvin Link to comment Share on other sites More sharing options...
0 arang Posted February 20 Author Share Posted February 20 (edited) 10 hours ago, JColvin said: Hi @arang, I believe that only 7-bit addressing is supported, at least as per the post from the developer here: which is also still the case in the latest beta version (3.21.29, https://forum.digilent.com/topic/8908-waveforms-beta-download/) at time of writing. I have not heard any plans to change this. Thanks, JColvi Thanks @JColvin The device slave address is 7 bit address. The device memory addressing is 16 bit . I understand that we have to use sub address in the Waveform. How the sub address need to be specified ? say 00h 00h ? I see the device is reading garbage, the readback values are wrong! Edited February 20 by arang Link to comment Share on other sites More sharing options...
0 attila Posted February 20 Share Posted February 20 Hi @arang For hex use 0x or h prefix, b for binary and none for decimal. The scripts are coded in JavaScript. Link to comment Share on other sites More sharing options...
0 arang Posted February 20 Author Share Posted February 20 @attila Thanks. I am using the h as prefix and still, the readback values from the device is not correct! See picture below. Note: I have connected SCL, SDA using a pull up resistor to DIO 27 ( 3.3V ) In the picture below- tried to write bytes 1 2 3 , but read back as 2,2,2.. The device Ack's and I see no issue. But the readback values are wrong! Thanks Link to comment Share on other sites More sharing options...
0 attila Posted February 20 Share Posted February 20 Hi @arang If you want to send two 8bit I2C word as sub address provide two values. If you enter one value only one 8bit word will be written after the address rd/wr. Have "clock stretching" checked as it is by default. Link to comment Share on other sites More sharing options...
0 arang Posted February 20 Author Share Posted February 20 (edited) Thanks again @attila I see there is only one byte sent after the start!Fixed it now. Please see below, even after sending 2 bytes, when I try to write and read, I get garbage values from the device. What am I missing? Note: SCL, SDA is pulled up using 1k resistor and connected to DIO 27 - 3.3V supply. Thanks for your help. Edited February 20 by arang Link to comment Share on other sites More sharing options...
0 attila Posted February 20 Share Posted February 20 Hi @arang You should know better what data are you transferring. Here you can see two devices used as mast and slave: Link to comment Share on other sites More sharing options...
0 arang Posted February 20 Author Share Posted February 20 @attila Thanks Let me be clear. I would like Digital Discovery to be the Master and my device to Slave. Should I be using Master or Spy/Slave tab? If I have to use Slave tab, Where can we specify the sub address to read 16bit address. From the pictures you sent, you have specified Sub address in Master tab and how it can be used by Slave tab? Thanks. Link to comment Share on other sites More sharing options...
0 attila Posted February 20 Share Posted February 20 Hi @arang No. I used the second device as slave to show that the first device is working as master. Link to comment Share on other sites More sharing options...
0 arang Posted February 21 Author Share Posted February 21 Thanks It works. The device I was using supported only one byte read at a time. Auto increment read was causing the issues. Thanks attila 1 Link to comment Share on other sites More sharing options...
Question
arang
Hi,
I have a i2c device that uses a 16 bit memory address. Is there an option in waveforms protocol to specify it? I see I2C protocol viewer uses 8 bit address!
Thanks
Link to comment
Share on other sites
10 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now