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)
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:
- 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: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? - What I would like to do is:
- Define a variable, say, "byte_to_send" and assign a value to it.
- Create an expression or function within the Digital Pattern Editor that will assign the correct time set for each bit depending on its value.
- Assign a new value for byte_to_send and loop 2.1 to 2.2.
- Or perhaps there's a better way to implement the intended steps above?
Thanks!