Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

OneWire Implementation on Digital Pattern Editor

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!

0 Kudos
Message 1 of 5
(1,752 Views)

Do you happen to be familiar with Source and Capture waveforms of 657x?

 

If you're not, you need to take up training sessions from NI.

https://learn.ni.com/learning-paths/device-testing-with-digital-pattern-instruments

 

The way I would approach this is,

  1. Create a digital pattern that uses source waveforms to support writing N-bytes to the device
  2. In the test program, write an array of 0x00 to 0xFF to the source waveform and burst the pattern
  3. Now, I can reuse the same pattern to write just any data (write to source waveform, burst the pattern)
Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 5
(1,724 Views)

Hi!

 

Thanks for the suggestion.

 

I have no issues generating the sweep pattern of any byte length.

But I do have trouble assigning the time set for each bit of the pattern I send, because the pulse width for logic "0" is different for logic "1".

 

Step 3 on your suggestion seem to indicate usage of a single time set (i.e. fixed pulse width). Or maybe I'm missing something?

 

Thanks!

 

 

0 Kudos
Message 3 of 5
(1,713 Views)

Yeah, I am suggesting to create a few vectors that can generically represent a bit in OneWire data and just loop over them to a byte and then N-byte.

 

If you boil down your timing rules of a bit, you can make the common portions constant and only the different portions as source waveform.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 5
(1,671 Views)

Hi! Thanks for the suggestion.

 

Ultimately, I figured that Digital Pattern Editor logic states is level based, not time (pulse width) based as is the case for OneWire.

 

What worked is to create two timings -- one for logic '1' and another for logic '0'. Both logic states have the same bit period, but differing duty cycle %.

 

To send each byte, I use a call function to call whatever byte sequence I need. Each possible byte (all 2^8 combinations) is hard-coded with the two timings. 

 

Kind regards.

0 Kudos
Message 5 of 5
(1,602 Views)