Quantcast
Channel: Digital I/O topics
Viewing all articles
Browse latest Browse all 2195

OneWire Implementation on Digital Pattern Editor

$
0
0

Hi!

 

I am doing a custom onewire implementation where the bitstream logic 1 and 0 is expressed by changing the pulse width within a fixed bit period as shown below (kindly disregard trise and tfall for now)

 

armanu_0-1705635257091.png

 

 

If the DUT reads "vhigh" level at time = tread (3us) then it reads a "1" (the red waveform), otherwise if it reads "vlow" then "0" (blue waveform).

 

Using the Digital Pattern Editor, I was able to create a timing waveform for both the logic "1" and "0" and those show up fine when probed with an oscilloscope.

 

My questions are:

  1. How do I simplify sending long bitstreams using the Digital Pattern Editor? For example, if I have to send one byte of data = 0xA3, I have to define each bit on the *.digipat file with the timeset for either logic 1 or 0.
    It looks like below:
    armanu_1-1705636181911.pngarmanu_2-1705636258796.png

    But what if I want to sweep the byte value from 0x00 to 0xFF?
    Do I have to create a pattern file that will explicitly define each bit's time set? 

  2. What I would like to do is:

    1. Define a variable, say, "byte_to_send" and assign a value to it.
    2. Create an expression or function within the Digital Pattern Editor that will assign the correct time set for each bit depending on its value.
    3. Assign a new value for byte_to_send and loop 2.1 to 2.2.
  3. Or perhaps there's a better way to implement the intended steps above?

Thanks!


Viewing all articles
Browse latest Browse all 2195

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>