Jump to content
  • 0

Some problems in using Protocol and Pattern tool


WCL

Question

Hi all,

I'm trying to use Protocol(I2C Master) to communicate with my slave device.
Here is the I2C Protocol signal:
1450787341-3597609114_n.png.526d0f586b9f107c73c4d129991ff74b.png

and here is signal from logic analyzer:
1903096277_I2CMaster.thumb.PNG.5c78301c144844266834831e15f9e701.PNG

Q1. The protocol works fine when I transmit slave address, but why the STOP pulse is occur after the last clock?

 

Then, I try to generate a I2C Master signal by Pattern tool.
Here is my signal:
Pattern2.thumb.PNG.c45c9fd24ab3525a9387c395b374932a.PNG

I think this signal is more like the first picture? but my slave device doesn't work fine...

Q2. Does anyone try to generate I2C master signal by using script or Pattern?

 

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

Hi, @attila

Thank you for your reply. but do you know why the Q1 and how the Q2?

If I generate signal by using script to control Pattern tool, like this:
 

var rg1 = [0,1,0,0,1,0,0,0,0]
Patterns1.Channels.DIO0.custom = rg1

but I need to wait ACK from my slave device. Do you know how to do?

 

Thanks

Link to comment
Share on other sites

Hi @attila,

I'm trying "wait(second)" function in my script. After testing, the smallest delay time is about 10ms?

I programmed script like this:

for(var i = 0; wait(0.01) && i < 1000; i++){
	StaticIO.Channel0.DIO0.value = 0;
	wait(0.01)
  	StaticIO.Channel0.DIO0.value = 1;
}

and it should be 50Hz, but the scope shows 25Hz, Is it because of delays?

Thanks

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...