Same code working differently on Nano 33 IoT and Mega

How does the signal look like when you zoom into the time scale so you can see the individual bits? The spikes could be artifacts.