Usually NOP gives 1 cycle delay. But the CPU can sometimes skip it without any delay. In other cases, a previous instructions can still be within the CPU's pipeline and cause delay, which technically isn't due to the NOP instruction but the...
@jmarsh
1. I think you're right.
When I remove the oscilloscope ground, it works fine.
2. Can I ask a question because I don't know much?
asm("nop") : What is this?
Is it like a fixed delay? I don't know much, so I'm asking.
For the sake of experimentation, I tried adding a short delay. It turns out 6 NOP instructions are needed to get the math waveform to "look bad" when viewed on my 200 MHz bandwidth scope. (higher bandwidth might be able to observe this with...
I think the original image shows the 'scope's channel difference (Math -), which will of course be spikey as digitalWriteFast is not instantaneous. You need to simulataneously write two GPIO's with a single register access to get properly...
I repeated this test with Teensy 4.1. Same setup, same code from msg #1.
You can see the frequency is slightly higher, due to Teensy 4.1 having much faster speed for the slight software overhead while bit-banding this waveform.
Again, here's...
From what I gather, they're trying to generate some sort of TMDS signal using two GPIOs. The pink trace in the first picture is generated using a T3.5 but using the same code on a T4.1 is failing and generating the green trace.
I ran your program from msg #1 on a Teensy 3.5. Here are the waveforms my oscilloscope sees.
Here's a photo of the test setup on my workbench, so you can see how I tested (about as simple as possible)
If they didn't the default Blink sketch (that turns the onboard LED on and off) wouldn't even work.
You are not giving us proper information here, which makes it very difficult for anyone to help you. You need to give a proper description of...
How are the GNDs connected ???
What is the transmission line length ??? some millimeters ?? some centimeters ??? some meters ???
If your line is long, use RS422 or RS485 line drivers. With 120ohms termination resistors and twisted pair cable...
Does it look broken when run with a longer delay? Just to confirm the scope connects.
What is the upper non-Green line showing
Replace the WriteFast with ToggleFast after setting them out of sync like at the end of the If()
Toggle works with...
@PaulStoffregen
@MarkT
@jmarsh
Thank you for your reply. I'll send you the test photos.
1. The waveform is fine.
2. When measuring (CLOCK-H) and (CLOCK-L) as waveforms, the waveform is broken.
- The waveform is broken when connected to a scope.
@Angelo
1. Thanks for the answer.
2. The length of the transmission line is in 'cm'.
3. GND is not used.
4. The frequency is around 2MHz.
- Can I use 'With 120ohms termination resistors'? Is it beneficial?
5. I feel that 'digitalWrite' and...
@jmarsh
Thank you for your answer.
It's a communication protocol between each other. It's already set.
@defragster, @jmarsh
1. It seems possible to create a 'clock' through 'ToggleFast'.
2. At this time, you need to judge and give a signal...
@defragster
Thank you for your answer.
[The version I used is 1.56.]
1. The different colored waveforms were created using 'Teensy3.5'.
(The delay values are different.)
2. I'll test it with 'digitalToggleFast'.
Thank you for your answer.
3...
Teensy 4.1 digitalWrite, digitalWriteFast Problem
[Environment]
1. I want to create a 2MHz clock.
2. The signals of 'CLOCK_H' and 'CLOCK_L' are inverted.
[Problem]
1. The waveform is broken.
What is the reason?
Green Waveform: CLOCK_H ~...